/**
 * MafLabs Tool Design System - llms.txt Generator & Validator
 * 100% Client-side, light theme only, responsive split-screen with draggable divider.
 */

@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: ui-monospace, 'JetBrains Mono', 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;
}

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

/* Soft Mesh Glow Background (Pure CSS Radial Gradients) */
.mesh-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 18%, rgba(169, 214, 245, 0.55) 0%, rgba(169, 214, 245, 0) 45%),
    radial-gradient(circle at 92% 16%, rgba(227, 201, 243, 0.45) 0%, rgba(227, 201, 243, 0) 45%),
    linear-gradient(180deg, transparent 70%, #ffffff 100%);
  filter: blur(55px);
  -webkit-filter: blur(55px);
}

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

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

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-icon {
  flex-shrink: 0;
}

.brand-maf {
  color: var(--heading);
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--heading);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
}

/* Compact Hero (< 140px on desktop) */
.hero-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px 4px 24px;
  text-align: center;
}

.hero-badge-wrap {
  margin-bottom: 4px;
}

.pill-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.025em;
  margin-bottom: 2px;
  line-height: 1.2;
}

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

.hero-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 3px auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.privacy-callout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--success-text);
  font-weight: 500;
}

/* Toolbar */
.toolbar-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 6px 24px;
}

.toolbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 7px 14px;
  box-shadow: var(--shadow-card);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  min-height: 36px;
}

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

.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);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--heading);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 30px;
}

.icon-only {
  width: 36px;
  padding: 0;
  font-weight: 700;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

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

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

.popover-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 6px;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--body);
  cursor: pointer;
}

.toggle-option input[type="checkbox"] {
  accent-color: var(--brand-blue);
  cursor: pointer;
}

.popover-footer {
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover {
  text-decoration: underline;
}

/* WORKSPACE SPLIT CONTAINER */
.workspace-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 24px 24px 24px;
  display: flex;
  height: calc(100dvh - 215px);
  min-height: 560px;
  position: relative;
  gap: 0;
}

/* Cards & Panes */
.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);
}

.pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

#leftPane {
  width: calc(50% - 6px);
}

#rightPane {
  width: calc(50% - 6px);
}

/* Resizable Divider */
.pane-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;
}

.divider-handle {
  width: 4px;
  height: 38px;
  border-radius: 2px;
  background: #cbd5e1;
  transition: background 0.15s ease, height 0.15s ease;
}

.pane-divider:hover .divider-handle,
.pane-divider.dragging .divider-handle {
  background: var(--brand-blue);
  height: 52px;
}

/* Pane Header & Body */
.pane-header {
  padding: 8px 14px;
  background: var(--card-surface-low);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  min-height: 48px;
}

.pane-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

/* Pane Tabs */
.pane-tabs, .output-tab-toggle {
  display: flex;
  align-items: center;
  background: var(--card-surface-high);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

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

.pane-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-stat {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card-surface-high);
  color: var(--muted);
  font-weight: 500;
}

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

/* Tab Panels */
.tab-panel, .output-view {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.tab-panel.active, .output-view.active {
  display: flex;
}

/* Scrollable Form Builder */
.form-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-card {
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--heading);
}

.required {
  color: var(--error-text);
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--heading);
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-input);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: var(--focus-ring);
}

.form-textarea {
  resize: vertical;
  line-height: 1.5;
}

/* Sections List */
.sections-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.sections-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}

.sections-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.section-header-bar {
  padding: 8px 12px;
  background: var(--card-surface-low);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-name-input {
  flex: 1;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  border-radius: 6px;
}

.section-name-input:focus {
  border-color: var(--brand-blue);
  background: #ffffff;
  outline: none;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-tool {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-tool.danger:hover {
  color: var(--error-text);
  border-color: var(--error-border);
  background: var(--error-bg);
}

.links-list {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row {
  display: grid;
  grid-template-columns: 20px 1.2fr 1.8fr 1.5fr 28px;
  gap: 6px;
  align-items: center;
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 8px;
}

.link-drag-handle {
  color: #94a3b8;
  cursor: grab;
  font-size: 14px;
  user-select: none;
  text-align: center;
}

.link-input {
  font-size: 12.5px;
  padding: 4px 8px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: #ffffff;
}

.link-input.mono {
  font-family: var(--font-mono);
}

.section-footer-bar {
  padding: 8px 12px;
  border-top: 1px dashed var(--card-border);
  display: flex;
  justify-content: flex-start;
}

/* IMPORT TAB */
.import-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.import-intro p {
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
}

.import-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.textarea-container {
  position: relative;
  flex: 1;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.code-textarea {
  width: 100%;
  flex: 1;
  min-height: 180px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-input);
  background: #ffffff;
  color: var(--heading);
  resize: vertical;
}

.code-textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: var(--focus-ring);
}

.textarea-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 2px dashed var(--brand-blue);
  border-radius: var(--radius-input);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-blue);
  pointer-events: none;
}

.textarea-container.dragover .textarea-drop-overlay {
  display: flex;
}

.import-file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-drop-tip {
  font-size: 12px;
  color: var(--muted);
}

.import-actions-row {
  display: flex;
  gap: 10px;
}

/* Staging Area */
.import-staging {
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staging-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.staging-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--heading);
}

.staging-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-input-sm {
  padding: 4px 8px;
  font-size: 12px;
  width: 180px;
}

.staging-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.staging-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12.5px;
}
.staging-item:hover {
  background: var(--card-surface-low);
}

.staging-apply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.inline-toggle {
  margin: 0;
}

/* Alerts */
.alert-box {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

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

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

/* RIGHT PANE: Output Viewers */
.code-editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.output-textarea {
  flex: 1;
  width: 100%;
  border: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--heading);
  background: #ffffff;
  resize: none;
  white-space: pre;
  tab-size: 2;
}

.output-textarea:focus {
  outline: none;
}

.char-line-counter {
  padding: 6px 14px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card-surface-low);
  border-top: 1px solid var(--card-border);
  font-family: var(--font-mono);
}

.placement-card {
  padding: 12px 16px;
  background: var(--card-surface-low);
  border-top: 1px solid var(--card-border);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.placement-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--heading);
}

.robots-snippet-box {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--heading);
}

.robots-snippet-title {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
  font-family: var(--font-body);
  font-weight: 600;
}

/* llms-full helper view */
.full-helper-banner {
  padding: 10px 16px;
  background: var(--badge-bg);
  border-bottom: 1px solid var(--badge-border);
  font-size: 12.5px;
  color: var(--badge-text);
}

/* Validation View */
.validation-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.validation-headline {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}

.status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

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

.status-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

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

.validation-subtext {
  font-size: 12.5px;
  color: var(--muted);
}

.validation-issues-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issue-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

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

.issue-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

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

/* Focus Mode Overlay */
.workspace-wrapper.focus-mode {
  position: fixed;
  inset: 0;
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #ffffff;
  padding: 12px;
}

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

.modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 560px;
  border-radius: 14px;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--card-surface-low);
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.shortcuts-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--card-border);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--card-surface-high);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Mobile Sticky Bar (<900px) */
.mobile-action-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--card-border);
  padding: 10px 16px;
  z-index: 90;
  gap: 10px;
}

.mobile-action-bar .btn {
  flex: 1;
  height: 44px;
}

/* SEO Content Section (Rich Below the fold) */
.seo-content-container {
  max-width: 1100px;
  margin: 40px auto 20px auto;
  padding: 0 24px;
}

.seo-card {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.content-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-block h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.content-block p {
  font-size: 14.5px;
  color: var(--body);
  line-height: 1.65;
}

.step-guide {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--body);
}

.step-guide li {
  line-height: 1.6;
}

.code-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.code-box {
  background: var(--card-surface-low);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.code-box-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--heading);
  background: var(--card-surface-high);
  border-bottom: 1px solid var(--card-border);
}

.code-box pre {
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--heading);
}

.bullet-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--body);
}

/* FAQ Details Accordions */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-question {
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.faq-question::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 18px 16px 18px;
  font-size: 14px;
  color: var(--body);
  line-height: 1.6;
}

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

.tool-card-mini {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.tool-mini-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--heading);
}

.tool-mini-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.85);
  margin-top: 40px;
  padding: 40px 24px 30px 24px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--brand-blue);
}

.tests-link {
  color: var(--brand-violet) !important;
  font-weight: 600;
}

.footer-bottom {
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .workspace-wrapper {
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding-bottom: 70px;
  }

  .pane {
    width: 100% !important;
    min-height: 60dvh;
    margin-bottom: 16px;
  }

  .pane-divider {
    display: none;
  }

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

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

  .link-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .link-drag-handle {
    display: none;
  }
}

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

  .mobile-menu-btn {
    display: block;
  }

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

  .toolbar-container {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-group {
    justify-content: space-between;
  }
}

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


/* 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); }
}

/* Ensure foreground content stacks above blobs */
header, main, footer, .container, .site-header, .site-footer, .workspace, article {
  position: relative;
  z-index: 1;
}
