/**
 * SMARTDOCIFY - PDF REDACTOR & CONTACT REMOVER STYLESHEET
 * Token-driven responsive design system with full Light & Dark theme parity.
 */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Foundation Tokens - Light Theme */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --bg-card: #ffffff;
  --bg-canvas-stage: #334155;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-hover: #94a3b8;
  --border-color: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --primary-glow: rgba(37, 99, 235, 0.25);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.1);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.1);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-alt: #172338;
  --bg-card: #1e293b;
  --bg-canvas-stage: #0b1120;

  --border-subtle: #2d3b55;
  --border-medium: #3b4c6b;
  --border-hover: #506690;
  --border-color: #2d3b55;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.35);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.55);
}

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

html {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
  font-size: 16px;
}

/* Master Centered Page Container */
.container,
.main-container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 24px);
  box-sizing: border-box;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 24px);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-svg {
  width: 32px;
  height: 32px;
  display: block;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.desktop-nav .nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.action-btn .ui-icon {
  width: 20px;
  height: 20px;
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.menu-toggle {
  display: none;
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* Mobile Drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
}

.breadcrumb-item {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   TOOL HERO SECTION
   ========================================================================== */
.tool-hero {
  padding: 2.5rem 0 1.5rem 0;
  text-align: center;
}

.tool-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

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

.tool-hero-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-hero-subtitle {
  max-width: 780px;
  margin: 0 auto 1.5rem auto;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Privacy Assurance Pill Banner */
.privacy-pill-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.privacy-pill-banner svg {
  color: var(--success);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   UPLOAD DROPZONE SECTION
   ========================================================================== */
.upload-card-wrapper {
  max-width: 840px;
  margin: 0 auto 2.5rem auto;
}

.dropzone-box {
  background: var(--bg-surface);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 5vw, 4rem) 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.dropzone-box:hover,
.dropzone-box.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dropzone-icon-circle {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.05);
}

.dropzone-icon-circle svg {
  width: 36px;
  height: 36px;
}

.dropzone-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.dropzone-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.dropzone-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-hover);
}

.dropzone-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Alert Notification Banner */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.9rem;
}

.alert-banner.error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.alert-banner.warning {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #b45309;
}

[data-theme="dark"] .alert-banner.warning {
  color: #fbbf24;
}

.alert-banner.success {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.alert-banner-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.alert-banner-close:hover {
  opacity: 1;
}

/* Loading Overlay */
.loading-indicator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin: 1.5rem auto;
  max-width: 500px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   REDACTION WORKSPACE (2-COLUMN RESPONSIVE GRID)
   ========================================================================== */
.redactor-workspace {
  margin-bottom: 3.5rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.75rem;
  align-items: start;
}

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

/* Document Viewport Card (Left Column) */
.viewport-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viewport-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.page-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.4rem;
}

/* Canvas Viewport Stage */
.canvas-stage-scrollbox {
  background: var(--bg-canvas-stage);
  min-height: 550px;
  max-height: 780px;
  overflow: auto;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  scrollbar-width: thin;
}

.canvas-wrapper {
  position: relative;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  border-radius: 2px;
  line-height: 0;
  user-select: none;
}

#pdf-canvas {
  display: block;
  max-width: none;
}

/* Interactive Redaction Drawing Overlay */
.redaction-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: crosshair;
}

.redaction-overlay.mode-pan {
  cursor: grab;
}

/* Selection Box being dragged */
.drag-selection-box {
  position: absolute;
  border: 2px dashed #2563eb;
  background: rgba(37, 99, 235, 0.2);
  pointer-events: none;
  z-index: 20;
}

/* Applied Redaction Box Marker */
.applied-redaction-box {
  position: absolute;
  box-sizing: border-box;
  z-index: 10;
  transition: outline 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.applied-redaction-box.type-blackout {
  background: #000000 !important;
  color: #ffffff;
}

.applied-redaction-box.type-whiteout {
  background: #ffffff !important;
  border: 1px solid #cbd5e1;
  color: #000000;
}

.applied-redaction-box.type-permanent {
  background: #111827 !important;
  border: 1px dashed #ef4444;
  color: #ffffff;
}

.applied-redaction-box:hover {
  outline: 2px solid var(--primary);
}

.applied-redaction-box.selected {
  outline: 2px solid #ef4444 !important;
}

.box-remove-btn {
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -8px;
  right: -8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 30;
}

.applied-redaction-box:hover .box-remove-btn,
.applied-redaction-box.selected .box-remove-btn {
  display: flex;
}

/* Contact Finder / Target Highlighter Pulse */
.contact-highlight-pulse {
  position: absolute;
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.25);
  border-radius: 2px;
  animation: highlight-flash 1.2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 15;
}

@keyframes highlight-flash {
  from { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4); }
  to { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   SIDEBAR CONTROLS (Right Column)
   ========================================================================== */
.controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.card-heading-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-heading-left svg {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

/* Redaction Mode Radio Selector */
.mode-pills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.mode-pill-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
}

.mode-pill-option:hover {
  border-color: var(--border-hover);
}

.mode-pill-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mode-pill-option input[type="radio"] {
  margin-top: 0.2rem;
  cursor: pointer;
}

.mode-option-text {
  flex: 1;
}

.mode-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.mode-tag.tag-whiteout { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.mode-tag.tag-blackout { background: #0f172a; color: #ffffff; }
.mode-tag.tag-secure { background: #fee2e2; color: #b91c1c; }

.mode-option-desc {
  font-size: 0.785rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* Disclosure Notice Box */
.disclosure-notice-box {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.disclosure-notice-box strong {
  color: var(--text-main);
}

/* Contact Detection List */
.contacts-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contacts-btn-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.btn-chip {
  padding: 0.35rem 0.65rem;
  font-size: 0.785rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-chip-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-chip-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.detected-items-scrollbox {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.25rem;
  scrollbar-width: thin;
}

.detected-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  gap: 0.5rem;
  transition: border-color var(--transition-fast);
}

.detected-item-row:hover {
  border-color: var(--border-hover);
}

.detected-item-row.redacted {
  border-color: var(--success);
  background: var(--success-light);
}

.detected-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.item-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.item-type-badge.phone { background: #dbeafe; color: #1e40af; }
.item-type-badge.email { background: #ede9fe; color: #5b21b6; }

[data-theme="dark"] .item-type-badge.phone { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .item-type-badge.email { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }

.item-text-label {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.item-page-badge {
  font-size: 0.725rem;
  color: var(--text-light);
}

.detected-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-item-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
}

.btn-item-action:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Empty State / Scanned Notice */
.empty-detected-state {
  text-align: center;
  padding: 1.25rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-detected-state svg {
  width: 28px;
  height: 28px;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

/* Active Redactions List */
.active-layers-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.layer-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.layer-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
}

/* Export & Output Card */
.output-form-group {
  margin-bottom: 1rem;
}

.output-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.output-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}

.output-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-block {
  width: 100%;
}

.export-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Success Download Banner */
.download-success-banner {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

[data-theme="dark"] .download-success-banner {
  color: #a7f3d0;
}

.download-success-banner strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   SUPPORTING SEO CONTENT & ACCORDIONS
   ========================================================================== */
.seo-content-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
}

.seo-prose-container {
  max-width: 860px;
  margin: 0 auto;
}

.seo-prose-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.seo-prose-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.seo-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.seo-info-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-info-card h3 svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.seo-info-card p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.seo-article-block {
  margin: 2.5rem 0;
}

.seo-article-block h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.seo-article-block h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.5rem 0 0.6rem 0;
}

.seo-article-block p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.seo-article-block ul,
.seo-article-block ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-article-block li {
  margin-bottom: 0.4rem;
}

.seo-callout-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.seo-callout-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.seo-callout-box p {
  margin-bottom: 0;
  font-size: 0.925rem;
}

/* ==========================================================================
   HOW TO USE SECTION
   ========================================================================== */
.how-to-section {
  padding: 3rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.step-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.step-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   FAQ ACCORDION SECTION
   ========================================================================== */
.faq-section {
  padding: 3rem 0;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
}

.faq-container {
  max-width: 860px;
  margin: 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.faq-trigger {
  width: 100%;
  padding: 1.1rem 1.25rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.025rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color var(--transition-fast);
}

.faq-trigger:hover {
  color: var(--primary);
}

.faq-trigger svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item.active .faq-trigger svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-content {
  display: none;
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.active .faq-content {
  display: block;
}

/* ==========================================================================
   RELATED TOOLS SECTION
   ========================================================================== */
.related-tools-section {
  padding: 3rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

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

.related-tool-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.related-tool-icon svg {
  width: 22px;
  height: 22px;
}

.related-tool-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.related-tool-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 0.85rem;
}

.related-tool-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

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

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

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-links {
  display: flex;
  gap: 1rem;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}
