/* ==========================================================================
   REDSITE Brand & Product Design System (DESIGN.md)
   Product: XML Formatter & Validator by REDSITE (xml.redsite.in)
   ========================================================================== */

:root {
  /* Brand Core Colors */
  --ink: #0a0a0a;          /* Raven Black — Headings, brand accents, dark sections */
  --ink-soft: #24272e;     /* Raven Soft — Card titles, deep borders */
  --red: #e11d48;          /* Poppy Red — Primary brand accent, primary CTA gradient, highlights */
  --red-hover: #be123c;    /* Deep Crimson — Button hover and active state */
  --blue: #b0e0e6;         /* Powder Blue — Privacy badges, dark-band highlights, symbols */
  --blue-accent: #0284c7;  /* Sky Blue — Focus rings, selection indicators, active links */

  /* Neutral Backgrounds & Surfaces */
  --paper: #ffffff;        /* Canvas Paper — Main page and card background */
  --paper-warm: #fafbfc;   /* Warm Surface — Toolbar, steps, footer backgrounds */
  --paper-panel: #f8fafc;  /* Panel Gray — Pane headers, eyebrow backgrounds */

  /* Borders & Dividers */
  --line: #e2e8f0;         /* Standard Border — Crisp 1px structure */
  --line-light: #f1f5f9;   /* Subtle Divider — Internal card borders */

  /* Typography Colors */
  --muted: #5e636e;        /* Secondary Text — Descriptions, metadata, secondary links */
  --muted-light: #8e939e;  /* Hints / Watermarks — Placeholders, shortcut hints */

  /* Semantic Feedback Tints */
  --red-soft: #fff1f2;     /* Error Banner Background */
  --red-border: #fecdd3;   /* Error Border */
  --red-text: #9f1239;     /* Error Text */
  --green: #10b981;        /* Success / Active Live Dot */
  --green-soft: #ecfdf5;   /* Success Banner Background */
  --green-border: #a7f3d0; /* Success Border */
  --green-text: #065f46;   /* Success Text */
  --amber: #f59e0b;        /* Warning color */
  --amber-soft: #fffbeb;   /* Warning background */
  --amber-border: #fde68a; /* Warning border */
  --amber-text: #92400e;   /* Warning text */

  /* Typography Families */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 50px -12px rgba(10, 10, 10, 0.08);

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --max-width: 1240px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 em, h2 em, h3 em {
  font-style: normal;
  color: var(--red);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ==========================================================================
   4.1 Topbar Navigation
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.product-logo {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-byline {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-sans);
}

.brand-byline b {
  color: var(--red);
  font-weight: 700;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.topbar-nav a:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

.topbar-nav .back-link {
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.topbar-nav .back-link:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

/* ==========================================================================
   4.2 Hero Section & Eyebrow
   ========================================================================== */
.hero {
  padding: 48px 0 24px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--paper-panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 20px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 32px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-row b {
  font-family: var(--font-mono);
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
}

/* ==========================================================================
   4.3 & 4.4 The Workbench / Tool Container
   ========================================================================== */
.workbench-section {
  padding-bottom: 64px;
}

.workbench-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Workbench Master Toolbar */
.workbench-toolbar {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

/* Action Buttons */
.primary-btn {
  height: 38px;
  padding: 0 18px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a080c 45%, #e11d48 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.primary-btn:active {
  transform: translateY(0);
}

.btn-secondary {
  height: 38px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--paper-warm);
  border-color: #cbd5e1;
}

.btn-accent {
  height: 38px;
  padding: 0 14px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-accent:hover {
  background: #ffe4e6;
}

.btn-pill {
  height: 34px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-pill:hover {
  color: var(--ink);
  border-color: #cbd5e1;
  background: var(--paper-warm);
}

.btn-pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.btn-ghost {
  height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--paper-panel);
}

.toolbar-select-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.toolbar-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.toolbar-select:focus {
  border-color: var(--blue-accent);
}

/* XPath Bar (Collapsible) */
.xpath-bar {
  display: none;
  background: var(--paper-panel);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}

.xpath-bar.visible {
  display: flex;
}

.xpath-bar label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.xpath-input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  outline: none;
}

.xpath-input:focus {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.xpath-results-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

/* Status & Diagnostic Banner */
.status-banner {
  padding: 10px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--muted);
  transition: all 0.2s ease;
}

.status-banner.valid {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green-text);
}

.status-banner.error {
  background: var(--red-soft);
  border-color: var(--red-border);
  color: var(--red-text);
}

.status-banner.warning {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber-text);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.status-message {
  font-family: var(--font-sans);
}

.status-message code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-fix-sm {
  height: 26px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-fix-sm:hover {
  background: #ffe4e6;
}

.btn-jump-sm {
  height: 26px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid var(--red-border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-jump-sm:hover {
  background: var(--paper-warm);
}

/* Workbench Grid & Dual Panes */
.workbench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
  position: relative;
  background: var(--paper);
}

.workbench-grid.stacked {
  grid-template-columns: 1fr;
}

.workbench-grid.output-only .editor-pane.input-pane {
  display: none;
}

.workbench-grid.output-only {
  grid-template-columns: 1fr;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--paper);
  min-height: 480px;
}

.editor-pane:first-child {
  border-right: 1px solid var(--line);
}

.workbench-grid.stacked .editor-pane:first-child {
  border-right: none;
  border-bottom: 1px solid var(--line);
}

/* Pane Header */
.pane-header {
  background: var(--paper-panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  user-select: none;
}

.pane-title {
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pane-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}

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

/* Editor Body with Line Numbers */
.editor-body {
  position: relative;
  flex: 1;
  display: flex;
  background: var(--paper);
  overflow: hidden;
}

/* Interactive DOM Tree View */
.tree-container {
  display: none;
  flex: 1;
  min-height: 440px;
  max-height: 650px;
  overflow: auto;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
  user-select: text;
}

.tree-container.active {
  display: block;
}

.tree-empty-state {
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
  padding: 60px 20px;
}

.tree-node {
  margin: 3px 0;
  position: relative;
  word-break: break-all;
}

.tree-branch {
  margin-left: 22px;
  border-left: 1px dashed var(--line);
  padding-left: 10px;
}

.tree-branch.collapsed {
  display: none;
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 10px;
  margin-right: 4px;
  transition: transform 0.15s ease;
}

.tree-toggle:hover {
  color: var(--red);
}

.tree-toggle.collapsed {
  transform: rotate(-90deg);
}

.tree-tag {
  color: var(--red);
  font-weight: 600;
}

.tree-bracket {
  color: var(--muted-light);
}

.tree-attr-name {
  color: var(--blue-accent);
  margin-left: 6px;
}

.tree-attr-val {
  color: #059669;
}

.tree-text {
  color: var(--ink);
  font-weight: 500;
  margin: 0 4px;
}

.tree-comment {
  color: var(--muted-light);
  font-style: italic;
}

.tree-cdata {
  color: #7c3aed;
}

/* View Switcher Tabs */
.view-mode-tabs {
  display: inline-flex;
  background: var(--paper-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.view-tab-btn {
  padding: 3px 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-tab-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.line-numbers {
  width: 48px;
  padding: 16px 8px 16px 12px;
  background: var(--paper-panel);
  border-right: 1px solid var(--line-light);
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}

.line-numbers .err-line-marker {
  color: var(--red);
  font-weight: 700;
  background: var(--red-soft);
  display: block;
  border-radius: 2px;
}

.code-textarea {
  flex: 1;
  height: 100%;
  min-height: 440px;
  padding: 16px 18px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
  word-break: normal;
}

.code-textarea::placeholder {
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 13px;
}

.code-textarea:focus {
  background: #ffffff;
}

/* Drag & Drop Overlay */
.drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 2px dashed var(--red);
  border-radius: 8px;
  z-index: 20;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink);
  pointer-events: none;
}

.editor-pane.dragover .drop-overlay {
  display: flex;
}

/* Master Status Bar / Footer of Workbench */
.workbench-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.stats-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stat-item b {
  color: var(--ink);
  font-weight: 600;
}

/* Quick Tools Bar below Workbench */
.quick-tools-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 4px;
}

.quick-tools-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.quick-tools-left b {
  color: var(--ink);
}

.sample-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sample-chip {
  padding: 4px 10px;
  background: var(--paper-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-chip:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

/* ==========================================================================
   4.5 The Signature Privacy Band
   ========================================================================== */
.privacy-band {
  background: #0a0a0a;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 48px max(calc((100vw - 1240px) / 2), 24px);
  margin: 64px 0 80px;
  border-top: 1px solid #1a1c22;
  border-bottom: 1px solid #1a1c22;
}

.privacy-symbol {
  font-size: 44px;
  color: #b0e0e6;
  line-height: 1;
  flex-shrink: 0;
}

.privacy-content {
  flex: 1;
}

.privacy-content .eyebrow {
  background: #161922;
  border-color: #262c3b;
  color: #b0e0e6;
  margin-bottom: 10px;
}

.privacy-band h2 {
  color: #ffffff;
  font-size: clamp(22px, 2.5vw, 28px);
  margin-bottom: 8px;
}

.privacy-band h2 em {
  color: #b0e0e6;
  font-style: normal;
}

.privacy-band p {
  color: #94a3b8;
  font-size: 14px;
  max-width: 720px;
  line-height: 1.6;
}

.privacy-tag {
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #b0e0e6;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Features Section (3-Column Grid)
   ========================================================================== */
.features-section {
  padding-bottom: 80px;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}

.section-header h2 {
  font-size: clamp(28px, 3.2vw, 36px);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--muted);
  font-size: 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--paper-panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  margin-bottom: 18px;
  font-size: 20px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ==========================================================================
   How It Works & Educational Guide Sections (SEO Anchor)
   ========================================================================== */
.guide-section {
  padding-bottom: 80px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.step-card {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: relative;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Content Explainer / Deep Dive Table & Columns */
.info-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 32px;
}

.info-card h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.info-card p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.comparison-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.comparison-table th {
  background: var(--paper-panel);
  padding: 12px 18px;
  font-weight: 700;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

.comparison-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-light);
  color: var(--muted);
}

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

.comparison-table td b {
  color: var(--ink);
}

/* ==========================================================================
   4.6 FAQ Accordion (2-Column Desktop Layout)
   ========================================================================== */
.faq-section {
  padding-bottom: 96px;
}

.faq-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 48px;
  align-items: start;
}

.faq-header-sticky {
  position: sticky;
  top: 100px;
}

.faq-header-sticky h2 {
  font-size: clamp(26px, 3vw, 34px);
  margin-bottom: 12px;
}

.faq-header-sticky p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.15s ease;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-item[open] {
  border-color: var(--ink-soft);
}

.faq-question {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

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

.faq-icon {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.faq-answer p {
  margin-bottom: 10px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--paper-panel);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  color: var(--muted);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

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

.footer-brand .brand {
  margin-bottom: 4px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.footer-copyright {
  color: var(--muted);
}

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

.footer-links-inline a:hover {
  color: var(--red);
}

/* ==========================================================================
   Toast Notification & Modals
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0a0a0a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

.toast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ==========================================================================
   5. Responsiveness Standard
   ========================================================================== */
@media (max-width: 959px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .editor-pane:first-child {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .faq-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .faq-header-sticky {
    position: static;
  }

  .privacy-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 36px 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .topbar {
    height: 64px;
  }

  .topbar-nav a:not(.back-link) {
    display: none;
  }

  .hero {
    padding: 32px 0 20px;
  }

  .trust-row {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

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

  .toolbar-group {
    justify-content: stretch;
  }

  .toolbar-group .primary-btn,
  .toolbar-group .btn-secondary,
  .toolbar-group .btn-accent {
    flex: 1;
    justify-content: center;
  }

  .feature-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .code-textarea {
    font-size: 12px;
    min-height: 320px;
  }

  .line-numbers {
    width: 38px;
    font-size: 12px;
    padding: 16px 4px 16px 6px;
  }
}

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

