/**
 * MafLabs HAR File Sanitizer - Complete Stylesheet
 * 100% Pure Vanilla CSS. No external CDNs. Works offline.
 * Implements the official maflabs.online design tokens & responsive split-workspace.
 */

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

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

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

/* ==========================================================================
   2. Design Tokens & Root Variables
   ========================================================================== */
:root {
  /* Color Palette */
  --heading: #0f172a;
  --body: #475569;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-card: rgba(255, 255, 255, 0.88);

  --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%);

  --badge-bg: #eff6ff;
  --badge-border: #bfdbfe;
  --badge-text: #1d4ed8;

  --card-border: #e2e8f0;
  --card-border-subtle: #f1f5f9;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  /* Status Colors */
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  --chip-bg: #fef3c7;
  --chip-text: #92400e;
  --chip-border: #fcd34d;

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

  /* Layout */
  --header-height: 64px;
  --hero-max-height: 140px;
  --max-content-width: 1320px;
}

/* ==========================================================================
   3. Base Reset & Mesh Glow Background
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand-blue);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* Ambient Background Blobs (Fixed across entire viewport) */
.blob-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  -webkit-filter: blur(80px);
  opacity: 0.85;
  will-change: transform;
}

.blob-1 {
  top: -12vh;
  left: -8vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, rgba(59, 130, 246, 0.16) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-1 20s infinite ease-in-out alternate;
}

.blob-2 {
  top: -10vh;
  right: -10vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.28) 0%, rgba(168, 85, 247, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-2 24s infinite ease-in-out alternate;
}

.blob-3 {
  bottom: -15vh;
  left: -10vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(14, 165, 233, 0.14) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-3 22s infinite ease-in-out alternate;
}

.blob-4 {
  bottom: -10vh;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, rgba(236, 72, 153, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
  animation: blob-float-4 26s infinite ease-in-out alternate;
}

@keyframes blob-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5vw, 6vh) scale(1.06); }
  100% { transform: translate(-3vw, 10vh) scale(0.96); }
}

@keyframes blob-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(1.08); }
  100% { transform: translate(4vw, 5vh) scale(0.94); }
}

@keyframes blob-float-3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -8vh) scale(1.06); }
  100% { transform: translate(-4vw, -4vh) scale(0.95); }
}

@keyframes blob-float-4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(1.08); }
  100% { transform: translate(6vw, -10vh) scale(0.95); }
}

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

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

/* ==========================================================================
   4. Header & Navigation (700px Hamburger)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
}

.header-container {
  max-width: var(--max-content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--heading);
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
}

.brand-logo-text {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-logo-text .navy {
  color: #0f172a;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-alt);
  color: var(--heading);
}

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

.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  color: var(--body);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-drawer.open {
  display: flex;
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
}

/* ==========================================================================
   5. Compact Hero Section (<140px on desktop)
   ========================================================================== */
.hero-section {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.875rem 1.5rem 0.5rem;
  min-height: auto;
}

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

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.privacy-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.privacy-notice svg {
  color: var(--success);
}

.hero-heading {
  font-size: 1.625rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 0.875rem;
  color: var(--body);
  max-width: 900px;
  line-height: 1.45;
}

/* ==========================================================================
   6. Global Progress Indicator
   ========================================================================== */
.progress-bar-container {
  max-width: var(--max-content-width);
  margin: 0 auto 0.5rem;
  padding: 0 1.5rem;
  display: none;
}
.progress-bar-container.active {
  display: block;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

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

.progress-status-text {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   7. Toolbar Above Split Workstation
   ========================================================================== */
.toolbar-section {
  max-width: var(--max-content-width);
  margin: 0 auto 0.5rem;
  padding: 0 1.5rem;
}

.toolbar-card {
  background: var(--surface-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  min-height: 40px;
  user-select: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

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

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

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

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

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--body);
}

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

/* Redaction Counter Chip in Button */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   8. Options Popover / Drawer
   ========================================================================== */
.options-drawer {
  display: none;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.options-drawer.open {
  display: block;
  animation: slideDown 0.18s ease-out;
}

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

.options-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 1rem;
}

.options-drawer-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--heading);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.options-col {
  background: var(--surface-alt);
  border: 1px solid var(--card-border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.options-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--heading);
  cursor: pointer;
  user-select: none;
  min-height: 28px;
}

.toggle-label span {
  flex: 1;
  padding-right: 0.5rem;
}

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

.options-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.options-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.options-select, .options-input {
  width: 100%;
  padding: 0.4rem 0.625rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: #ffffff;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--heading);
}

.options-select:focus, .options-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.options-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.reset-options-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}

.reset-options-btn:hover {
  color: var(--error);
}

/* ==========================================================================
   9. Dual-Pane Split-Screen Workspace (Required Specification)
   ========================================================================== */
.workspace-wrapper {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  /* Workspace height formula from spec: 100dvh - header - hero - toolbar (min 560px) */
  height: calc(100dvh - 200px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.split-panes-container {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  gap: 0;
  position: relative;
  min-height: 0;
}

/* Individual Pane Card */
.pane-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  height: 100%;
}

/* Pane Header Bar */
.pane-header {
  height: 48px;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  padding: 0 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
}

.pane-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pane-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--heading);
}

.pane-stat-chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--body);
}

.pane-stat-chip.highlight {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.pane-stat-chip.redacted {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  border: 1px solid #fde68a;
}

/* Segmented View Switcher (Entries vs Raw JSON) */
.view-tabs {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 8px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  padding: 0.25rem 0.625rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Search and Filter Strip */
.filter-strip {
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.35rem 0.625rem 0.35rem 2rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface-alt);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--heading);
}

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

.method-select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface-alt);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
}

/* Report Strip on Right Pane */
.report-card-strip {
  padding: 0.4rem 0.75rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.report-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.report-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--body);
}

.report-pill strong {
  color: var(--brand-blue);
}

.size-delta-pill {
  font-weight: 600;
  color: var(--body);
}

/* Leak Check Live Banner */
.leak-check-banner {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
}

.leak-check-banner.passed {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.leak-check-banner.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.leak-check-banner.hidden {
  display: none;
}

/* Draggable Vertical Split Divider */
.split-divider {
  width: 10px;
  margin: 0 -1px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  user-select: none;
  background: transparent;
  transition: background 0.15s ease;
}

.split-divider:hover, .split-divider.dragging {
  background: rgba(37, 99, 235, 0.08);
}

.split-handle {
  width: 4px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #cbd5e1;
  transition: background 0.15s ease, height 0.15s ease;
}

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

/* Pane Body Areas (fills all remaining height) */
.pane-body {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Entries Virtualized List Container */
.entries-list-view {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}

.entries-list-view.hidden {
  display: none;
}

/* Individual Entry Item */
.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.45rem 0.625rem;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.entry-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.entry-row.selected {
  background: #eff6ff;
  border-color: var(--brand-blue);
}

.entry-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.entry-method-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.method-GET { background: #eff6ff; color: #1d4ed8; }
.method-POST { background: #faf5ff; color: #7e22ce; }
.method-PUT, .method-PATCH { background: #fffbeb; color: #b45309; }
.method-DELETE { background: #fef2f2; color: #dc2626; }

.entry-status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-2xx { color: #16a34a; }
.status-3xx { color: #2563eb; }
.status-4xx { color: #d97706; }
.status-5xx { color: #dc2626; }

.entry-url-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.entry-row-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Raw JSON Editor View */
.raw-json-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}

.raw-json-view.hidden {
  display: none;
}

.raw-textarea-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  min-height: 0;
}

.raw-textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 0.875rem;
  border: none;
  background: #ffffff;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: var(--heading);
  resize: none;
  outline: none;
  overflow-y: auto;
}

.textarea-footer-bar {
  height: 32px;
  background: #f8fafc;
  border-top: 1px solid var(--card-border-subtle);
  padding: 0 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  flex-shrink: 0;
}

.textarea-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-action-link {
  background: transparent;
  border: none;
  color: var(--brand-blue);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
}

.text-action-link:hover {
  text-decoration: underline;
}

/* Inspector Drawer (Bottom Drawer in Panes) */
.inspector-panel {
  height: 220px;
  background: #ffffff;
  border-top: 2px solid var(--card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.inspector-panel.hidden {
  display: none;
}

.inspector-header {
  height: 36px;
  padding: 0 0.75rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--card-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

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

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.625rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--body);
  background: #ffffff;
}

/* Amber Chip for Redacted Values in Inspector */
.redacted-chip {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85em;
  margin: 0 1px;
}

/* Drag & Drop Global Overlay */
.drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(239, 246, 255, 0.92);
  border: 3px dashed var(--brand-blue);
  border-radius: var(--radius);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.drop-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drop-overlay-box {
  background: #ffffff;
  padding: 2rem 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* ==========================================================================
   10. Focus Mode (Fullscreen fixed overlay)
   ========================================================================== */
body.focus-mode {
  overflow: hidden;
}

body.focus-mode .site-header,
body.focus-mode .hero-section,
body.focus-mode .seo-content-section,
body.focus-mode .test-suite-section,
body.focus-mode .site-footer {
  display: none !important;
}

body.focus-mode .workspace-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  margin: 0;
  padding: 0.75rem;
  z-index: 999;
  background: #ffffff;
  min-height: 100vh;
}

body.focus-mode .toolbar-section {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0;
  z-index: 1000;
}

body.focus-mode .split-panes-container {
  margin-top: 54px;
  height: calc(100vh - 68px);
}

/* ==========================================================================
   11. Sticky Bottom Action Bar (<900px Responsive Layout)
   ========================================================================== */
.mobile-sticky-action-bar {
  display: none;
}

@media (max-width: 900px) {
  .workspace-wrapper {
    height: auto;
    min-height: auto;
  }

  .split-panes-container {
    flex-direction: column;
    height: auto;
    gap: 1rem;
  }

  .pane-card {
    min-height: 60dvh;
    height: auto;
    width: 100% !important;
    flex: none;
  }

  .split-divider {
    display: none;
  }

  /* Mobile Sticky Bottom Action Bar */
  .mobile-sticky-action-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 90;
    align-items: center;
    gap: 0.75rem;
  }

  .mobile-sticky-action-bar .btn {
    flex: 1;
    min-height: 44px; /* WCAG 44px minimum tap target */
  }

  body {
    padding-bottom: 70px;
  }

  .btn {
    min-height: 44px; /* WCAG 44px minimum tap target */
  }

  .pane-header {
    height: auto;
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
  }

  .pane-title-group {
    flex-wrap: wrap;
  }

  .view-tab-btn {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
  }
}

@media (max-width: 640px) {
  .header-container,
  .hero-section,
  .toolbar-section,
  .workspace-wrapper,
  .test-suite-section,
  .seo-content-section,
  .footer-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-heading {
    font-size: 1.35rem;
  }

  .hero-subtitle {
    font-size: 0.8125rem;
  }

  .toolbar-card {
    padding: 0.5rem;
  }

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

  .toolbar-group .btn {
    flex: 1;
    min-width: 120px;
  }

  .toolbar-group .btn-icon {
    flex: 0 0 40px;
    min-width: 40px;
  }

  .report-card-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .filter-strip {
    flex-wrap: wrap;
  }

  .method-select {
    width: 100%;
    min-height: 40px;
  }

  .search-input {
    min-height: 40px;
  }
}

@media (max-width: 380px) {
  .btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.6rem;
  }

  .hero-heading {
    font-size: 1.2rem;
  }

  .brand-logo-text {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   12. Keyboard Shortcuts Dialog & Modals
   ========================================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--card-border-subtle);
  font-size: 0.875rem;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: var(--heading);
}

/* Accessible Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--heading);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastFade 0.2s ease-out;
  pointer-events: auto;
}

.toast.success {
  background: #15803d;
}

.toast.error {
  background: #b91c1c;
}

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

/* ==========================================================================
   13. In-Browser Test Suite Grid Section
   ========================================================================== */
.test-suite-section {
  max-width: var(--max-content-width);
  margin: 3rem auto 1rem;
  padding: 0 1.5rem;
}

.test-suite-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.test-suite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.875rem;
}

.test-case-box {
  background: var(--surface-alt);
  border: 1px solid var(--card-border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.test-case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.test-case-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--heading);
}

.test-case-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: var(--muted);
}

.test-case-badge.running {
  background: #fef3c7;
  color: #92400e;
}

.test-case-badge.passed {
  background: #dcfce7;
  color: #15803d;
}

.test-case-badge.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.test-case-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ==========================================================================
   14. SEO Content Section Below the Tool (700-1000 words)
   ========================================================================== */
.seo-content-section {
  max-width: var(--max-content-width);
  margin: 3.5rem auto 1rem;
  padding: 0 1.5rem;
}

.seo-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 2.5rem;
}

@media (max-width: 960px) {
  .seo-layout {
    grid-template-columns: 1fr;
  }
}

.seo-article {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.seo-article h2 {
  font-size: 1.875rem;
  line-height: 1.25;
}

.seo-article h3 {
  font-size: 1.375rem;
  margin-top: 1rem;
}

.seo-article p {
  color: var(--body);
  line-height: 1.7;
}

.seo-steps-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.seo-steps-list li {
  line-height: 1.6;
}

/* Before / After Comparison Blocks */
.comparison-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 1rem 0;
}

.comparison-header {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--heading);
  border-bottom: 1px solid var(--card-border);
}

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

@media (max-width: 640px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.comparison-col {
  padding: 1rem;
  overflow-x: auto;
}

.comparison-col.vulnerable {
  background: #fffafa;
  border-right: 1px solid var(--card-border-subtle);
}

.comparison-col.sanitized {
  background: #f8fdf9;
}

.comparison-badge {
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.comparison-badge.vuln {
  color: #dc2626;
}

.comparison-badge.safe {
  color: #16a34a;
}

.comparison-col pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--heading);
}

/* FAQ Accordions */
.faq-accordions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

details.faq-item {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.125rem;
  transition: border-color 0.15s ease;
}

details.faq-item[open] {
  border-color: #cbd5e1;
}

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

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

.faq-chevron {
  transition: transform 0.2s ease;
}

details[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border-subtle);
  font-size: 0.875rem;
  color: var(--body);
  line-height: 1.65;
}

/* Sidebar Aside Cards */
.seo-aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.aside-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.aside-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.matrix-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.8125rem;
}

.matrix-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.matrix-item svg {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Related Tools */
.related-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
  transition: all 0.12s ease;
}

.related-tool-link:hover {
  background: #eff6ff;
  color: var(--brand-blue);
}

/* ==========================================================================
   15. Site Footer
   ========================================================================== */
.site-footer {
  margin-top: 4rem;
  background: #f8fafc;
  border-top: 1px solid var(--card-border);
  padding: 3rem 1.5rem 2rem;
}

.footer-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.footer-tools-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-tools-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.footer-tools-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-tools-links a {
  font-size: 0.875rem;
  color: var(--body);
  text-decoration: none;
  transition: color 0.12s ease;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom a {
  color: var(--body);
  text-decoration: none;
}
.footer-bottom a:hover {
  color: var(--brand-blue);
}

/* ==========================================================================
   16. Accessibility & Motion Preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
