/* ==========================================================================
   MAFLABS DESIGN SYSTEM - INVISIBLE CHARACTER REMOVER & TEXT CLEANER
   Light theme only. Pure CSS without external dependencies.
   ========================================================================== */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: local('Outfit'), local('Outfit Bold'), url('fonts/outfit.woff2') format('woff2');
}

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

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

:root {
  /* Brand & Core Palette */
  --heading: #0f172a;
  --body: #475569;
  --muted: #64748b;
  --brand-blue: #2563eb;
  --brand-violet: #7c3aed;
  --brand-gradient: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  --brand-gradient-hover: linear-gradient(90deg, #1d4ed8 0%, #6d28d9 100%);

  /* Surfaces & Glassmorphism */
  --bg-page: #faf8ff;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-solid: #ffffff;
  --card-border: #e2e8f0;
  --card-border-subtle: #f1f5f9;
  --card-border-hover: #cbd5e1;
  --surface-low: #f8fafc;
  --surface-container: #f1f5f9;
  --surface-container-high: #e2e8f0;

  /* Badges & Accents */
  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
  --badge-text: #1d4ed8;

  /* Status Tokens */
  --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;

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

  /* Elevation & Geometry */
  --radius-sm: 6px;
  --radius-btn: 10px;
  --radius-card: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 32px rgba(15, 23, 42, 0.08);
  --shadow-btn: 0 6px 16px rgba(79, 70, 229, 0.28);
  --shadow-btn-hover: 0 8px 22px rgba(79, 70, 229, 0.36);
  --focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.15);

  --header-height: 68px;
}

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

html {
  font-family: var(--font-body);
  color: var(--body);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

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

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

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

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

/* ==========================================================================
   HEADER COMPONENT
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
}

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

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
}

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

.logo-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.brand-tagline {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  border-left: 1px solid var(--card-border);
  padding-left: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.06);
}

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

/* Mobile Hamburger Toggle */
.hamburger-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--heading);
  background: transparent;
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ==========================================================================
   PAGE CONTAINER & COMPACT HERO (<140px on Desktop)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 48px;
  display: flex;
  flex-direction: column;
}

.compact-hero {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.category-badge svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.privacy-notice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.privacy-notice svg {
  width: 15px;
  height: 15px;
  fill: #16a34a;
}

.hero-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.hero-h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

/* ==========================================================================
   BUTTONS & CONTROLS DESIGN SYSTEM
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  min-height: 38px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
  filter: brightness(1.04);
}

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

.btn-secondary {
  background: #ffffff;
  color: var(--heading);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

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

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-btn);
  color: var(--body);
  background: #ffffff;
  border: 1px solid var(--card-border);
}

.btn-icon:hover:not(:disabled) {
  color: var(--heading);
  border-color: var(--card-border-hover);
  background: #f8fafc;
}

.btn-ghost {
  background: transparent;
  color: var(--body);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-container);
  color: var(--heading);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ==========================================================================
   SPLIT-SCREEN WORKSPACE (REQUIRED SPECS)
   ========================================================================== */
.workspace-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: calc(100dvh - 190px);
  min-height: 560px;
  position: relative;
  transition: all 0.2s ease;
}

/* Focus Mode Overlay (Key: F / Button) */
.workspace-wrapper.focus-mode {
  position: fixed;
  inset: 0;
  z-index: 9999;
  height: 100vh !important;
  min-height: 100vh !important;
  border-radius: 0;
  margin: 0;
  max-width: none;
  background: #ffffff;
}

/* Toolbar Above Workspace */
.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid var(--card-border);
}

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

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--card-border);
  margin: 0 4px;
}

/* Switch / Toggle Controls in Toolbar */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  color: var(--heading);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.switch-label:hover {
  border-color: var(--card-border-hover);
  background: #f8fafc;
}

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

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

/* Individual Editor Pane (Card Layout) */
.editor-pane {
  flex: 1 1 50%;
  min-width: 25%;
  max-width: 75%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.editor-pane.left-pane {
  border-right: none;
}

.pane-header {
  height: 44px;
  padding: 0 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pane-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane-title svg {
  width: 16px;
  height: 16px;
  fill: var(--brand-blue);
}

.pane-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-pane-action {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  min-height: 28px;
}

.btn-pane-action svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

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

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

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

.divider-knob {
  width: 3px;
  height: 28px;
  border-radius: var(--radius-full);
  background: #94a3b8;
}

/* Pane Body & Textareas (15-16px Monospace, Line-Height 1.6) */
.pane-body {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.editor-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: var(--heading);
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  z-index: 2;
}

.editor-textarea::placeholder {
  color: #94a3b8;
  font-style: italic;
  font-size: 14px;
}

/* Mirrored Overlay Layer for Highlighting Hidden Characters */
.marker-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: transparent;
  background: transparent;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* Character Marker Chips */
.marker-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  vertical-align: baseline;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  cursor: help;
  position: relative;
}

.marker-chip-zwsp {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.marker-chip-bidi {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f0abfc;
}

.marker-chip-tag {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.marker-chip-space {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.marker-chip-control {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Drag & Drop Overlay Mask */
.dropzone-mask {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(37, 99, 235, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
}

.dropzone-mask.active {
  display: flex;
}

.dropzone-card {
  background: #ffffff;
  color: var(--heading);
  padding: 24px 32px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: pulseDrop 1.5s infinite;
}

@keyframes pulseDrop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Clean Output Pane */
.cleaned-textarea {
  background: #fdfefe;
}

/* Workspace Status Bar */
.workspace-footer {
  height: 38px;
  padding: 0 16px;
  background: #f8fafc;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  background: #94a3b8;
}

.status-dot.active {
  background: var(--brand-blue);
  animation: pulseDot 2s infinite;
}

.status-dot.success {
  background: #16a34a;
}

.status-dot.warning {
  background: #b45309;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Progress Bar for Heavy Web Worker Processing */
.progress-bar-container {
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  display: none;
}

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

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

/* ==========================================================================
   SECURITY WARNING ALERTS (TAG CHARS & BIDI SPOOFING)
   ========================================================================== */
.security-alert-box {
  width: 100%;
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-card);
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}

.security-alert-box.active {
  display: flex;
}

.security-alert-tag {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #7f1d1d;
}

.security-alert-bidi {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #581c87;
}

.alert-content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.alert-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.security-alert-tag .alert-icon { fill: #dc2626; }
.security-alert-bidi .alert-icon { fill: #9333ea; }

.alert-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.alert-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.security-alert-tag .alert-badge {
  background: #dc2626;
  color: #ffffff;
}

.security-alert-bidi .alert-badge {
  background: #9333ea;
  color: #ffffff;
}

.alert-desc {
  font-size: 13px;
  color: var(--body);
  margin-top: 4px;
}

.decoded-payload-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--heading);
  word-break: break-all;
}

/* ==========================================================================
   COLLAPSIBLE FINDINGS TABLE
   ========================================================================== */
.findings-section {
  width: 100%;
  margin-top: 20px;
  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-sm);
  overflow: hidden;
}

.findings-header {
  padding: 14px 20px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.findings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.findings-header-desc {
  font-size: 13px;
  color: var(--muted);
}

.findings-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.findings-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.table-collapse-icon {
  width: 20px;
  height: 20px;
  fill: var(--muted);
  transition: transform 0.2s ease;
}

.findings-section.collapsed .table-collapse-icon {
  transform: rotate(-90deg);
}

.findings-content {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
  transition: max-height 0.3s ease;
}

.findings-section.collapsed .findings-content {
  display: none;
}

.findings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.findings-table th {
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
}

.findings-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--body);
  border-bottom: 1px solid var(--card-border-subtle);
  vertical-align: middle;
}

.findings-table tr:hover td {
  background: rgba(248, 250, 252, 0.7);
}

.empty-findings-cell {
  text-align: center;
  padding: 32px 16px !important;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   MODAL DIALOGS (OPTIONS & KEYBOARD SHORTCUTS)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

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

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.options-category-card {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.options-category-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.option-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.option-checkbox-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}

.option-text-label {
  font-size: 13px;
  color: var(--heading);
  font-weight: 500;
}

.option-subtext {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* Shortcuts Cheat Sheet Modal */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border-subtle);
  font-size: 13px;
}

.shortcut-kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  background: var(--heading);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  animation: toastSlideUp 0.25s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.toast-success {
  background: #16a34a;
}

.toast.toast-error {
  background: #dc2626;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SEO CONTENT SECTION BELOW THE TOOL (700 - 1000 WORDS)
   ========================================================================== */
.seo-section {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.seo-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);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.seo-heading {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--heading);
}

.seo-lead {
  font-size: 15px;
  color: var(--body);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* 5 Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.step-number {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: rgba(37, 99, 235, 0.25);
  margin-bottom: 6px;
  line-height: 1;
}

.step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13px;
  color: var(--body);
  line-height: 1.6;
}

/* Before / After Code Blocks */
.code-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.compare-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.compare-badge-corrupt {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.compare-badge-clean {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.code-box {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--heading);
  white-space: pre-wrap;
  word-break: break-all;
}

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

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

details.faq-item[open] {
  border-color: var(--brand-blue);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
}

summary.faq-question {
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

details.faq-item[open] summary.faq-question::after {
  content: '−';
  color: var(--brand-blue);
}

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

/* Three Columns: Why It Matters */
.info-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.info-column-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.info-icon-blue { background: #eff6ff; color: #2563eb; }
.info-icon-purple { background: #faf5ff; color: #7c3aed; }
.info-icon-teal { background: #f0fdf4; color: #16a34a; }

.info-icon-wrapper svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Related Tools Navigation */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.related-tool-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.related-tool-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.related-tool-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
}

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

/* ==========================================================================
   FOOTER COMPONENT
   ========================================================================== */
.site-footer {
  width: 100%;
  background: rgba(248, 250, 252, 0.95);
  border-top: 1px solid var(--card-border);
  margin-top: auto;
  padding: 40px 24px 32px;
}

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

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

.footer-privacy-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--heading);
  font-weight: 600;
}

.footer-privacy-badge svg {
  width: 18px;
  height: 18px;
  fill: #16a34a;
}

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

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

.more-tools-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.more-tools-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.more-tool-link {
  font-size: 13px;
  color: var(--body);
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   STICKY BOTTOM BAR (MOBILE UNDER 900PX)
   ========================================================================== */
.sticky-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 10px 16px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE < 900PX & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .site-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 16px;
    box-shadow: var(--shadow-lg);
  }

  .hamburger-btn {
    display: flex;
  }

  .brand-tagline {
    display: none;
  }

  .hero-h1 {
    font-size: 24px;
  }

  .hero-subtitle {
    display: none;
  }

  /* Panes stack vertically, each min-height 60dvh */
  .split-panes-container {
    flex-direction: column;
    overflow-y: auto;
  }

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

  .split-divider {
    display: none;
  }

  .workspace-wrapper {
    height: auto;
    min-height: auto;
  }

  .sticky-mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
  }

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

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

  /* Extra bottom padding to avoid sticky bar collision */
  .main-wrapper {
    padding-bottom: 80px;
  }
}

/* Small mobile devices down to 320px */
@media (max-width: 480px) {
  .main-wrapper {
    padding: 12px 14px 80px;
  }

  .hero-h1 {
    font-size: 20px;
  }

  .toolbar-left, .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .pane-stats {
    display: none;
  }
}

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