/* ==========================================================================
   REDSITE Brand & Product Design System — Regex Tester
   Tokens, Typography, Components & Responsive Layout
   ========================================================================== */

: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 */
  --green: #10b981;        /* Success / Active Live Dot */
  --green-soft: #ecfdf5;   /* Success Banner Background */
  --green-border: #a7f3d0; /* Success Border */

  /* Match Highlighting Palette */
  --match-1: #b0e0e6;      /* Powder Blue */
  --match-2: #fed7aa;      /* Soft Amber */
  --match-3: #bbf7d0;      /* Soft Emerald */
  --match-4: #e9d5ff;      /* Soft Lavender */
  --match-5: #fbcfe8;      /* Soft Rose */
  --match-highlight: #fef08a; /* Yellow Accent */

  /* Typography Families */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 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 dimensions */
  --max-width: 1240px;
  --topbar-height: 72px;
}

/* ==========================================================================
   CSS Reset & Base Rules
   ========================================================================== */

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

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--paper);
}

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

button, input, textarea, select {
  font-family: inherit;
  font-size: 100%;
  border: none;
  background: none;
  outline: none;
}

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

/* Red Italics standard from DESIGN.md */
h1 em, h2 em, h3 em {
  font-style: normal;
  color: var(--red);
}

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

/* ==========================================================================
   4.1 Topbar Navigation
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

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

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

.product-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
}

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

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

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

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

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

.topbar-nav a:not(.back-link) {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}

.topbar-nav a:not(.back-link):hover {
  color: var(--ink);
}

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

.back-link:hover {
  border-color: var(--ink);
  background: var(--paper-warm);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
}

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

/* ==========================================================================
   4.2 Hero Section & Eyebrow
   ========================================================================== */

.hero {
  padding: 56px 0 36px 0;
  text-align: center;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

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

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--ink);
  max-width: 860px;
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
  max-width: 720px;
  line-height: 1.55;
  margin-bottom: 28px;
}

.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}

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

.trust-row b {
  color: var(--red);
  font-weight: 700;
}

/* ==========================================================================
   4.3 Buttons & Interactive Controls
   ========================================================================== */

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

.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);
}

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

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

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

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

.pill-btn {
  height: 30px;
  padding: 0 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

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

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

/* ==========================================================================
   4.4 The Workbench / Tool Container
   ========================================================================== */

.workbench-section {
  padding: 24px 0 80px 0;
}

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

/* Master Workbench Header / Mode Tabs */
.workbench-header {
  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;
}

.mode-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.mode-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.workbench-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Regex Pattern Bar */
.pattern-wrapper {
  padding: 18px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pattern-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pattern-box {
  display: flex;
  align-items: center;
  background: var(--paper-panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 4px 10px 4px 14px;
  transition: all 0.15s ease;
  position: relative;
}

.pattern-box:focus-within {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

.pattern-slash {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--muted-light);
  user-select: none;
}

.pattern-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 10px;
  width: 100%;
}

.pattern-input::placeholder {
  color: var(--muted-light);
  font-weight: 400;
}

.pattern-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pattern-clear-btn {
  color: var(--muted-light);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: none;
}

.pattern-clear-btn:hover {
  color: var(--ink);
}

/* Flags Popover & Badges */
.flags-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.flags-btn:hover {
  border-color: var(--ink-soft);
  background: var(--paper-warm);
}

.flags-btn span.flags-text {
  color: var(--red);
  font-weight: 700;
}

.flags-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  padding: 12px;
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.flags-dropdown.open {
  display: flex;
  animation: dropdown-fade 0.15s ease;
}

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

.flag-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.flag-option:hover {
  background: var(--paper-warm);
}

.flag-option-info {
  display: flex;
  flex-direction: column;
}

.flag-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flag-option-char {
  font-family: var(--font-mono);
  background: var(--paper-panel);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
}

.flag-option-desc {
  font-size: 11px;
  color: var(--muted);
}

.flag-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}

/* Live Status Bar */
.status-bar {
  padding: 10px 20px;
  font-size: 13px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  transition: all 0.2s ease;
}

.status-bar.idle {
  background: var(--paper-warm);
  color: var(--muted);
}

.status-bar.valid {
  background: var(--green-soft);
  border-bottom-color: var(--green-border);
  color: #065f46;
}

.status-bar.error {
  background: var(--red-soft);
  border-bottom-color: var(--red-border);
  color: #9f1239;
}

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

.status-icon {
  font-size: 15px;
  line-height: 1;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 12px;
}

/* Main Split Workbench Body */
.workbench-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 480px;
}

/* Left Pane: Test String Editor */
.editor-pane {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.pane-header {
  padding: 10px 16px;
  background: var(--paper-panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.pane-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Dual-Layer Highlight Editor */
.editor-container {
  position: relative;
  flex: 1;
  min-height: 380px;
  background: #ffffff;
  overflow: hidden;
}

.editor-backdrop,
.editor-textarea {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0px;
  tab-size: 2;
  -moz-tab-size: 2;
  font-variant-ligatures: none;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  border: none;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.editor-backdrop {
  color: transparent;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

.editor-backdrop mark {
  color: transparent;
  border-radius: 3px;
  padding: 1px 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.editor-backdrop mark.active-hover {
  box-shadow: 0 0 0 2px var(--red), 0 2px 8px rgba(225, 29, 72, 0.35);
  background-color: #fef08a !important;
}

.editor-backdrop mark.match-m0 { background-color: rgba(176, 224, 230, 0.65); border-bottom: 2px solid #0284c7; }
.editor-backdrop mark.match-m1 { background-color: rgba(254, 215, 170, 0.75); border-bottom: 2px solid #ea580c; }
.editor-backdrop mark.match-m2 { background-color: rgba(187, 247, 208, 0.75); border-bottom: 2px solid #16a34a; }
.editor-backdrop mark.match-m3 { background-color: rgba(233, 213, 255, 0.75); border-bottom: 2px solid #9333ea; }
.editor-backdrop mark.match-m4 { background-color: rgba(251, 207, 232, 0.75); border-bottom: 2px solid #db2777; }

.editor-textarea {
  z-index: 2;
  color: var(--ink);
  background: transparent;
  resize: none;
  outline: none;
  caret-color: var(--red);
  overflow-y: auto;
}

/* Right Pane: Inspector / Replacement / Explainer / Code */
.inspector-pane {
  display: flex;
  flex-direction: column;
  background: var(--paper-warm);
}

.tab-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
}

.tab-view.active {
  display: flex;
}

/* Match Inspector List */
.matches-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.match-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.match-item:hover {
  border-color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.match-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.match-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--paper-panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.match-range {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.match-value-box {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.match-groups-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}

.match-groups-table th,
.match-groups-table td {
  padding: 6px 8px;
  text-align: left;
  border-top: 1px solid var(--line-light);
  font-family: var(--font-mono);
}

.match-groups-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.copy-mini-btn {
  color: var(--muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  border: 1px solid var(--line);
  background: var(--paper);
}

.copy-mini-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Empty Matches State */
.empty-inspector {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-icon {
  font-size: 36px;
  color: var(--muted-light);
}

/* Tab 2: Substitution Panel */
.substitute-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.replace-input-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.replace-input-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.replace-field {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}

.replace-field:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.05);
}

.replace-tokens-hint {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.replace-tokens-hint code {
  background: var(--paper-panel);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--red);
  cursor: pointer;
}

.replace-result-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.replace-result-preview {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

/* Tab 3: Plain English Explainer */
.explainer-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explainer-token-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.explainer-token-card.special {
  border-left-color: var(--blue-accent);
}

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

.explainer-token-char {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

.explainer-token-type {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.explainer-token-desc {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}

/* Tab 4: Code Generator */
.codegen-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lang-selector-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.code-output-container {
  position: relative;
  background: #0d0e12;
  border: 1px solid #272b35;
  border-radius: 10px;
  overflow: hidden;
}

.code-output-header {
  padding: 8px 12px;
  background: #161820;
  border-bottom: 1px solid #272b35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}

.code-output-body {
  padding: 14px 16px;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ==========================================================================
   Preset Modal / Dialog
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.preset-modal {
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.15s ease;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close-btn {
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--ink);
}

.preset-search-box {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-light);
  background: var(--paper-warm);
}

.preset-search-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.presets-grid {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow-y: auto;
}

.preset-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.preset-card:hover {
  border-color: var(--red);
  background: var(--red-soft);
  transform: translateY(-1px);
}

.preset-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.preset-card-pattern {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Cheat Sheet Section
   ========================================================================== */

.cheatsheet-section {
  padding: 60px 0;
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 10px;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.cheat-categories {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

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

.cheat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}

.cheat-card:hover {
  border-color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.cheat-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cheat-token {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  padding: 2px 8px;
  border-radius: 6px;
}

.cheat-cat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-panel);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
}

.cheat-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.cheat-example {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper-warm);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cheat-insert-btn {
  font-size: 11px;
  color: var(--blue-accent);
  font-weight: 600;
  cursor: pointer;
}

.cheat-insert-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   4.5 The Signature Privacy Band
   ========================================================================== */

.privacy-band {
  background: #0a0a0a;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 44px max(calc((100vw - 1240px) / 2), 24px);
  margin-top: 40px;
  margin-bottom: 80px;
}

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

.privacy-content {
  flex: 1;
}

.privacy-content .eyebrow {
  background: #161820;
  border-color: #272a34;
  color: #b0e0e6;
  margin-bottom: 10px;
}

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

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

.privacy-band p {
  color: #94a3b8;
  font-size: 15px;
  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;
  flex-shrink: 0;
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features-section {
  padding: 40px 0 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

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

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

.feature-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--red);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

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

/* ==========================================================================
   How It Works Section
   ========================================================================== */

.how-to-section {
  padding: 60px 0;
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.step-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
}

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

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

/* ==========================================================================
   4.6 FAQ Accordion (2-Column Desktop Standard)
   ========================================================================== */

.faq-section {
  padding: 80px 0;
}

.faq-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
}

.faq-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.faq-sidebar h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 14px;
}

.faq-sidebar p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

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

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

.faq-item:hover {
  border-color: var(--ink-soft);
}

.faq-item summary {
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

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

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

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

.faq-content {
  padding: 0 20px 20px 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  border-top: 1px solid var(--line-light);
  padding-top: 14px;
}

.faq-content code {
  background: var(--paper-panel);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  padding: 60px 0 36px 0;
  margin-top: auto;
}

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

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

.footer-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.6;
}

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

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

.footer-col a {
  font-size: 14px;
  color: var(--muted);
}

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

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   5. Responsiveness Standard
   ========================================================================== */

/* Tablet (768px – 959px) */
@media (max-width: 959px) {
  .workbench-body {
    grid-template-columns: 1fr;
  }
  .editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .faq-sidebar {
    position: static;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  .privacy-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 36px 24px;
  }
}

/* Mobile (<768px) */
@media (max-width: 767px) {
  :root {
    --topbar-height: 64px;
  }
  .topbar-nav {
    display: none;
    position: absolute;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-md);
  }
  .topbar-nav.mobile-open {
    display: flex;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero {
    padding: 36px 0 24px 0;
  }
  .trust-row {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .workbench-header {
    flex-direction: column;
    align-items: stretch;
  }
  .mode-tabs {
    overflow-x: auto;
    width: 100%;
  }
  .mode-tab {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
  }
  .pattern-box {
    padding: 4px 8px;
  }
  .pattern-slash {
    font-size: 17px;
  }
  .pattern-input {
    font-size: 14px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .presets-grid {
    grid-template-columns: 1fr;
  }
}

