/* ==========================================================================
   MafLabs Prompt Diff & Variable Filler - Global Stylesheet
   Theme: Pure light theme with dual-radial glow mesh, frosted glassmorphism,
   custom split-screen workspace, diff highlighters, and responsive layouts.
   ========================================================================== */

/* Self-hosted Font Declarations with local fallback */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('fonts/Outfit-Bold.woff2') format('woff2'),
       local('Outfit Bold'),
       local('Outfit-Bold'),
       local('Outfit');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/Inter-Regular.woff2') format('woff2'),
       local('Inter'),
       local('Inter-Regular');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2'),
       local('JetBrains Mono'),
       local('JetBrainsMono-Regular');
}

: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;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-btn: 10px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  
  /* Status Colors */
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  
  /* Diff Highlights */
  --diff-removed-bg: #fee2e2;
  --diff-removed-text: #991b1b;
  --diff-added-bg: #dcfce7;
  --diff-added-text: #166534;
  --diff-dimmed-text: #64748b;

  /* 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: ui-monospace, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  color: var(--body);
  background-color: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* 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 Utility */
h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  color: var(--heading);
  letter-spacing: -0.025em;
  font-weight: 700;
}

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

/* Container */
.site-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Top Global Header */
.site-header {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.site-header .header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
}

.brand-name .brand-maf {
  color: #0f172a;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--body);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--brand-blue);
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--heading);
  cursor: pointer;
  width: 44px;
  height: 44px;
}

/* Mobile Drawer */
.mobile-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.1);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.drawer-links a {
  text-decoration: none;
  color: var(--heading);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  display: block;
}

/* Compact Hero Section (<140px on desktop) */
.hero-compact {
  padding: 0.75rem 0 0.5rem 0;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.775rem;
  color: var(--muted);
  background: rgba(241, 245, 249, 0.7);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
}

.hero-title {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 0.875rem;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* WORKSPACE CONTAINER (Fills Viewport: 100dvh - header - hero - toolbar) */
.workspace-wrapper {
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  position: relative;
}

.workspace-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 175px);
  min-height: 560px;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Focus Mode State */
.workspace-card.focus-mode {
  position: fixed;
  inset: 0;
  z-index: 1000;
  height: 100vh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  border-radius: 0;
  border: none;
  background: #ffffff;
}

/* App Toolbar */
.app-toolbar {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

/* Top-level Segmented Control Tabs */
.segmented-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--body);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.tab-btn:hover {
  color: var(--heading);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--brand-blue);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Buttons */
.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: var(--radius-btn);
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 36px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.38);
}

.btn-secondary {
  background: #ffffff;
  color: var(--heading);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-btn);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  min-height: 36px;
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* Secondary Sub-toolbar for Diff view mode and granularity */
.view-subtoolbar {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(248, 250, 252, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.825rem;
}

.diff-mode-group, .gran-group, .opts-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chip-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 0.775rem;
  color: var(--body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  border-color: var(--brand-blue);
}

.chip-btn.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.775rem;
  color: var(--body);
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--brand-blue);
}

/* Progress bar for heavy operations */
.diff-progress-bar {
  height: 3px;
  width: 100%;
  background: #e2e8f0;
  overflow: hidden;
  display: none;
}

.diff-progress-bar.active {
  display: block;
}

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

/* Panes Container (Split-Screen) */
.workspace-panes {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Single Pane Structure */
.split-pane {
  flex: 1 1 50%;
  min-width: 25%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

.pane-header {
  padding: 0.45rem 0.75rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 40px;
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
}

.pane-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pane-dot.old { background: var(--error); }
.pane-dot.new { background: var(--success); }
.pane-dot.tpl { background: var(--brand-blue); }
.pane-dot.out { background: var(--brand-violet); }

.pane-stats {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.pane-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pane-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.775rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  min-height: 28px;
}

.pane-action-btn:hover {
  background: #ffffff;
  border-color: var(--card-border);
  color: var(--heading);
}

/* Pane Body & Editor */
.pane-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.pane-editor {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--heading);
  background: transparent;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.pane-editor::placeholder {
  color: #94a3b8;
}

/* Diff Viewer Panes */
.diff-view-pane {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  background: #fafbff;
}

.diff-tag-removed {
  background: var(--diff-removed-bg);
  color: var(--diff-removed-text);
  text-decoration: line-through;
  padding: 1px 3px;
  border-radius: 3px;
}

.diff-tag-added {
  background: var(--diff-added-bg);
  color: var(--diff-added-text);
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 3px;
}

.diff-tag-dimmed {
  color: var(--diff-dimmed-text);
}

.diff-tag-active-jump {
  outline: 2px solid var(--brand-blue);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* Minimap Overview Strip */
.diff-minimap-strip {
  width: 12px;
  background: #f1f5f9;
  border-left: 1px solid var(--card-border);
  position: relative;
  cursor: pointer;
  height: 100%;
  user-select: none;
}

.minimap-marker {
  position: absolute;
  width: 100%;
  height: 3px;
  border-radius: 1px;
}

.minimap-marker.removed { background: var(--error); }
.minimap-marker.added { background: var(--success); }

/* Draggable Vertical Divider */
.split-divider {
  width: 10px;
  background: #f1f5f9;
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  cursor: col-resize;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  z-index: 10;
  transition: background 0.15s ease;
}

.split-divider:hover, .split-divider.dragging {
  background: #e2e8f0;
}

.split-divider-grip {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: #cbd5e1;
}

/* TAB 2: Dynamic Variables Form & Preview */
.variables-collapsible-panel {
  max-height: 40%;
  border-top: 1px solid var(--card-border);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.variables-collapsible-panel.expanded {
  max-height: 60%;
}

.variables-panel-header {
  padding: 0.45rem 0.75rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
}

.variables-fields-list {
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.var-input-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.var-card-title {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--brand-blue);
}

.var-card-badge {
  font-size: 0.725rem;
  color: var(--muted);
}

.var-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  resize: vertical;
}

/* Warnings and Notices */
.alert-banner {
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

/* Variable Diffs Pill Bar */
.var-diff-bar {
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.775rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Popover Menu / Modal Sheets */
.popover-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  z-index: 100;
  min-width: 260px;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-panel {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  max-width: 560px;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

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

/* Shortcuts Cheat Sheet Table */
.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.shortcut-table td {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.shortcut-kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 0 #cbd5e1;
  color: var(--heading);
}

/* Undo Toast */
.undo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  z-index: 2000;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.undo-toast.active {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.undo-toast-btn {
  background: #2563eb;
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Aria Live Region */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* SEO Content Below Workspace */
.seo-content-section {
  padding: 2.5rem 0;
  color: var(--body);
}

.seo-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.seo-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

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

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

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

.seo-card code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--brand-blue);
}

.code-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

.code-block-box {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.5;
  overflow-x: auto;
}

.faq-details {
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 0;
}

.faq-details:last-child {
  border-bottom: none;
}

.faq-summary {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

.faq-answer {
  padding-top: 0.75rem;
  font-size: 0.925rem;
  line-height: 1.6;
}

/* Footer & More Tools */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 3rem 0 5rem 0;
  background: rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 10;
}

.more-tools-row {
  margin-bottom: 2rem;
}

.more-tools-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.75rem;
}

.tools-chips-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-chip {
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tool-chip:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: translateY(-1px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Rules */
@media (max-width: 900px) {
  .site-header {
    height: 56px;
  }

  .nav-links {
    display: none;
  }

  .hamburger-btn {
    display: flex;
    width: 44px;
    height: 44px;
  }

  .hero-compact {
    padding: 0.5rem 0;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-subtitle {
    white-space: normal;
  }

  .tab-btn, .btn-primary, .btn-secondary, .mobile-action-bar button {
    min-height: 44px;
  }

  .workspace-card {
    height: auto;
    min-height: auto;
    margin-bottom: 5rem;
  }

  .workspace-panes {
    flex-direction: column !important;
  }

  .split-pane {
    min-height: 60dvh;
    width: 100% !important;
    border-bottom: 1px solid var(--card-border);
  }

  .split-divider {
    display: none !important;
  }

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

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

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