/* ==========================================================================
   Rank Radar - Premium Glassmorphism & Radar Stylesheet
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Dark Theme Default */
  --bg-app: #080c14;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(22, 33, 58, 0.75);
  --bg-surface: rgba(30, 41, 59, 0.5);
  --bg-input: rgba(15, 23, 42, 0.85);

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.16);
  --border-focus: #06b6d4;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #38bdf8;
  --text-link-hover: #7dd3fc;

  /* Accent & Radar Highlights */
  --radar-emerald: #10b981;
  --radar-emerald-glow: rgba(16, 185, 129, 0.25);
  --radar-cyan: #00e5ff;
  --radar-cyan-glow: rgba(0, 229, 255, 0.3);
  --radar-blue: #38bdf8;
  --radar-purple: #8b5cf6;

  --status-up: #10b981;
  --status-down: #f43f5e;
  --status-neutral: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glass: 0 16px 36px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-glass);
  --shadow-glow: 0 0 30px -5px rgba(0, 229, 255, 0.2);
  --shadow-rank: 0 0 40px -5px rgba(16, 185, 129, 0.35);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #f1f5f9;
  --bg-input: #ffffff;

  --border-glass: rgba(203, 213, 225, 0.8);
  --border-glass-bright: rgba(148, 163, 184, 0.8);
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-link: #0284c7;
  --text-link-hover: #0369a1;

  --radar-emerald: #059669;
  --radar-emerald-glow: rgba(5, 150, 105, 0.15);
  --radar-cyan: #0284c7;
  --radar-cyan-glow: rgba(2, 132, 199, 0.15);
  --radar-blue: #2563eb;
  --radar-purple: #7c3aed;

  --shadow-glass: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(226, 232, 240, 0.9);
  --shadow-glow: 0 0 25px -5px rgba(2, 132, 199, 0.12);
  --shadow-rank: 0 0 35px -5px rgba(5, 150, 105, 0.2);
}

/* Universal Link Styling & Readability */
a, a:visited {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

a:active {
  color: var(--text-link-hover);
}

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

svg {
  box-sizing: border-box;
}

svg.icon,
svg.input-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal);
}

/* Ambient Backdrops */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.45;
  transition: opacity 0.5s ease;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, transparent 70%);
  top: -120px;
  left: 10%;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
  bottom: 5%;
  right: 5%;
}

.glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  top: 40%;
  left: 45%;
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 270px;
  min-width: 270px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-glass);
  border-radius: 0;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-close-btn {
  display: none;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 4px;
}

.app-sidebar .nav-tabs-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  padding: 0;
  border: none;
  width: 100%;
}

.app-sidebar .nav-tab-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: all var(--transition-fast);
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
}

.app-sidebar .nav-tab-pill .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.app-sidebar .nav-tab-pill:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-glass);
}

.app-sidebar .nav-tab-pill:hover .icon {
  color: var(--radar-cyan);
}

.app-sidebar .nav-tab-pill.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(16, 185, 129, 0.18) 100%);
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 4px 14px -2px rgba(6, 182, 212, 0.25);
}

.app-sidebar .nav-tab-pill.active .icon {
  color: var(--radar-cyan);
}

.sidebar-actions-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.btn-sidebar-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  white-space: nowrap;
}

.btn-sidebar-action .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.btn-sidebar-action:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-glass);
}

.btn-sidebar-action:hover .icon {
  color: var(--radar-cyan);
}

.btn-sidebar-action .badge {
  margin-left: auto;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-sidebar .btn-theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.sidebar-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
  animation: statusPulse 2s infinite;
}

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

.status-text-block {
  display: flex;
  flex-direction: column;
}

.status-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge-live {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Workspace Main Content Area */
.app-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 36px 48px;
}

.app-main-content .main-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.mobile-top-bar {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* Glass Card Common */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-glass-bright);
}

/* Legacy Header compatibility if needed */
.top-header {
  display: none;
}

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

/* Radar Brand Icon */
.radar-logo-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.radar-sweep-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, rgba(6, 182, 212, 0.8) 360deg);
  animation: radarRotate 3s linear infinite;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  position: relative;
  z-index: 2;
}

@keyframes radarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.accent-text {
  background: linear-gradient(135deg, var(--radar-cyan), var(--radar-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--radar-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

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

/* Button & Icon Styles */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:active {
  transform: scale(0.98);
}

.btn-ghost {
  background: var(--bg-surface);
  border-color: var(--border-glass);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-bright);
}

.btn-outline {
  border-color: var(--border-glass-bright);
  background: var(--bg-surface);
}

.btn-outline:hover {
  border-color: var(--radar-cyan);
  color: var(--radar-cyan);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-bright);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--radar-cyan) 0%, var(--radar-emerald) 100%);
  color: #031417;
  font-weight: 700;
  box-shadow: 0 4px 20px -3px rgba(6, 182, 212, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px -2px rgba(6, 182, 212, 0.6);
  filter: brightness(1.06);
}

.btn-radar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 46px;
}

.btn-radar-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.btn-radar:hover .btn-radar-pulse {
  animation: pulseLight 1.5s ease-out infinite;
}

@keyframes pulseLight {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  50% { opacity: 0.5; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

.icon,
.input-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Theme Toggle Button & Icons */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 38px;
}

.btn-theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.theme-label {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .btn-theme-toggle .icon-moon { display: block; color: #38bdf8; }
[data-theme="dark"] .btn-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-sun { display: block; color: #f59e0b; }

.link-external {
  font-size: 0.78rem;
  color: var(--radar-cyan);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.link-external:hover {
  text-decoration: underline;
  color: #38bdf8;
  filter: brightness(1.15);
}

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-engine {
  background: rgba(6, 182, 212, 0.12);
  color: var(--radar-cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Search Panel
   ========================================================================== */
.search-panel {
  padding: 28px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="number"],
.custom-select-wrapper select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.input-with-icon input {
  padding-left: 44px !important;
}

.input-with-icon input:focus,
.custom-select-wrapper select:focus,
.input-group input:focus {
  border-color: var(--radar-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

/* Presets & Chips */
.preset-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.preset-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--radar-cyan);
  border-color: var(--radar-cyan);
}

/* Secondary Form Row */
.form-row-secondary {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: flex-end;
}

.custom-select-wrapper {
  position: relative;
}

.custom-select-wrapper select {
  padding-left: 14px;
  padding-right: 32px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.custom-select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

/* ==========================================================================
   Live Scanning Screen
   ========================================================================== */
.scanning-view {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-glow);
}

.radar-scope {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, rgba(15, 23, 42, 0.8) 75%);
  border: 2px solid rgba(6, 182, 212, 0.5);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.25);
}

.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(6, 182, 212, 0.35);
}

.circle-1 { width: 35%; height: 35%; }
.circle-2 { width: 65%; height: 65%; }
.circle-3 { width: 95%; height: 95%; }

.radar-crosshair-v {
  position: absolute;
  width: 1px;
  height: 100%;
  left: 50%;
  background: rgba(6, 182, 212, 0.25);
}

.radar-crosshair-h {
  position: absolute;
  height: 1px;
  width: 100%;
  top: 50%;
  background: rgba(6, 182, 212, 0.25);
}

.radar-sweeper {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 290deg, rgba(6, 182, 212, 0.8) 360deg);
  animation: radarRotate 2s linear infinite;
}

.radar-target-blip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--radar-emerald);
  position: absolute;
  box-shadow: 0 0 8px var(--radar-emerald);
  animation: blipFade 2s infinite ease-in-out;
}

.blip-1 { top: 38%; left: 62%; animation-delay: 0.3s; }
.blip-2 { top: 68%; left: 32%; animation-delay: 1.1s; }

@keyframes blipFade {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.scanning-status h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.scanning-status p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.scanning-progress-bar {
  width: 280px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  overflow: hidden;
  margin: 16px auto 0;
}

.progress-bar-fill {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--radar-cyan), var(--radar-emerald));
  border-radius: var(--radius-full);
  animation: progressSweep 1.8s ease-in-out infinite alternate;
}

@keyframes progressSweep {
  0% { width: 15%; margin-left: 0; }
  100% { width: 50%; margin-left: 50%; }
}

/* ==========================================================================
   Results View & Metrics Grid
   ========================================================================== */
.results-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s ease-out;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.card-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Rank Hero Card */
.card-rank-hero {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.card-rank-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.rank-display-box {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin: 8px 0 16px;
}

.rank-primary-number {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--radar-emerald);
  text-shadow: 0 0 25px var(--radar-emerald-glow);
}

.rank-primary-number.not-found {
  font-size: 2.2rem;
  color: var(--status-down);
  text-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.rank-context-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-subtext {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.rank-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.delta-improved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-up);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.delta-dropped {
  background: rgba(244, 63, 94, 0.15);
  color: var(--status-down);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.delta-neutral {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.target-site-summary {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 8px 0 16px;
  border: 1px solid var(--border-glass);
}

.summary-domain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.target-domain-url {
  font-weight: 700;
  color: var(--text-link);
  text-decoration: none;
  font-size: 0.95rem;
}

.target-domain-url:hover {
  text-decoration: underline;
}

.target-title-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Visibility Card */
.card-features-visibility {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.visibility-meter-box {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-glass);
  margin-bottom: 16px;
}

.visibility-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--radar-cyan);
}

.visibility-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.visibility-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--radar-blue), var(--radar-cyan));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.visibility-subhint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.serp-features-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.features-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.feature-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.tag-highlight {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--radar-cyan);
}

.tag-highlight .tag-dot {
  background: var(--radar-cyan);
  box-shadow: 0 0 6px var(--radar-cyan);
}

/* ==========================================================================
   Competitor Arena (Above & Below)
   ========================================================================== */
.competitor-arena-card {
  padding: 24px 28px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-with-icon h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.title-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.competitor-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 16px;
}

.neighbor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
  position: relative;
}

.neighbor-target {
  background: rgba(16, 185, 129, 0.08);
  border: 2px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.neighbor-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.neighbor-role {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-above { color: var(--radar-cyan); }
.role-target { color: var(--radar-emerald); }
.role-below { color: var(--radar-purple); }

.neighbor-rank {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.neighbor-target .neighbor-rank {
  background: var(--radar-emerald);
  color: #031417;
}

.neighbor-url {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-link);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neighbor-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.neighbor-snippet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Full SERP Results Explorer
   ========================================================================== */
.serp-explorer-card {
  padding: 24px 28px;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.explorer-title-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explorer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quick-filter-input input {
  height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 200px;
}

.quick-filter-input input:focus {
  border-color: var(--radar-cyan);
  outline: none;
}

/* SERP Item Row */
.serp-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.serp-row,
.serp-item-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
  margin-bottom: 10px;
}

.serp-row:hover,
.serp-item-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-bright);
}

.serp-row.is-target,
.serp-item-row.is-target {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.serp-rank-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rank-badge-pill,
.serp-rank-pill {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.rank-1 .rank-badge-pill,
.rank-1 .serp-rank-pill {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a0f00;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}

.rank-2 .rank-badge-pill,
.rank-2 .serp-rank-pill {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #0f172a;
}

.rank-3 .rank-badge-pill,
.rank-3 .serp-rank-pill {
  background: linear-gradient(135deg, #b45309, #78350f);
  color: #fff;
}

.is-target .rank-badge-pill,
.is-target .serp-rank-pill {
  background: linear-gradient(135deg, var(--radar-emerald), var(--radar-cyan));
  color: #031417;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.serp-details-col,
.serp-content-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.serp-domain-line,
.serp-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.serp-domain-pill,
.serp-domain {
  font-weight: 700;
  color: var(--radar-cyan);
  font-family: var(--font-mono);
}

.serp-title-link,
.serp-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 2px 0 4px 0;
}

.serp-title-link,
.serp-item-title a {
  color: var(--text-link);
  text-decoration: none;
  word-break: break-word;
  transition: color var(--transition-fast);
}

.serp-title-link:hover,
.serp-item-title a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

.serp-snippet,
.serp-item-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

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

/* Auto-Discovery Keyword Selection Cards */
.auto-kw-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.auto-kw-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-bright);
}

.auto-kw-card.is-selected {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--radar-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.auto-kw-card input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--radar-cyan);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auto-kw-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.auto-kw-card.is-selected .auto-kw-text {
  color: var(--text-link);
}

/* ==========================================================================
   Welcome State
   ========================================================================== */
.welcome-view {
  padding: 60px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-radar-visual {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.radar-scope-mini {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.welcome-view h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-view p {
  color: var(--text-secondary);
  max-width: 550px;
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.feature-highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 950px;
  text-align: left;
}

.highlight-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}

.item-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.highlight-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.highlight-item p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-glass-bright);
}

.modal-history {
  max-width: 760px;
}

.modal-settings {
  max-width: 740px;
}

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

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-with-icon h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface);
}

/* Settings Form Styles */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.group-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.group-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.settings-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-actions-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-text {
  font-size: 0.82rem;
  font-weight: 600;
}

.feedback-success { color: var(--status-up); }
.feedback-error { color: var(--status-down); }

.guide-banner {
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.8rem;
}

.guide-banner h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--radar-cyan);
}

.guide-banner ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

.guide-banner a {
  color: var(--text-link);
  text-decoration: underline;
}

/* History List Item */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.history-item-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-bright);
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-target-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-domain-bold {
  font-weight: 700;
  font-size: 0.95rem;
}

.history-keyword-pill {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.history-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-right-col {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-rank-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.history-rank-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--radar-emerald);
}

.history-rank-val.not-found {
  font-size: 0.85rem;
  color: var(--status-down);
}

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

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass-bright);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideToast 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { border-color: var(--radar-emerald); }
.toast-error { border-color: var(--status-down); }

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

/* App Footer */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}

.status-online {
  color: var(--radar-emerald);
  font-weight: 600;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .form-row-primary {
    grid-template-columns: 1fr;
  }

  .form-row-secondary {
    grid-template-columns: 1fr 1fr;
  }

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

  .competitor-cards-grid {
    grid-template-columns: 1fr;
  }

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

  .app-layout {
    padding: 16px 12px 30px;
  }
}

@media (max-width: 1280px) {
  .app-main-content {
    padding: 24px 24px 44px;
  }
}

@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    margin: 12px 16px 0;
    border-radius: var(--radius-lg);
    z-index: 30;
  }

  .mobile-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .radar-logo-box-sm {
    width: 32px;
    height: 32px;
  }

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

  .mobile-brand .brand-title {
    font-size: 1.15rem;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    border-radius: 0 16px 16px 0;
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
  }

  .sidebar-backdrop.hidden {
    display: none;
  }

  .app-main-content {
    padding: 16px 14px 36px;
  }
}

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

  .explorer-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-filter-input input {
    width: 100%;
  }

  .rank-display-box {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   Recent Searches Fast Bar & Autocomplete History Dropdowns
   ========================================================================== */
.recent-searches-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.recent-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.recent-searches-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
  width: 100%;
}

.recent-searches-carousel::-webkit-scrollbar {
  display: none;
}

.recent-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  flex-shrink: 0;
}

.recent-search-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--radar-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.recent-search-pill .pill-domain {
  font-weight: 700;
  color: var(--radar-cyan);
}

.recent-search-pill .pill-keyword {
  color: var(--text-secondary);
}

.recent-search-pill .pill-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.recent-search-pill .pill-rank.not-found {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
  border-color: var(--border-glass);
}

/* Magic Input Button */
#domain-input-wrapper {
  position: relative;
}

#domain-input-wrapper input {
  padding-right: 155px !important;
}

.btn-input-magic {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-sm);
  color: var(--radar-cyan);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 5;
}

.btn-input-magic:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(16, 185, 129, 0.3));
  border-color: var(--radar-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
  transform: scale(1.02);
}

.magic-sparkle {
  font-size: 0.95rem;
  animation: sparkleTwinkle 2s infinite ease-in-out;
}

@keyframes sparkleTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.2) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 4px var(--radar-cyan)); }
}

/* Autocomplete History Dropdown */
.history-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  max-height: 270px;
  overflow-y: auto;
  z-index: 100;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-dd-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.history-dd-item:hover,
.history-dd-item.selected {
  background: var(--bg-surface);
  border-left: 3px solid var(--radar-cyan);
}

.history-dd-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.history-dd-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-dd-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.history-dd-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chips-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ==========================================================================
   Keyword Discovery Tray Styles
   ========================================================================== */
.keyword-discovery-tray {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.06) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px -5px rgba(6, 182, 212, 0.15);
  animation: slideFadeDown 0.3s ease-out;
}

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

.tray-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.tray-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tray-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tray-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--radar-cyan);
  box-shadow: 0 0 10px var(--radar-cyan);
  display: inline-block;
  animation: pulseDot 2s infinite;
}

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

.tray-domain-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--radar-cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-category {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.badge-location {
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.tray-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.tray-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.tray-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tray-tabs-bar::-webkit-scrollbar {
  display: none;
}

.tray-tab-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tray-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-bright);
}

.tray-tab-btn.active {
  background: rgba(6, 182, 212, 0.2);
  color: var(--radar-cyan);
  border-color: var(--radar-cyan);
}

/* Loading State for Keyword Discovery */
.tray-loading-state {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.tray-radar-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--radar-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

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

.tray-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tray-loading-text strong {
  font-size: 0.9rem;
  color: var(--radar-cyan);
}

.tray-loading-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Suggestions Grid */
.tray-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.term-suggestion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  text-align: left;
}

.term-suggestion-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--radar-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.2);
}

.term-suggestion-card.selected {
  border-color: var(--radar-cyan);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 0 2px var(--radar-cyan);
}

.term-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.term-keyword-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.term-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.badge-intent {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.badge-intent.badge-local {
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-intent.badge-commercial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-intent.badge-service {
  background: rgba(6, 182, 212, 0.15);
  color: var(--radar-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-intent.badge-popular {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-intent.badge-brand {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-prev-rank {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.2);
  color: var(--radar-cyan);
  border: 1px solid var(--radar-cyan);
}

.term-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.term-reason {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-quick-scan {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-quick-scan:hover {
  background: var(--radar-cyan);
  color: #031417;
  border-color: var(--radar-cyan);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}


/* ==========================================================================
   PRO UPGRADE: Multi-View Navigation, Projects, Charts, Geo & Executive Reports
   ========================================================================== */

/* Header Navigation Tabs */
.nav-tabs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.4);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-tab-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-tab-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-pill.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(16, 185, 129, 0.25) 100%);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 14px -2px rgba(6, 182, 212, 0.3);
}

/* Device Selector Pills */
.device-toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.device-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.device-btn:hover {
  color: var(--text-primary);
}

.device-btn.active {
  background: var(--bg-surface);
  color: var(--radar-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Intent Badges */
.badge-intent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-intent-commercial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-intent-transactional {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-intent-informational {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-intent-navigational {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Feature Matrix Cards */
.feature-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.feature-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.feature-box-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Projects & Campaigns Workspace */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace-hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.projects-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glass-bright);
  box-shadow: var(--shadow-glow);
}

.project-card.active-selected {
  border-color: var(--radar-cyan);
  box-shadow: 0 0 25px -4px rgba(6, 182, 212, 0.3);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.project-card-domain {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--radar-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.project-card-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.project-kpi-item .kpi-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.project-kpi-item .kpi-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Batch Scanner Progress Banner */
.batch-progress-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.batch-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--radar-cyan), var(--radar-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Keywords Table */
.keywords-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.keywords-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.keywords-table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
}

.keywords-table-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.kw-search-input {
  padding: 7px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  min-width: 230px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kw-search-input:focus {
  border-color: var(--radar-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.select-trend-filter {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.84rem;
  outline: none;
}

.radar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.radar-table th {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.radar-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
  vertical-align: middle;
}

.radar-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.kw-title-cell {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: inline-block;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.kw-cell-visibility {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.kw-cell-serp-features {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.kw-cell-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-delete-kw {
  color: #ef4444 !important;
  transition: all var(--transition-fast);
}

.btn-delete-kw:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.local-pack-item-card {
  background: rgba(15, 23, 42, 0.5);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.table-rank-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rank-top1 { color: #f59e0b; text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.rank-top3 { color: #10b981; }
.rank-top10 { color: #06b6d4; }
.rank-page2 { color: #8b5cf6; }
.rank-out { color: var(--text-muted); font-size: 0.82rem; }

/* Historical Trend Chart View */
.chart-container-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-controls-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.chart-canvas-box {
  position: relative;
  width: 100%;
  height: 380px;
}

/* ==========================================================================
   Interactive Tooltips & Hover Explanations System
   ========================================================================== */
.label-with-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.1);
  color: var(--radar-cyan);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all var(--transition-fast);
  vertical-align: middle;
  outline: none;
  flex-shrink: 0;
}

.tooltip-info-btn:hover,
.tooltip-info-btn:focus-visible {
  background: var(--radar-cyan);
  color: #0f172a;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  border-color: var(--radar-cyan);
}

[data-theme="light"] .tooltip-info-btn {
  border-color: rgba(2, 132, 199, 0.35);
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
}

[data-theme="light"] .tooltip-info-btn:hover,
[data-theme="light"] .tooltip-info-btn:focus-visible {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

.setting-helper-text {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 3px;
}

[data-theme="light"] .setting-helper-text {
  color: #64748b !important;
}

/* Floating Tooltip Element */
.radar-floating-tooltip {
  position: absolute;
  z-index: 999999;
  max-width: 330px;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(6, 182, 212, 0.15);
  color: #f8fafc;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.radar-floating-tooltip.hidden {
  display: none !important;
}

[data-theme="light"] .radar-floating-tooltip {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 18px 40px -6px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
  color: #0f172a !important;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tooltip-header .tooltip-icon {
  font-size: 0.95rem;
}

.tooltip-header .tooltip-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--radar-cyan);
  letter-spacing: -0.01em;
}

[data-theme="light"] .tooltip-header .tooltip-title {
  color: #0284c7 !important;
}

.tooltip-body {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
}

[data-theme="light"] .tooltip-body {
  color: #334155 !important;
}

.tooltip-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: rgba(6, 182, 212, 0.1);
  border-left: 3px solid var(--radar-cyan);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.77rem;
  line-height: 1.45;
  color: #a5f3fc;
  margin-top: 2px;
}

[data-theme="light"] .tooltip-tip-box {
  background: #f0fdf4 !important;
  border-left-color: #10b981 !important;
  color: #166534 !important;
}

.tooltip-tip-icon {
  flex-shrink: 0;
  font-size: 0.82rem;
}

/* ==========================================================================
   Executive Report View & Printable Sheet
   ========================================================================== */
.report-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-controls-bar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}

.report-controls-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.report-control-select,
.report-control-input {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.report-control-select:focus,
.report-control-input:focus {
  border-color: var(--radar-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
  outline: none;
}

/* Executive Report Sheet Container */
.executive-report-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: var(--shadow-glass);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

/* Header Section */
.report-header-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border-glass);
  padding-bottom: 24px;
  flex-wrap: wrap;
  gap: 20px;
}

.report-brand-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-agency-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--radar-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[data-theme="light"] .report-agency-pill {
  color: #0284c7;
}

.report-agency-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.report-brand-title h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0;
}

.report-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--radar-cyan);
  width: fit-content;
  margin-top: 4px;
}

[data-theme="light"] .report-domain-pill {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.report-verified-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="light"] .report-verified-badge {
  background: #dcfce7;
  color: #166534;
}

/* Metadata Box */
.report-meta-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
}

.report-meta-box strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* KPI Grid */
.report-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.report-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.report-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-bright);
}

.report-kpi-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.report-kpi-card .kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.report-kpi-card .kpi-num {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  margin: 6px 0 2px 0;
  letter-spacing: -0.02em;
  color: var(--radar-cyan);
}

[data-theme="light"] .report-kpi-card .kpi-num {
  color: #0284c7;
}

.report-kpi-card .kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Strategic Insights Box */
.report-insights-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(16, 185, 129, 0.06) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 22px;
}

[data-theme="light"] .report-insights-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 100%) !important;
  border: 1px solid #86efac !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.06);
}

.report-insights-box h4 {
  color: var(--radar-cyan);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="light"] .report-insights-box h4 {
  color: #065f46 !important;
}

.report-insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.report-insights-list p {
  margin: 0;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--radar-emerald);
  color: var(--text-primary);
}

[data-theme="light"] .report-insights-list p {
  color: #1e293b !important;
  border-left-color: #10b981 !important;
}

.report-insights-list p strong {
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="light"] .report-insights-list p strong {
  color: #0f172a !important;
}

/* Report Sub-Cards Grid (Gainers, Quick Wins, Drops) */
.report-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.report-sub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="light"] .report-sub-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.report-sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
}

.report-sub-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.88rem;
  color: var(--text-primary);
}

[data-theme="light"] .report-item-row {
  border-bottom-color: #f1f5f9 !important;
  color: #0f172a !important;
}

.report-item-kw {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

[data-theme="light"] .report-item-kw {
  color: #0f172a !important;
}

.report-badge-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-chip-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-emerald);
}

[data-theme="light"] .badge-chip-green {
  background: #dcfce7;
  color: #166534;
}

.badge-chip-purple {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
}

[data-theme="light"] .badge-chip-purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.badge-chip-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

[data-theme="light"] .badge-chip-red {
  background: #fee2e2;
  color: #b91c1c;
}

.report-empty-notice {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
}

/* Detailed Keyword Rankings in Report */
.report-table-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.report-table-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.report-table-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Report Footer Section */
.report-footer-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.report-footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-secondary);
}

.report-footer-sub {
  font-size: 0.74rem;
}

.report-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.report-confidential-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #e11d48;
}

/* Print Styles for PDF */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 14mm 14mm 14mm;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10.5pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ambient-glow,
  .app-sidebar,
  .sidebar-backdrop,
  .top-header,
  .app-footer,
  .mobile-bottom-nav,
  .mobile-header-bar,
  .report-controls-bar,
  .nav-tabs-group,
  .header-actions,
  .btn,
  .btn-icon,
  .tooltip-info-btn,
  .radar-floating-tooltip,
  .modal-backdrop,
  .toast-container,
  .search-panel,
  .welcome-view,
  .scanning-view,
  .history-autocomplete-dropdown,
  .preset-chips,
  .keyword-discovery-tray,
  .card-actions-row,
  .explorer-controls,
  .projects-container .workspace-hero-bar,
  .projects-container .projects-toolbar,
  .chart-controls-strip,
  .hidden,
  .view-panel.hidden,
  .view-panel:not(.active) {
    display: none !important;
  }

  .app-layout,
  .main-wrapper,
  .app-main,
  .view-panel.active,
  .report-view-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .executive-report-sheet {
    background: #ffffff !important;
    color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .report-header-section {
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 14px !important;
    margin-bottom: 18px !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  .report-brand-title h2 {
    color: #0f172a !important;
  }

  .report-domain-pill {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    color: #0369a1 !important;
  }

  .report-meta-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
  }

  .report-meta-box strong {
    color: #0f172a !important;
  }

  .report-kpis-grid {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 18px !important;
  }

  .report-kpi-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 10px 8px !important;
  }

  .report-kpi-card .kpi-label {
    color: #334155 !important;
    font-weight: 700 !important;
  }

  .report-kpi-card .kpi-num {
    color: #0f172a !important;
  }

  .report-insights-box {
    background: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    color: #0f172a !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 18px !important;
  }

  .report-insights-box h4 {
    color: #065f46 !important;
  }

  .report-insights-list p {
    color: #1e293b !important;
    border-left-color: #10b981 !important;
  }

  .report-sub-grid {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 18px !important;
  }

  .report-sub-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
  }

  .report-item-row {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }

  .radar-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  .radar-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 8px 10px !important;
  }

  .radar-table td {
    background: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 8px 10px !important;
  }

  .radar-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-footer-section {
    border-top: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* ==========================================================================
   Comprehensive Light Theme Overrides & Legibility
   ========================================================================== */
[data-theme="light"] body {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

[data-theme="light"] .ambient-glow {
  opacity: 0.05;
}

[data-theme="light"] .glass-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .app-sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .sidebar-brand-box {
  border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .sidebar-footer {
  border-top: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .sidebar-section-label {
  color: #94a3b8 !important;
}

[data-theme="light"] .app-sidebar .nav-tab-pill {
  color: #475569 !important;
}

[data-theme="light"] .app-sidebar .nav-tab-pill:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .app-sidebar .nav-tab-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.35) !important;
}

[data-theme="light"] .app-sidebar .nav-tab-pill.active .icon {
  color: #ffffff !important;
}

[data-theme="light"] .btn-sidebar-action {
  color: #475569 !important;
}

[data-theme="light"] .btn-sidebar-action:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .sidebar-status-box {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="light"] .status-name {
  color: #065f46 !important;
}

[data-theme="light"] .mobile-top-bar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .brand-title {
  color: #0f172a !important;
}

[data-theme="light"] .brand-subtitle {
  color: #64748b !important;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-ghost {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0 !important;
}

[data-theme="light"] .nav-tab-btn {
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .nav-tab-btn:hover {
  color: #0f172a !important;
  background: #f8fafc !important;
}

[data-theme="light"] .nav-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}

[data-theme="light"] .project-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .project-card:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.12) !important;
}

[data-theme="light"] .keywords-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .keywords-table td {
  border-color: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .keywords-table tr:hover td {
  background: #f8fafc !important;
}

[data-theme="light"] .neighbor-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .neighbor-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .neighbor-target {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
}

[data-theme="light"] .neighbor-rank {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

[data-theme="light"] .neighbor-url {
  color: #0284c7 !important;
}

[data-theme="light"] .neighbor-snippet {
  color: #475569 !important;
}

[data-theme="light"] .serp-item-row,
[data-theme="light"] .serp-row {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .serp-item-row:hover,
[data-theme="light"] .serp-row:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .serp-item-row.is-target,
[data-theme="light"] .serp-row.is-target {
  background: #f0fdf4 !important;
  border-color: #10b981 !important;
}

[data-theme="light"] .serp-rank-pill,
[data-theme="light"] .rank-badge-pill {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .serp-domain,
[data-theme="light"] .serp-domain-pill {
  color: #0284c7 !important;
}

[data-theme="light"] .serp-item-title a,
[data-theme="light"] .serp-title-link {
  color: #0284c7 !important;
}

[data-theme="light"] .serp-item-title a:hover,
[data-theme="light"] .serp-title-link:hover {
  color: #0369a1 !important;
}

[data-theme="light"] .serp-item-snippet,
[data-theme="light"] .serp-snippet {
  color: #475569 !important;
}

[data-theme="light"] .modal-content {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] .modal-header h3 {
  color: #0f172a !important;
}

[data-theme="light"] .history-item {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .history-item:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .keyword-tray,
[data-theme="light"] .tray-header {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .tray-kw-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .tray-kw-card:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .badge-target {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #bbf7d0 !important;
}

[data-theme="light"] .badge-primary {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

[data-theme="light"] .chart-container-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .chart-header h3,
[data-theme="light"] .metric-label,
[data-theme="light"] .form-group label {
  color: #334155 !important;
}

[data-theme="light"] .metric-value,
[data-theme="light"] .rank-display-number {
  color: #0f172a !important;
}

/* Executive White-Label Report Light Theme Overrides */
[data-theme="light"] .report-controls-bar {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .report-control-select,
[data-theme="light"] .report-control-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .executive-report-sheet {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .report-header-section {
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .report-brand-title h2 {
  color: #0f172a !important;
}

[data-theme="light"] .report-meta-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .report-meta-box strong {
  color: #0f172a !important;
}

[data-theme="light"] .report-kpi-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .report-kpi-card .kpi-label {
  color: #475569 !important;
}

[data-theme="light"] .report-kpi-card .kpi-sub {
  color: #64748b !important;
}

[data-theme="light"] .report-insights-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 100%) !important;
  border-color: #86efac !important;
}

[data-theme="light"] .report-insights-box h4 {
  color: #065f46 !important;
}

[data-theme="light"] .report-insights-list p {
  color: #1e293b !important;
  border-left-color: #10b981 !important;
}

[data-theme="light"] .report-insights-list p strong {
  color: #0f172a !important;
}

[data-theme="light"] .report-sub-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .report-table-header h4 {
  color: #0f172a !important;
}

[data-theme="light"] .report-table-count {
  color: #475569 !important;
}

[data-theme="light"] .report-footer-section {
  border-top-color: #e2e8f0 !important;
  color: #64748b !important;
}

[data-theme="light"] .report-footer-brand {
  color: #334155 !important;
}

/* ==========================================================================
   LOW-HANGING FRUIT & STRIKING DISTANCE OPPORTUNITY SYSTEM
   ========================================================================== */

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

.kw-filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kw-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-glass-bright);
}

.kw-filter-pill.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--radar-cyan);
  border-color: var(--radar-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.kw-filter-pill[data-filter="lowhanging"].active {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #f59e0b !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3) !important;
}

/* Opportunity Badges */
.table-opportunity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.table-opportunity-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

.badge-opp-page1 {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.badge-opp-page2 {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-opp-champion {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-opp-growth {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-opp-unranked {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

/* Playbook Checklists */
.playbook-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.playbook-check-item .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  color: var(--radar-cyan);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   PROGRESSIVE WEB APP (PWA) & MODERN MOBILE INTERFACE ARCHITECTURE
   ========================================================================== */

/* 1. Safe Area Insets & Modern Viewport Variables */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --mobile-nav-height: 64px;
}

/* Touch Ergonomics & Input Zoom Prevention */
@media (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  button, a, input, select {
    touch-action: manipulation;
  }
}

/* 2. Mobile Top Bar Enhancements */
.mobile-top-bar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + var(--sat)) 16px 10px;
    margin: 0 0 12px 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: none;
    z-index: 50;
    position: sticky;
    top: 0;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(7, 11, 20, 0.82);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-install-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(56, 189, 248, 0.15));
    border: 1px solid var(--radar-cyan);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
    transition: all var(--transition-fast);
  }

  .btn-install-pill:active {
    transform: scale(0.95);
  }

  .mobile-network-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .mobile-network-status .status-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--radar-emerald);
    box-shadow: 0 0 8px var(--radar-emerald);
    transition: background 0.3s;
  }

  .mobile-network-status.offline .status-indicator-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
  }

  .mobile-network-status.offline .status-indicator-label {
    color: #f59e0b;
  }
}

/* 3. Modern Native-App-like Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--mobile-nav-height) + var(--sab));
    padding: 6px 8px calc(6px + var(--sab));
    background: rgba(7, 11, 20, 0.92);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    z-index: 100;
  }

  /* Padding at bottom of content to never collide with bottom navigation */
  .app-main-content {
    padding: 10px 12px calc(var(--mobile-nav-height) + var(--sab) + 24px) !important;
  }

  .app-footer {
    margin-bottom: calc(var(--mobile-nav-height) + var(--sab) + 12px) !important;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-icon-wrap {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-icon-wrap .icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.mobile-nav-item:active .mobile-nav-icon-wrap {
  transform: scale(0.9);
}

.mobile-nav-item.active {
  color: var(--radar-cyan);
}

.mobile-nav-item.active .mobile-nav-icon-wrap {
  background: rgba(6, 182, 212, 0.16);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

.mobile-nav-item.active .mobile-nav-icon-wrap .icon {
  stroke: var(--radar-cyan);
  transform: translateY(-1px);
}

.mobile-nav-item.active .mobile-nav-label {
  color: #ffffff;
  font-weight: 700;
}

/* 4. Native Bottom-Sheet Modals for Small Screens */
.sheet-drag-handle-bar {
  display: none;
}

@media (max-width: 768px) {
  .modal-backdrop {
    align-items: flex-end !important;
    justify-content: center;
    padding: 0;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 88dvh !important;
    margin: 0 !important;
    border-bottom: none !important;
    padding-bottom: calc(16px + var(--sab)) !important;
    animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8) !important;
  }

  @keyframes sheetSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .sheet-drag-handle-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 4px;
    width: 100%;
    cursor: grab;
  }

  .sheet-drag-notch {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-full);
  }

  .modal-body {
    max-height: calc(88dvh - 120px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* 5. Mobile Quick Action Sheet ("More" Menu) */
.mobile-more-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px;
}

.more-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.more-action-card:active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(0.98);
}

.more-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.more-text-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.more-text-box strong {
  font-size: 0.95rem;
  color: #ffffff;
}

.more-text-box span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.mobile-app-info-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.mobile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.mobile-info-row .info-label {
  color: var(--text-muted);
}

.mobile-info-row .info-val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 600;
}

.status-online-pill {
  color: var(--radar-emerald) !important;
}

/* 6. Floating PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 420px;
  width: calc(100% - 48px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(6, 182, 212, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(7, 11, 20, 0.95) 100%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.2);
  animation: pwaBannerFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

@media (max-width: 900px) {
  .pwa-install-banner {
    bottom: calc(var(--mobile-nav-height) + var(--sab) + 12px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    padding: 12px 14px;
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pwa-banner-icon-box {
  flex-shrink: 0;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-banner-text .banner-title {
  font-size: 0.9rem;
  color: #ffffff;
}

.pwa-banner-text .banner-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

/* 7. iOS Add to Home Screen Modal */
.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ios-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ios-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  color: var(--radar-cyan);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 8. Modern Responsive Mobile Card Transformation for Tables */
@media (max-width: 768px) {
  /* Convert flat horizontal table into dynamic stacked mobile cards */
  .table-responsive {
    overflow-x: visible;
  }

  .radar-table thead {
    display: none;
  }

  .radar-table,
  .radar-table tbody,
  .radar-table tr,
  .radar-table td {
    display: block;
    width: 100%;
  }

  .radar-table tr {
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    position: relative;
    transition: transform var(--transition-fast);
  }

  .radar-table tr:active {
    transform: scale(0.99);
  }

  .radar-table td {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
  }

  .radar-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
  }

  .radar-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-right: 12px;
  }

  /* First cell (Keyword) header row highlight */
  .radar-table td:first-child {
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 10px;
    margin-bottom: 6px;
  }

  .radar-table td:first-child::before {
    display: none;
  }
}

/* 9. Standalone PWA Window Polish */
@media (display-mode: standalone) {
  body {
    user-select: none;
    -webkit-user-select: none;
  }

  /* Make sure text fields remain selectable */
  input, textarea {
    user-select: text;
    -webkit-user-select: text;
  }

  .mobile-top-bar {
    padding-top: calc(14px + var(--sat));
  }
}

/* 10. Database Resilience & Backup Styles */
.db-resilience-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 18px;
}

.db-resilience-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-resilience-title-row h4 {
  margin: 0;
  color: #10b981;
  font-weight: 700;
  font-size: 0.98rem;
}

.db-resilience-icon {
  font-size: 1.15rem;
}

.db-resilience-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.db-resilience-desc code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--radar-cyan);
}

.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.db-stat-pill {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.db-stat-pill:hover {
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.db-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 4px;
}

.db-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.text-cyan {
  color: var(--radar-cyan) !important;
}

.text-emerald {
  color: #10b981 !important;
}

.text-amber {
  color: #f59e0b !important;
}

.db-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-emerald-outline {
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08) !important;
}

.btn-emerald-outline:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: #10b981 !important;
}

.btn-restore-label {
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Light Mode Overrides for Database Card */
[data-theme="light"] .db-resilience-card {
  background: #f0fdf4;
  border-color: #86efac;
}

[data-theme="light"] .db-resilience-title-row h4 {
  color: #047857;
}

[data-theme="light"] .db-resilience-desc {
  color: #374151;
}

[data-theme="light"] .db-resilience-desc code {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .db-stat-pill {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .db-stat-label {
  color: #64748b;
}

[data-theme="light"] .db-stat-val {
  color: #0f172a;
}

[data-theme="light"] .text-cyan {
  color: #0891b2 !important;
}

[data-theme="light"] .text-emerald {
  color: #059669 !important;
}

[data-theme="light"] .text-amber {
  color: #d97706 !important;
}

[data-theme="light"] .btn-emerald-outline {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}

@media (max-width: 640px) {
  .db-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Universal High-Contrast Light Mode Overrides for Tables & Keywords
   ========================================================================== */
[data-theme="light"] .keywords-table-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .keywords-table-toolbar {
  background: #ffffff !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .keywords-table-title {
  color: #0f172a !important;
}

[data-theme="light"] .kw-search-input {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .kw-search-input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .select-trend-filter {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .radar-table th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-bottom: 2px solid #cbd5e1 !important;
  border-top: 1px solid #e2e8f0 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .radar-table td {
  background: #ffffff !important;
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .radar-table tr:hover td {
  background: #f8fafc !important;
}

[data-theme="light"] .kw-title-cell {
  color: #0f172a !important;
}

[data-theme="light"] .badge-tag {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .kw-cell-visibility {
  color: #0f172a !important;
}

[data-theme="light"] .kw-cell-serp-features {
  color: #334155 !important;
}

[data-theme="light"] .kw-cell-muted {
  color: #64748b !important;
}

[data-theme="light"] .btn-delete-kw {
  color: #dc2626 !important;
}

[data-theme="light"] .btn-delete-kw:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

/* Light Mode Filter Pills */
[data-theme="light"] .kw-filter-pill {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .kw-filter-pill:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-theme="light"] .kw-filter-pill.active {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .kw-filter-pill.pill-lowhanging {
  border-color: #fcd34d !important;
  color: #b45309 !important;
}

[data-theme="light"] .kw-filter-pill.pill-lowhanging.active {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.25) !important;
}

[data-theme="light"] .kw-filter-pill.pill-top3.active {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #16a34a !important;
}

[data-theme="light"] .kw-filter-pill.pill-page2.active {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border-color: #9333ea !important;
}

[data-theme="light"] .kw-filter-pill.pill-unranked.active {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #64748b !important;
}

/* Light Mode Rank Badges */
[data-theme="light"] .rank-top1 {
  color: #d97706 !important;
  text-shadow: none !important;
}

[data-theme="light"] .rank-top3 {
  color: #059669 !important;
}

[data-theme="light"] .rank-top10 {
  color: #0284c7 !important;
}

[data-theme="light"] .rank-page2 {
  color: #7c3aed !important;
}

[data-theme="light"] .rank-out {
  color: #64748b !important;
}

/* Light Mode Intent Badges */
[data-theme="light"] .badge-intent-informational {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

[data-theme="light"] .badge-intent-commercial {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

[data-theme="light"] .badge-intent-transactional {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="light"] .badge-intent-navigational {
  background: #faf5ff !important;
  color: #6b21a8 !important;
  border-color: #e9d5ff !important;
}

/* Light Mode Opportunity Badges */
[data-theme="light"] .badge-opp-champion {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

[data-theme="light"] .badge-opp-page1 {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fcd34d !important;
}

[data-theme="light"] .badge-opp-page2 {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border-color: #d8b4fe !important;
}

[data-theme="light"] .badge-opp-growth {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
}

[data-theme="light"] .badge-opp-unranked {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
}

/* Light Mode Badge Success */
[data-theme="light"] .badge-success {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

/* Light Mode History Item */
[data-theme="light"] .history-item {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .history-item:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
}

/* Light Mode Local Pack Card */
[data-theme="light"] .local-pack-item-card {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  padding: 10px !important;
  border-radius: 8px !important;
}

