/* Site Mechanic - Terminal Style CSS */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Visible focus states (keyboard) */
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(91, 244, 231, 0.3));
}

/* Legacy accordion enhancement: injected real <button> inside .accordion-header containers */
.accordion-header__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.accordion-header__button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(91, 244, 231, 0.3));
  border-radius: inherit;
}

/* Font imports with optimal font-display */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Text&family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ===================================================================
   GLOBAL HEADING STYLES - DM Serif Text
   =================================================================== */
:root {
  --font-serif: 'DM Serif Text', Georgia, serif;
}

/* Only page-header__title uses DM Serif Text */
.page-header__title {
  font-family: var(--font-serif) !important;
  font-weight: 400 !important;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.page-header__intro {
  max-width: 680px;
  margin: 0.5rem 0 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.925rem;
  line-height: 1.6;
  text-align: left;
}

/* ===================================================================
   UNIFIED COLOR SYSTEM - Dark & Light Themes
   =================================================================== */

/* DARK THEME (Default) */
:root {
  /* Font Size Control - Dynamic multiplier */
  --font-size-multiplier: 1.0;
  --base-font-size: 16px; /* 15–16px base for readability */
  --app-title-size: 1.75rem; /* Keep header title consistent across pages */
  
  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-hover: #222222;
  --bg-input: #0a0a0a;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #d0d0d0;
  --text-tertiary: #a0a0a0;
  --text-muted: #808080;
  
  /* Accent Colors */
  --accent-primary: #5bf4e7;      /* Cyan - primary actions (dark mode) */
  --accent-primary-dark: #4dd8cc;
  --accent-primary-rgb: 91, 244, 231;
  --accent-primary-contrast: #000000;
  --accent-secondary: #5bf4e7;    /* Cyan - secondary actions (no purple in dark mode) */
  --accent-secondary-dark: #4dd8cc;
  
  /* Status Colors */
  --status-success: var(--accent-primary);
  --status-warning: #ffa500;
  --status-error: #ff4444;
  --status-info: #00d9ff;
  
  /* Border Colors */
  --border-primary: #333333;
  
  /* Component-specific */
  --donut-track: rgba(255, 255, 255, 0.08);
  --border-secondary: #555555;
  --border-accent: #5bf4e7;
  
  /* Semantic Colors */
  --score-excellent: var(--accent-primary);     /* 90-100 */
  --score-good: #00d9ff;          /* 70-89 */
  --score-fair: #ffa500;          /* 50-69 */
  --score-poor: #ff4444;          /* 0-49 */
  
  /* Shadow & Effects */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.6);
  --shadow-2xl: 0 20px 40px rgba(0, 0, 0, 0.7);
  --glow-primary: 0 0 10px rgba(91, 244, 231, 0.5);
  --glow-secondary: 0 0 10px rgba(187, 134, 252, 0.5);
  --focus-ring: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.3);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  
  /* Spacing Scale (Swiss grid: 4/8/12/16/24/32) */
  --spacing-xs: 0.5rem;    /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 1.5rem;    /* 24px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 3rem;      /* 48px */
  --spacing-2xl: 4rem;     /* 64px */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;

  /* Typography - Swiss Style (Inter) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Text Colors (charcoal feel, not pure black/white) */
  --text-body: #e8e8e8;           /* Slightly softer than pure white */
  --text-heading: #ffffff;
  --text-label: #a0a0a0;

  /* Tighter Line Heights (Swiss style) */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  /* Surface & Card */
  --surface-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);

  /* Progress Bar Colors */
  --progress-bg: #1a1a1a;
  --progress-border: #404040;
  --text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* LIGHT THEME */
body.white-theme {
  /* Force background change with !important */
  background-color: #ffffff !important;
  color: #262626 !important;
  
  /* Background Colors - Better visual hierarchy */
  --bg-base: #ffffff;          /* FIX: Override layout.css background */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;     /* Softer secondary background */
  --bg-tertiary: #f1f3f5;      /* Clear tertiary level */
  --bg-hover: #e9ecef;         /* Visible hover state */
  --bg-input: #ffffff;         /* White inputs for better contrast */
  --bg-card: #ffffff;          /* Card background for light mode */
  --bg-elevated: #f8f9fa;      /* Elevated surfaces for light mode */
  
  /* Text Colors - WCAG AA compliant (4.5:1 contrast) */
  --color-white: #262626;      /* Override any tokens that assume white text */
  --text-primary: #262626;     /* Body/title text */
  --text-secondary: #404040;   /* Secondary text */
  --text-tertiary: #6b7280;    /* Muted text */
  --text-muted: #9ca3af;       /* Subtle/helper text */
  
  /* Accent Colors - Brand red for light mode */
  --accent-primary: #dd3838;      /* Brand red for better contrast */
  --accent-primary-dark: #c52f2f;
  --accent-primary-rgb: 221, 56, 56;
  --accent-primary-contrast: #ffffff;
  --accent-secondary: #6d28d9;    /* Darker purple for accessibility (5.2:1) */
  --accent-secondary-dark: #5b21b6;
  
  /* Status Colors - WCAG compliant */
  --status-success: var(--accent-primary);
  --status-warning: #d97706;   /* Orange (4.5:1) */
  --status-error: #c92a2a;     /* Red (5.1:1) */
  --status-info: #0c7792;      /* Teal (4.5:1) */
  
  /* Border Colors - Clear definition */
  --border-primary: #dee2e6;   /* Softer primary border */
  --border-secondary: #ced4da; /* Clear secondary border */
  --border-accent: #dd3838;
  
  /* Component-specific */
  --donut-track: rgba(0, 0, 0, 0.1);
  
  /* Semantic Colors - Score indicators */
  --score-excellent: var(--accent-primary);
  --score-good: #0c7792;       /* Accessible teal */
  --score-fair: #d97706;       /* Accessible orange */
  --score-poor: #c92a2a;       /* Accessible red */
  
  /* Shadow & Effects - Subtle depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --glow-primary: 0 0 0 3px rgba(221, 56, 56, 0.15);
  --glow-secondary: 0 0 0 3px rgba(109, 40, 217, 0.15);
  --focus-ring: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.3);
  
  /* Border Radius (same as dark theme) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  
  /* Spacing (same as dark theme) */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Progress Bar Colors - Light theme specific */
  --progress-bg: #f0f0f0;
  --progress-border: #d0d0d0;
  --text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ============================================
   DARK MODE PRIMARY BUTTON OVERRIDES
   Ensure cyan (#5bf4e7) is used for all primary actions
   ============================================ */

body:not(.white-theme) {
  --color-primary: #5bf4e7 !important;
  --color-primary-hover: #4dd8cc !important;
}

/* Primary buttons in dark mode - cyan background with black text */
body:not(.white-theme) .btn-primary-sm,
body:not(.white-theme) .continue-card__btn--primary,
body:not(.white-theme) .site-group__btn--view,
body:not(.white-theme) .account-btn--primary,
body:not(.white-theme) [class*="btn--primary"],
body:not(.white-theme) [class*="btn--featured"],
body:not(.white-theme) .hero-form__submit {
  background: #5bf4e7 !important;
  background-color: #5bf4e7 !important;
  color: #000000 !important;
  border-color: #5bf4e7 !important;
}

body:not(.white-theme) .btn-primary-sm:hover,
body:not(.white-theme) .continue-card__btn--primary:hover,
body:not(.white-theme) .site-group__btn--view:hover,
body:not(.white-theme) .account-btn--primary:hover,
body:not(.white-theme) [class*="btn--primary"]:hover,
body:not(.white-theme) [class*="btn--featured"]:hover,
body:not(.white-theme) .hero-form__submit:hover {
  background: #4dd8cc !important;
  background-color: #4dd8cc !important;
  color: #000000 !important;
}

/* ============================================
   PROGRESS BAR PROTECTION - LIGHT THEME
   Prevent progress bars from being overridden
   ============================================ */

/* Force progress bars to work using SOLID COLORS (no gradients to override) */

/* The progress bar track (gray container) */
body.white-theme .seo-progress-track {
  background: #f0f0f0 !important;
  background-color: #f0f0f0 !important;
  border: 2px solid #d0d0d0 !important;
}

/* The colored progress fills - SOLID COLORS */
.seo-progress-fill[data-color="#00ff41"] {
  background: var(--accent-primary) !important;
  background-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.4) !important;
}

body.white-theme .seo-progress-fill[data-color="#00ff41"] {
  background: var(--accent-primary) !important;
  background-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.4) !important;
}

body.white-theme .seo-progress-fill[data-color="#ffd700"] {
  background: #ffd700 !important;
  background-color: #ffd700 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4) !important;
}

body.white-theme .seo-progress-fill[data-color="#ff8c00"] {
  background: #ff8c00 !important;
  background-color: #ff8c00 !important;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.4) !important;
}

body.white-theme .seo-progress-fill[data-color="#ff4444"] {
  background: #ff4444 !important;
  background-color: #ff4444 !important;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.4) !important;
}

/* Ensure the shimmer effect works */
body.white-theme .seo-progress-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%) !important;
  pointer-events: none !important;
}

/* ============================================
   UNIVERSAL LIGHT THEME DARK BACKGROUND FIX
   Catches all remaining dark backgrounds
   ============================================ */

/* NUCLEAR OPTION: Override ALL dark backgrounds with extreme specificity */
body.white-theme * {
  /* This will be overridden by more specific rules below if needed */
}

/* Target ALL elements with inline dark backgrounds */
body.white-theme *[style*="background"] {
  /* Reset dark backgrounds - will be overridden if inline style is lighter */
}

/* Force light backgrounds on common containers */
body.white-theme .section,
body.white-theme .results-container,
body.white-theme #resultsContainer,
body.white-theme #seoResults,
body.white-theme #performanceResults,
body.white-theme .summary-section {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Accordion content: only show background when expanded */
body.white-theme .accordion-content {
  background: transparent !important;
  color: #000000 !important;
}

body.white-theme .accordion-content.expanded {
  background: #ffffff !important;
}

/* Fix all divs, sections, and containers with dark backgrounds */
body.white-theme div:not(.hamburger-line):not(.progress-fill):not([class*="ring"]):not([class*="circle"]):not(.seo-progress-container):not(.seo-progress-container *),
body.white-theme section:not(.seo-progress-container):not(.seo-progress-container *),
body.white-theme main,
body.white-theme aside,
body.white-theme article {
  /* Only override if background is dark (0-50 range in hex) */
  background-color: inherit;
}

/* Specifically target common dark background patterns */
body.white-theme div[style*="background:#000"],
body.white-theme div[style*="background: #000"],
body.white-theme div[style*="background-color:#000"],
body.white-theme div[style*="background-color: #000"],
body.white-theme div[style*="background:#111"],
body.white-theme div[style*="background: #111"],
body.white-theme div[style*="background:#1a1a1a"],
body.white-theme div[style*="background: #1a1a1a"],
body.white-theme div[style*="background:#0f0f0f"],
body.white-theme div[style*="background: #0f0f0f"],
body.white-theme section[style*="background:#000"],
body.white-theme section[style*="background-color:#000"] {
  background: #f8f9fa !important;
  background-color: #f8f9fa !important;
  color: #000000 !important;
  border: 1px solid #e0e0e0 !important;
}

/* Fix any text that's hard to read */
body.white-theme [style*="color:#888"],
body.white-theme [style*="color: #888"],
body.white-theme [style*="color:#999"],
body.white-theme [style*="color: #999"],
body.white-theme [style*="color:#aaa"],
body.white-theme [style*="color: #aaa"],
body.white-theme [style*="color:#bbb"],
body.white-theme [style*="color: #bbb"],
body.white-theme [style*="color:#ccc"],
body.white-theme [style*="color: #ccc"],
body.white-theme [style*="color:#ddd"],
body.white-theme [style*="color: #ddd"],
body.white-theme [style*="color:#e0e0e0"],
body.white-theme [style*="color: #e0e0e0"] {
  color: var(--text-tertiary) !important;
}

/* JetBrains Mono Font - using Google Fonts CDN */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* Base body styling - Swiss typography (Inter) */
html {
  background-color: #000000;
}

html.white-theme {
  background-color: #ffffff;
}

body {
  font-family: var(--font-sans, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
  color: var(--text-body, var(--text-primary));
  line-height: var(--leading-snug, 1.35);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Dynamic font size using multiplier */
  font-size: calc(var(--base-font-size) * var(--font-size-multiplier));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Flexbox for sticky footer */
  display: flex;
  flex-direction: column;
}

/* Subtle background graphic (optional)
   Place the PNG at: src/public/assets/images/tools-background.png
   Served as: /assets/images/tools-background.png
*/
:root {
  --bg-graphic-url: url('/assets/images/tools-background.png');
  --bg-graphic-opacity: 0.07;
  --bg-graphic-size: min(1100px, 92vw) auto;
  --bg-graphic-position: center 18vh;
  --graph-paper-major: rgba(148, 163, 184, 0.22);
  --graph-paper-minor: rgba(148, 163, 184, 0.12);
  --graph-paper-major-size: 28px;
  --graph-paper-minor-size: 7px;
  --graph-paper-opacity: 0.35;
}

body.white-theme {
  --bg-graphic-opacity: 0.045;
  --graph-paper-major: rgba(148, 163, 184, 0.28);
  --graph-paper-minor: rgba(148, 163, 184, 0.16);
  --graph-paper-opacity: 0.4;
}

/* Stronger graph paper on CRO analyzer page */
body[data-sm-analyzer-key="cro-analysis"] {
  --graph-paper-major: rgba(148, 163, 184, 0.35);
  --graph-paper-minor: rgba(148, 163, 184, 0.2);
  --graph-paper-opacity: 0.55;
  --graph-paper-major-size: 26px;
  --graph-paper-minor-size: 6px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--bg-graphic-url);
  background-repeat: no-repeat;
  background-position: var(--bg-graphic-position);
  background-size: var(--bg-graphic-size);
  opacity: var(--bg-graphic-opacity);
  filter: grayscale(100%);
  z-index: 0;
}

/* Graph paper background overlay (all pages) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--graph-paper-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--graph-paper-major) 1px, transparent 1px),
    linear-gradient(to right, var(--graph-paper-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--graph-paper-minor) 1px, transparent 1px);
  background-size:
    var(--graph-paper-major-size) var(--graph-paper-major-size),
    var(--graph-paper-major-size) var(--graph-paper-major-size),
    var(--graph-paper-minor-size) var(--graph-paper-minor-size),
    var(--graph-paper-minor-size) var(--graph-paper-minor-size);
  background-position: 0 0, 0 0, 0 0, 0 0;
  opacity: var(--graph-paper-opacity);
  z-index: 0;
}

/* Ensure content paints above the background layer */
.container,
main,
footer,
.site-footer-bar {
  position: relative;
  z-index: 1;
}

/* Nav placeholder needs high z-index so dropdowns appear above page content */
#nav-placeholder {
  position: relative;
  z-index: 10000;
}

/* Header needs higher z-index so dropdowns appear above page content */
header {
  position: relative;
  z-index: 9999;
}

/* Dark mode background (when white-theme class is NOT present) */
body:not(.white-theme) {
  background-color: #000000 !important;
  background: #000000 !important;
}

/* Dark mode links: prevent default visited-purple and keep links on-brand */
body:not(.white-theme) a:not(.btn):not(.nav-link):not(.action-card-button) {
  color: var(--accent-primary);
  text-decoration-color: rgba(var(--accent-primary-rgb), 0.7);
}

body:not(.white-theme) a:not(.btn):not(.nav-link):not(.action-card-button):visited {
  color: var(--accent-primary);
}

body:not(.white-theme) a:not(.btn):not(.nav-link):not(.action-card-button):hover {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.site-footer-bar {
  position: static;
  width: 100%;
  margin-top: auto; /* Push to bottom of viewport */
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #f8fbff;
  padding: 0.65rem 1.75rem;
  font-size: 0.85rem;
  text-align: left;
  border-top: 1px solid rgba(94, 243, 154, 0.3);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  max-width: 100%;
}

.footer-text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.footer-theme-toggle {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  width: 32px;
  height: 32px;
  padding: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5ef39a;
  box-shadow: none;
}

.footer-theme-toggle:hover {
  background: transparent;
  border: none;
  transform: scale(1.05);
  opacity: 0.8;
}

.footer-theme-toggle:active {
  transform: scale(0.95);
}

.footer-theme-toggle .theme-icon {
  display: block;
}

.site-footer-link {
  color: #5ef39a;
  text-decoration: none;
  font-weight: 600;
}

.site-footer-link:hover,
.site-footer-link:focus {
  text-decoration: underline;
}

body.white-theme .site-footer-bar {
  background: linear-gradient(135deg, #ffffff 0%, #e8f4ff 100%);
  color: #0b1f33;
  border-top: 1px solid rgba(15, 55, 105, 0.2);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.15);
  text-shadow: none;
}

body.white-theme .site-footer-link {
  color: #0b7a4d;
  text-decoration-color: rgba(11, 122, 77, 0.5);
}

body.white-theme .footer-theme-toggle {
  background: transparent;
  border: none;
  color: #0b7a4d;
  box-shadow: none;
}

body.white-theme .footer-theme-toggle:hover {
  background: transparent;
  border: none;
  opacity: 0.8;
}

.site-footer-bar strong {
  font-weight: 700;
}

/* Headings - Swiss typography (Inter, tighter line-height) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: var(--leading-tight, 1.2);
  letter-spacing: var(--tracking-tight, -0.02em);
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 var(--space-16, 1rem) 0;
  color: var(--text-primary);
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: var(--space-24, 1.5rem) 0 var(--space-12, 0.75rem) 0;
  color: var(--text-primary);
}

h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: var(--space-16, 1rem) 0 var(--space-8, 0.5rem) 0;
  color: var(--text-primary);
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--space-12, 0.75rem) 0 var(--space-8, 0.5rem) 0;
  color: var(--text-secondary);
}

h5 {
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-8, 0.5rem) 0;
  color: var(--text-secondary);
}

h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: var(--space-8, 0.5rem) 0;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, 0.02em);
}

.container {
  max-width: 1200px;
  margin: 0;
  margin-top: 3rem !important;
  padding: 2rem;
  padding-top: 3rem !important;
  text-align: left;
}

/* Paragraphs and general text - Swiss style (tighter) */
p {
  font-size: 1rem;
  line-height: var(--leading-snug, 1.35);
  margin: 0 0 var(--space-12, 0.75rem) 0;
}

/* List items - Swiss style */
li {
  font-size: 1rem;
  line-height: var(--leading-snug, 1.35);
  margin: var(--space-4, 0.25rem) 0;
}

/* Labels and form text */
label {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* General text containers */
.text-content,
.description,
.details {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Headers - Better contrast ratios for accessibility */
h1 {
  font-size: 2.25rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1.25rem 0;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-secondary);
  padding-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1rem 0 0.75rem 0;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

h4 {
  font-size: 0.975rem;
  font-weight: 500;
  margin: 1rem 0 0.5rem 0;
  color: var(--text-secondary);
}

/* Paragraphs and text - Better contrast (minimum 4.5:1) */
p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Theme Toggle Button - Accessible with proper contrast */
/* ===== UNIFIED HEADER SYSTEM ===== */

:root {
  --unified-header-height: 108px;
  --nav-bar-height: 60px;
  --app-logo-height: clamp(44px, 3vw, 56px);
}

/* Main Header Bar - Contains all top controls */
.unified-header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  height: var(--unified-header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.5rem;
  gap: 1rem;
  box-sizing: border-box;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow: visible; /* Allow dropdowns to overflow header */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Left section - Font size controls */
.unified-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Center section - App title and subtitle (left-aligned) */
.unified-header-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  text-align: left;
  min-width: 0; /* Allow text truncation */
}

/* App Logo - Theme-aware SVG logo */
.app-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  text-decoration: none;
}

.app-logo {
  height: var(--app-logo-height);
  width: auto;
  max-width: 100%;
  display: block;
}

/* Theme-aware logo switching */
.app-logo-dark {
  display: block;
}
.app-logo-light {
  display: none;
}

/* Light mode: show light logo, hide dark logo */
body.white-theme .app-logo-dark {
  display: none;
}
body.white-theme .app-logo-light {
  display: block;
}

.app-title {
  font-size: var(--app-title-size, 1.25rem);
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.app-subtitle {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  margin: 0.125rem 0 0 0;
  line-height: 1.2;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  text-align: left;
}

/* Right section - Language selector + Theme toggle */
.unified-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  position: relative;
  overflow: visible; /* Allow dropdowns to overflow */
}

/* Language selector container in header */
.language-selector-header {
  display: flex;
  align-items: center;
}

.language-selector-header select {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 36px;
}

.language-selector-header select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Theme Toggle - Half circle icon */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-primary);
  border: none;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle .theme-icon {
  width: 28px;
  height: 28px;
}

.theme-toggle:hover,
.theme-toggle:focus {
  opacity: 0.7;
  transform: scale(1.1);
}

.theme-toggle:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Header Theme Toggle - Visible on desktop, hidden on mobile */
.header-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: var(--text-primary);
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-theme-toggle .theme-icon {
  width: 28px;
  height: 28px;
}

.header-theme-toggle:hover,
.header-theme-toggle:focus {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 0.7;
  transform: scale(1.1);
}

.header-theme-toggle:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Ensure the header theme toggle never picks up generic button chrome */
#headerThemeToggle,
#headerThemeToggle:hover,
#headerThemeToggle:focus,
#headerThemeToggle:active {
  border: none !important;
  box-shadow: none !important;
}

/* Hamburger Menu Button - Hidden on desktop, visible on mobile */
.hamburger-btn {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 5001;
  transition: all 0.3s ease;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2147483646 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  isolation: isolate;
}

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

/* Mobile Navigation Drawer */
.mobile-nav {
  display: flex;
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary, #0a0a0a);
  border-right: 1px solid var(--border-primary, #1a1a1a);
  z-index: 2147483647 !important;
  overflow: hidden;
  transition: left 0.3s ease;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
  flex-direction: column;
  visibility: hidden;
  isolation: isolate;
}

.mobile-nav.active {
  left: 0;
  visibility: visible;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.mobile-nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-nav-close {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.mobile-nav-close:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
}

.mobile-nav-items {
  position: relative;
  padding: 0.5rem 0;
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: inherit;
  z-index: inherit;
}

.mobile-nav-items .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  background: transparent;
}

.mobile-nav-items .nav-link:hover {
  background: var(--bg-hover);
  border-left-color: var(--accent-primary);
}

.mobile-nav-items .nav-link.active {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.mobile-nav-items .nav-icon {
  font-size: 1.25rem;
}

.mobile-nav-items .hot-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Mobile Navigation Collapsible Sections */
.mobile-nav-section {
  border-bottom: 1px solid var(--border-primary);
}

.mobile-nav-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mobile-nav-section-header:hover {
  background: var(--bg-hover);
}

.mobile-nav-section-header:active {
  background: var(--bg-tertiary);
}

.mobile-nav-section-icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

.mobile-nav-section-label {
  flex: 1;
}

.mobile-nav-section-arrow {
  transition: transform 0.3s ease;
  opacity: 0.6;
  flex-shrink: 0;
}

.mobile-nav-section-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s 0.3s;
  background: var(--bg-secondary);
  opacity: 0;
  visibility: hidden;
}

.mobile-nav-section[aria-expanded="true"] .mobile-nav-section-items,
.mobile-nav-section-header[aria-expanded="true"] ~ .mobile-nav-section-items {
  opacity: 1;
  visibility: visible;
  transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s 0s;
}

.mobile-nav-section-items .nav-link {
  padding-left: 3rem; /* Indent items under section */
  padding-right: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px; /* Ensure touch-friendly height */
}

.mobile-nav-section-items .nav-link > span:not(.hot-badge):not(.nav-icon) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav-section-items .hot-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Mobile Navigation Footer */
.mobile-nav-footer {
  flex-shrink: 0;
  padding: 1rem;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  margin-bottom: 0;
}

.mobile-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: none;
}

.mobile-theme-toggle:hover {
  background: transparent;
  opacity: 0.8;
  transform: translateY(-1px);
}

.mobile-theme-toggle .theme-icon {
  font-size: 1.25rem;
}

.mobile-theme-toggle .theme-label {
  flex: 1;
  text-align: left;
}

/* Navigation Wrapper - Wrapping layout */
.nav-wrapper {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 4500;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Hide scroll buttons - using wrap instead */
.nav-scroll-btn {
  display: none;
}

/* Top Navigation Bar - Wrapping flexbox */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  background: var(--bg-secondary);
  padding: 0.375rem 1rem;
  width: 100%;
  box-sizing: border-box;
  overflow: visible; /* Allow dropdowns to overflow */
}

/* Ensure dropdowns, selects, and translation widgets appear above navigation and header */
select,
.goog-te-combo,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-menu-frame,
.goog-te-menu-frame *,
.goog-te-banner-frame,
[role="combobox"],
[role="listbox"],
.skiptranslate,
.skiptranslate *,
.goog-te-menu2,
.goog-te-menu-value {
  z-index: 99999 !important;
}

/* Make sure the dropdown container itself has proper stacking */
.skiptranslate iframe,
.goog-te-menu-frame iframe {
  z-index: 100000 !important;
  position: fixed !important;
}

/* Ensure parent containers don't restrict z-index */
.unified-header,
.unified-header-right,
.unified-header-left,
.unified-header-center {
  overflow: visible !important;
}

/* Force the header to not clip children */
body > header,
#nav-placeholder,
#nav-placeholder * {
  overflow: visible !important;
}

/* Hide scrollbar but keep functionality */
.top-nav::-webkit-scrollbar {
  height: 4px;
}

.top-nav::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.top-nav::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.nav-link.active {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
}

.nav-icon {
  font-size: 1rem;
}

.nav-badge,
.hot-badge {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  animation: pro-glow 2s ease-in-out infinite;
}

@keyframes pro-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4); }
  50% { box-shadow: 0 2px 12px rgba(255, 107, 107, 0.7); }
}

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

/* Font size controls - Accessible touch targets (min 44x44px) */
/* Font Size Controls - Now in unified header */
.font-size-controls {
  display: flex;
  gap: 0.5rem;
}

.font-size-btn {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid #707070;
  padding: 0.375rem 0.625rem;
  min-width: 44px;
  min-height: 44px;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.font-size-btn:active {
  transform: scale(0.95);
}

.font-size-btn:hover,
.font-size-btn:focus {
  background: #606060;
  border-color: var(--text-muted);
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.font-size-btn.active {
  background: var(--accent-primary);
  color: var(--accent-primary-contrast);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5), 0 0 20px rgba(var(--accent-primary-rgb), 0.3);
  font-weight: 700;
  transform: scale(1.05);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5), 0 0 20px rgba(var(--accent-primary-rgb), 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.7), 0 0 30px rgba(var(--accent-primary-rgb), 0.4);
  }
}

/* Header + nav are in normal document flow (not fixed). */

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small laptops - Compact navigation */
@media (max-width: 1350px) {
  .top-nav {
    gap: 0.3rem;
    padding: 0.4rem 0.75rem; /* Reduced from 0.5rem 1rem */
  }

  .nav-link {
    padding: 6px 10px; /* Reduced from 8px 14px */
    font-size: 0.8rem; /* Reduced from 0.85rem */
    gap: 5px; /* Reduced from 6px */
  }

  .nav-icon {
    font-size: 0.95rem; /* Slightly smaller */
  }

  .nav-badge {
    font-size: 0.6rem; /* Slightly smaller */
    padding: 1px 4px; /* More compact */
  }
}

/* Medium tablets - More compact navigation */
@media (max-width: 1150px) {
  .top-nav {
    gap: 0.25rem; /* Further reduced */
    padding: 0.35rem 0.5rem; /* Further reduced */
  }

  .nav-link {
    padding: 5px 8px; /* Further reduced */
    font-size: 0.75rem; /* Further reduced */
    gap: 4px; /* Further reduced */
  }

  .nav-icon {
    font-size: 0.9rem; /* Smaller icons */
  }

  .nav-badge {
    font-size: 0.55rem; /* Smaller */
    padding: 1px 3px; /* More compact */
  }
}

/* Tablets and smaller */
@media (max-width: 1018px) {
  :root {
    --unified-header-height: 72px;
    --nav-bar-height: 0px;
    --app-logo-height: 40px;
  }

  /* Show hamburger menu */
  .hamburger-btn {
    display: flex;
    order: 1;
    flex-shrink: 0;
  }
  
  /* Hide horizontal top nav and wrapper, show mobile drawer instead */
  .nav-wrapper,
  .top-nav {
    display: none;
  }
  
  /* Enable mobile nav - starts hidden, uses flex when active */
  .mobile-nav-overlay {
    display: block;
  }

  /* Hide header theme toggle on mobile */
  .header-theme-toggle {
    display: none;
  }

  /* Show footer theme toggle on mobile */
  .footer-theme-toggle {
    display: flex;
  }

  .unified-header {
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
  }
  
  .unified-header-center {
    order: 2;
    flex: 1;
    text-align: center;
  }
  
  .app-subtitle {
    font-size: 0.65rem;
  }
  
  .unified-header-right {
    order: 3;
    flex-shrink: 0;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  :root {
    --unified-header-height: 60px;
    --nav-bar-height: 0px;
    --app-logo-height: 34px;
  }

  .hamburger-btn {
    width: 32px;
    height: 32px;
    padding: 5px;
  }
  
  .hamburger-line {
    height: 2.5px;
  }
  
  .mobile-nav {
    width: 260px;
  }
  
  .unified-header {
    padding: 0.35rem 0.5rem;
    gap: 0.5rem;
  }
  
  .app-subtitle {
    font-size: 0.6rem;
    display: none; /* Hide subtitle on very small screens */
  }

  /* Fix form container overflow on mobile */
  .form-container {
    padding-top: 1.5rem !important;
    margin-top: 1rem !important;
  }

  input[type="url"],
  input[type="text"] {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
  }

  button {
    width: 100%;
    max-width: 100%;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .hamburger-btn {
    width: 28px;
    height: 28px;
    padding: 4px;
  }
  
  .hamburger-line {
    height: 2px;
  }
  
  .mobile-nav {
    width: 240px;
  }
  
  .unified-header {
    padding: 0.3rem 0.4rem;
    gap: 0.4rem;
  }
  

}

/* Form container styling */
.form-container {
  text-align: left;
  margin-bottom: 2rem;
  padding: 2rem !important;
  margin-top: 1.5rem !important;
  background: var(--bg-card, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 12px);
}

/* Input field styling - Swiss design (Inter), accessible with proper contrast */
input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  max-width: 600px;
  padding: var(--space-12, 0.75rem) var(--space-16, 1rem);
  margin-right: 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-primary, var(--border-secondary));
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  border-radius: var(--radius-md, 8px);
  min-height: 48px;
  line-height: var(--leading-snug, 1.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--focus-ring);
}

input[type="url"]::placeholder,
input[type="text"]::placeholder {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Button styling - Swiss design (Inter), accessible touch targets */
button {
  padding: var(--space-12, 0.75rem) var(--space-24, 1.5rem);
  min-width: 48px;
  min-height: 48px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary, var(--border-secondary));
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  cursor: pointer;
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s ease;
  font-weight: 500;
  line-height: var(--leading-tight, 1.2);
}

button:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
}

button:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible {
  box-shadow: var(--focus-ring);
}

button:active {
  transform: translateY(1px);
}

/* Primary button variant */
button.btn-primary,
.btn-primary {
  background: var(--accent-primary);
  color: var(--accent-primary-contrast, #000);
  border-color: var(--accent-primary);
  font-weight: 600;
}

button.btn-primary:hover,
.btn-primary:hover {
  background: var(--accent-primary-dark);
  border-color: var(--accent-primary-dark);
}

/* Secondary button variant */
button.btn-secondary,
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

button.btn-secondary:hover,
.btn-secondary:hover {
  background: rgba(var(--accent-primary-rgb), 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Unified Analyze Button Styling - Consistent across all analyzers */
#analyzeButton,
#dashboardAnalyzeButton,
#seoAnalyzeButton,
#perfAnalyzeButton,
#cwvAnalyzeButton,
.analyze-button,
#analyzeBtn,
#scanButton {
  background-color: var(--accent-primary) !important;
  color: var(--accent-primary-contrast, #000000) !important;
  border: 2px solid var(--accent-primary) !important;
  font-weight: 600 !important;
  /* Remove conflicting inline styles */
  background: var(--accent-primary) !important;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3) !important;
}

#analyzeButton:hover,
#dashboardAnalyzeButton:hover,
#seoAnalyzeButton:hover,
#perfAnalyzeButton:hover,
#cwvAnalyzeButton:hover,
#scanButton:hover,
.analyze-button:hover,
#analyzeBtn:hover {
  background-color: var(--accent-primary-dark) !important;
  border-color: var(--accent-primary-dark) !important;
  background: var(--accent-primary-dark) !important;
  box-shadow: 0 6px 16px rgba(var(--accent-primary-rgb), 0.4) !important;
}

#analyzeButton:focus,
#dashboardAnalyzeButton:focus,
#seoAnalyzeButton:focus,
#perfAnalyzeButton:focus,
#cwvAnalyzeButton:focus,
#scanButton:focus,
.analyze-button:focus,
#analyzeBtn:focus {
  outline: 2px solid var(--accent-primary) !important;
  outline-offset: 2px !important;
}

/* Results container */
.results-container {
  margin-top: 2rem !important;
  background-color: var(--bg-primary);
}

.results-container.hidden {
  display: none !important;
}

/* Utility classes */
.hidden {
  display: none;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Section styling */
.section {
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  background-color: #0f0f0f;
  border: 1px solid #303030;
  border-radius: 6px;
}

.section h2 {
  color: var(--text-primary, #fff);
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
}

/* Summary stats styling */
.seo-summary {
  margin-top: 0.5rem;
}

.summary-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  color: var(--accent-primary);
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  color: var(--text-muted, #9ca3af);
  font-size: 0.9rem;
}

.security-summary-panel {
  position: relative;
  margin-bottom: 2rem;
  padding: 2rem;
  border: 2px solid rgba(255, 68, 68, 0.6);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(49, 10, 10, 0.95), rgba(20, 3, 3, 0.92));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 68, 68, 0.2);
  overflow: hidden;
}

.security-summary-panel::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(255, 68, 68, 0.18);
}

.security-summary-panel h2 {
  color: #ff7878;
  text-shadow: 0 0 15px rgba(255, 68, 68, 0.65);
  margin-top: 0;
}

body.white-theme .security-summary-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 240, 240, 0.9));
  border-color: rgba(210, 50, 50, 0.4);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.15);
  color: #111;
}

body.white-theme .security-summary-panel::after {
  border-color: rgba(210, 50, 50, 0.2);
  box-shadow: none;
}

body.white-theme .security-summary-panel h2 {
  color: #b00020;
  text-shadow: none;
}

/* Accordion styling */
.accordion {
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px !important;
  margin-bottom: 0.5rem !important;
  overflow: hidden !important;
}

/* Accordion Item styling (used by mobile-analyzer, etc.) */
.accordion-item {
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--bg-secondary);
}

.accordion-item .accordion-header {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
  width: 100%;
  gap: 0.75rem;
}

.accordion-item .accordion-header:hover {
  background: var(--bg-hover);
}

.accordion-item.open .accordion-header {
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-primary);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.accordion-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accordion-icon {
  font-size: 1.25rem;
}

.accordion-title {
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-score {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 70px;
  text-align: center;
}

.accordion-score.excellent {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
}

.accordion-score.good {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.accordion-score.warning {
  background: rgba(255, 140, 0, 0.15);
  color: #ff8c00;
  border: 1px solid rgba(255, 140, 0, 0.3);
}

.accordion-score.poor {
  background: rgba(255, 68, 68, 0.15);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.accordion-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-item .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: var(--bg-primary);
}

.accordion-item.open .accordion-content {
  max-height: 5000px;
}

.accordion-body {
  padding: 1.25rem;
}

/* Metric rows inside accordions */
.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-primary);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Checklist items */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.checklist-pass {
  color: var(--accent-primary);
  font-weight: bold;
}

.checklist-fail {
  color: #ff4444;
  font-weight: bold;
}

/* Issue items */
.issue-item {
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 4px;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.issue-item.issue-error,
.issue-item.issue-critical {
  background: rgba(255, 68, 68, 0.1);
  border-left: 4px solid #ff4444;
  color: #ff6b6b;
}

.issue-item.issue-warning {
  background: rgba(255, 140, 0, 0.1);
  border-left: 4px solid #ff8c00;
  color: #ffa500;
}

.issue-item.issue-info {
  background: rgba(0, 200, 255, 0.1);
  border-left: 4px solid #00c8ff;
  color: #00c8ff;
}

/* Recommendation cards */
.recommendation-card {
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 6px;
  margin: 0.75rem 0;
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid #808080;
}

.recommendation-card.critical,
.recommendation-card.error {
  background: rgba(255, 68, 68, 0.08);
  border-left-color: #ff4444;
}

.recommendation-card.high,
.recommendation-card.warning {
  background: rgba(255, 140, 0, 0.08);
  border-left-color: #ff8c00;
}

.recommendation-card.medium {
  background: rgba(255, 215, 0, 0.08);
  border-left-color: #ffd700;
}

.recommendation-card.low,
.recommendation-card.success,
.recommendation-card.info {
  background: rgba(var(--accent-primary-rgb), 0.08);
  border-left-color: var(--accent-primary);
}

/* Insight cards (similar to recommendation cards) */
.insight-card {
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 6px;
  margin: 0.75rem 0;
}

.insight-critical {
  background: rgba(255, 68, 68, 0.08);
  border-left: 4px solid #ff4444;
}

.insight-warning {
  background: rgba(255, 140, 0, 0.08);
  border-left: 4px solid #ff8c00;
}

.insight-success {
  background: rgba(var(--accent-primary-rgb), 0.08);
  border-left: 4px solid var(--accent-primary);
}

/* Standard accordion header (button style) */
.accordion-header {
  background: var(--bg-tertiary) !important;
  border: none !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  padding: 0.875rem 1.25rem !important;
  text-align: left !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  transition: background-color 0.2s ease !important;
  width: 100% !important;
}

.accordion-header:hover {
  background: var(--bg-hover) !important;
}

.accordion-header.active {
  background: #0f0f14 !important;
  color: var(--text-primary) !important;
  text-shadow: 0 0 5px rgba(var(--accent-primary-rgb), 0.5) !important;
}

.accordion-toggle {
  font-size: 1rem !important;
  font-weight: bold !important;
  color: var(--accent-primary) !important;
  text-shadow: 0 0 3px rgba(var(--accent-primary-rgb), 0.5) !important;
  transition: all 0.3s ease !important;
}

.accordion-toggle.rotated {
  transform: none !important;
}

.accordion-content {
  padding: 0;
  background: var(--bg-primary);
  border-top: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out, border-top 0.3s ease-out;
}

.accordion-content.expanded,
.accordion-item.open > .accordion-content {
  max-height: 5000px !important;
  padding: 1rem 1.25rem 1.5rem 1.75rem;
  overflow: visible;
  border-top: 1px solid #333333;
}

.accordion-content-inner {
  padding: 0;
}

/* Font group styling */
.font-group {
  margin-bottom: 2rem !important;
  padding: 1.5rem !important;
  background-color: #0f0f0f !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 4px !important;
}

.font-preview {
  margin: 1rem 0 !important;
  padding: 1rem !important;
  background-color: var(--bg-tertiary) !important;
  border: 1px solid #444444 !important;
  border-radius: 4px !important;
  position: relative !important;
}

/* Font preview text - HIGH SPECIFICITY to override body styles */
.font-preview-text {
  /* Don't set font-family here - will be set dynamically per font */
  display: block;
  color: inherit;
}

.font-weight {
  margin: 0.5rem 0 !important;
  padding: 0.5rem !important;
  background-color: var(--bg-hover) !important;
  border-radius: 2px !important;
}

/* Findings Table Styling */
.findings-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 1.5rem 0 0 !important;
  background-color: var(--bg-primary) !important;
}

.findings-table thead th {
  border: 2px solid var(--border-primary) !important;
  padding: 0.75rem !important;
  text-align: left !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.findings-table tbody td {
  border: 1px solid #222222 !important;
  padding: 0.5rem !important;
  color: #cccccc !important;
  vertical-align: middle !important;
  font-size: 0.9rem !important;
}

.findings-table tbody tr:hover {
  background-color: var(--bg-secondary) !important;
}

/* Status Box Styling */
.status-box {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 18px !important;
  text-align: center !important;
  font-size: 0.9rem !important;
  font-weight: bold !important;
  border: 1px solid !important;
  border-radius: 2px !important;
}

.status-pass {
  background-color: rgba(var(--accent-primary-rgb), 0.15) !important;
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.4) !important;
  text-shadow: 0 0 3px rgba(var(--accent-primary-rgb), 0.8) !important;
}

.status-fail {
  background-color: rgba(255, 68, 68, 0.15) !important;
  color: #ff4444 !important;
  border-color: #ff4444 !important;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.4) !important;
  text-shadow: 0 0 3px rgba(255, 68, 68, 0.8) !important;
}

.status-warning {
  background-color: rgba(255, 170, 0, 0.15) !important;
  color: #ffaa00 !important;
  border-color: #ffaa00 !important;
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.4) !important;
  text-shadow: 0 0 3px rgba(255, 170, 0, 0.8) !important;
}

.status-info {
  background-color: var(--bg-tertiary) !important;
  color: #66c6cc !important;
  border-color: #66c6cc !important;
  box-shadow: 0 0 5px rgba(102, 198, 204, 0.3) !important;
}

/* Health Summary */
.health-summary {
  background-color: #0f0f0f !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px !important;
  padding: 2rem !important;
  margin-top: 2rem !important;
}

.health-summary h3 {
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  color: var(--text-primary) !important;
}

.health-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
}

@media (max-width: 480px) {
  .health-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .health-item {
    min-width: 0 !important;
  }

  .health-indicator {
    min-width: 0 !important;
  }
}

.health-item {
  display: flex !important;
  min-width: 200px !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1rem !important;
  background-color: var(--bg-secondary) !important;
  border: 2px solid var(--border-primary) !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
}

.health-item:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.health-icon {
  font-size: 1.5rem !important;
  font-weight: bold !important;
  width: 35px !important;
  height: 35px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  border: 2px solid !important;
}

.health-text {
  flex: 1 !important;
}

.health-label {
  font-size: 0.8rem !important;
  color: #999999 !important;
  min-width: 120px !important;
  text-transform: uppercase !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.05em !important;
}

.health-value {
  font-size: 1.1rem !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  margin-bottom: 2rem !important;
}

/* Metrics grid */
.metrics-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* Score Cards */
.score-card {
  background-color: var(--bg-tertiary) !important;
  border: 2px solid var(--border-primary) !important;
  border-radius: 6px !important;
  padding: 1.5rem !important;
  transition: all 0.3s ease !important;
}

.score-card:hover {
  border-color: var(--border-secondary) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.score-card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 1rem !important;
}

.score-card-label {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #cccccc !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.score-card-icon {
  font-size: 1.5rem !important;
  font-weight: bold !important;
}

.score-card-value {
  font-size: 3rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  line-height: 1 !important;
  margin-bottom: 2rem !important;
}

.metric-content {
  flex: 1 !important;
}

.metric-value {
  font-size: 1.1rem !important;
  font-weight: bold !important;
  color: var(--text-primary) !important;
}

.health-bar {
  display: flex !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

.health-indicator {
  flex: 1 !important;
  min-width: 200px !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1rem !important;
  background-color: var(--bg-secondary) !important;
  border: 2px solid var(--border-primary) !important;
  border-radius: 4px !important;
}

.health-icon {
  font-size: 1.5rem !important;
  font-weight: bold !important;
}

.health-text {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #cccccc !important;
  text-transform: uppercase !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.05em !important;
}

/* Score-based coloring for summary metrics */
.summary-metric.score-excellent .metric-icon,
.health-indicator.health-good .health-icon {
  color: #00ff14 !important;
}

.summary-metric.score-good .metric-icon,
.health-indicator.health-warning .health-icon {
  color: #ffaa00 !important;
}

.summary-metric.score-warning .metric-icon,
.health-indicator.health-poor .health-icon {
  color: var(--status-error) !important;
}

/* WHITE THEME OVERRIDES - Main definition is at line 85, this section just handles specific elements */

body.white-theme h1,
body.white-theme h2,
body.white-theme h3,
body.white-theme h4 {
  color: var(--text-secondary) !important;
}

body.white-theme h2 {
  border-bottom-color: #cccccc !important;
}

body.white-theme p {
  color: var(--text-tertiary) !important;
}

/* Container uses the default --bg-base which is overridden in body.white-theme at line 85 */

/* Fix font size controls in white theme */
body.white-theme .font-size-btn {
  background: #e0e0e0 !important;
  color: var(--text-secondary) !important;
  border-color: #999999 !important;
}

body.white-theme .font-size-btn:hover {
  background: #d0d0d0 !important;
  border-color: #777777 !important;
}

body.white-theme .font-size-btn.active {
  background: #2563eb !important;
  color: var(--text-primary) !important;
  border-color: #1d4ed8 !important;
}

/* Fix URL input and analyze button in white theme */
body.white-theme input[type="url"],
body.white-theme input[type="text"] {
  background-color: #ffffff !important;
  border: 2px solid #ced4da !important; /* Softer border color */
  color: #1a1a1a !important;
}

body.white-theme input[type="url"]:focus,
body.white-theme input[type="text"]:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15) !important;
  outline: none;
}

body.white-theme input[type="url"]::placeholder,
body.white-theme input[type="text"]::placeholder {
  color: #6c757d !important; /* More readable placeholder (4.6:1) */
  opacity: 1;
}

/* Light Mode: Unified Analyze Button Styling */
body.white-theme #analyzeButton,
body.white-theme #dashboardAnalyzeButton,
body.white-theme #seoAnalyzeButton,
body.white-theme #perfAnalyzeButton,
body.white-theme #cwvAnalyzeButton,
body.white-theme #scanButton,
body.white-theme .analyze-button,
body.white-theme #analyzeBtn {
  background-color: var(--accent-primary) !important;
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border: 2px solid var(--accent-primary) !important;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3) !important;
}

body.white-theme #analyzeButton:hover,
body.white-theme #dashboardAnalyzeButton:hover,
body.white-theme #seoAnalyzeButton:hover,
body.white-theme #perfAnalyzeButton:hover,
body.white-theme #cwvAnalyzeButton:hover,
body.white-theme #scanButton:hover,
body.white-theme .analyze-button:hover,
body.white-theme #analyzeBtn:hover {
  background-color: var(--accent-primary-dark) !important;
  background: var(--accent-primary-dark) !important;
  border-color: var(--accent-primary-dark) !important;
  box-shadow: 0 6px 16px rgba(var(--accent-primary-rgb), 0.4) !important;
}

body.white-theme #analyzeButton:focus,
body.white-theme #dashboardAnalyzeButton:focus,
body.white-theme #seoAnalyzeButton:focus,
body.white-theme #perfAnalyzeButton:focus,
body.white-theme #cwvAnalyzeButton:focus,
body.white-theme #scanButton:focus,
body.white-theme .analyze-button:focus,
body.white-theme #analyzeBtn:focus {
  outline: 2px solid var(--accent-primary) !important;
  outline-offset: 2px !important;
}

/* Light Mode: Generic buttons (not UI kit buttons / analyze buttons)
   NOTE: UI kit buttons use `.btn` + variants (e.g. `.btn-primary`) and manage
   their own colors. Avoid overriding them here.
*/
body.white-theme button:not(.btn):not(.text-btn):not(.theme-toggle):not(.header-theme-toggle):not(#headerThemeToggle):not(.hero-form__button):not(.example-chip):not(.auth-user-trigger) {
  background-color: #f8f9fa !important; /* Light neutral background */
  color: #1a1a1a !important; /* Dark text */
  border: 2px solid #dee2e6 !important; /* Subtle border */
}

/* Exception: Buttons with inline color styles (like purple gradient buttons) keep their colors */
body.white-theme button[style*="color"] {
  color: inherit !important; /* Respect inline color for special buttons */
}

body.white-theme button:not(.btn):not(.text-btn):not(.theme-toggle):not(.header-theme-toggle):not(#headerThemeToggle):not(.hero-form__button):not(.example-chip):not(.auth-user-trigger):hover {
  background-color: #e9ecef !important; /* Slightly darker on hover */
  border-color: #adb5bd !important;
}

body.white-theme button:not(.btn):not(.text-btn):not(.theme-toggle):not(.header-theme-toggle):not(#headerThemeToggle):not(.hero-form__button):not(.example-chip):not(.auth-user-trigger):disabled {
  background-color: #e9ecef !important; /* Subtle disabled state */
  color: #6c757d !important; /* Muted but readable text */
  border-color: #dee2e6 !important;
  cursor: not-allowed;
  opacity: 0.65;
}

/* Mobile Navigation Light Theme */
body.white-theme .mobile-nav {
  background: #ffffff;
  border-right: 1px solid #dee2e6; /* Softer border */
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

body.white-theme .mobile-nav-header {
  background: #f8f9fa; /* Subtle contrast */
  border-bottom: 1px solid #dee2e6;
}

body.white-theme .mobile-nav-title {
  color: #4caf50;
}

body.white-theme .mobile-nav-close {
  color: #333;
}

body.white-theme .mobile-nav-close:hover {
  background: #e8e8e8;
  color: #4caf50;
}

body.white-theme .mobile-nav-items .nav-link {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
}

body.white-theme .mobile-nav-items .nav-link:hover,
body.white-theme .mobile-nav-items .nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

body.white-theme .mobile-nav-section {
  border-bottom: 1px solid #dee2e6;
}

body.white-theme .mobile-nav-section-header {
  color: var(--text-primary);
}

body.white-theme .mobile-nav-section-header:hover {
  background: var(--bg-hover);
}

body.white-theme .mobile-nav-section-header:active {
  background: var(--bg-tertiary);
}

body.white-theme .mobile-nav-section-items {
  background: #fafafa;
}

body.white-theme .mobile-nav-footer {
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

body.white-theme .hamburger-line {
  background: var(--text-primary);
}

/* Light Mode: Top navigation hover/active should be subtle */
body.white-theme .nav-link:hover {
  color: var(--text-primary);
}

body.white-theme .nav-link.active,
body.white-theme .nav-dropdown-trigger.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

/* Accordion Light Theme - Fix dark backgrounds */
body.white-theme .accordion {
  background: transparent !important;
  border-color: #e0e0e0 !important;
}

body.white-theme .accordion-header {
  background: #f8f9fa !important;
}

body.white-theme .accordion-item {
  background: #ffffff;
  border-color: #e0e0e0;
}

body.white-theme .accordion-item .accordion-header {
  background-color: #f8f9fa !important;
  color: #1a1a2e !important;
  border-color: #e0e0e0 !important;
}

body.white-theme .accordion-item .accordion-header:hover,
body.white-theme .accordion-item.open .accordion-header {
  background-color: #f0f0f0 !important;
}

body.white-theme .accordion-item .accordion-content {
  background-color: transparent !important;
}

body.white-theme .accordion-item .accordion-content.expanded,
body.white-theme .accordion-item.open .accordion-content {
  background-color: #ffffff !important;
}

body.white-theme .accordion-item .accordion-body {
  background-color: #ffffff !important;
}

body.white-theme .accordion-title {
  color: #1a1a2e !important;
}

body.white-theme .accordion-chevron {
  color: #666 !important;
}

body.white-theme .metric-row {
  border-bottom-color: #e0e0e0;
}

body.white-theme .metric-label {
  color: #555;
}

body.white-theme .metric-value {
  color: #1a1a2e;
}

body.white-theme .accordion-header {
  background-color: #f5f5f5 !important;
  color: #000000 !important;
  border-color: #dddddd !important;
  padding: 0.875rem 1.25rem !important;
}

body.white-theme .accordion-header:hover {
  background-color: #eeeeee !important;
}

body.white-theme .accordion-header.active {
  background-color: var(--accent-primary) !important;
  color: var(--accent-primary-contrast, #ffffff) !important;
}

body.white-theme .accordion-toggle {
  color: #000000 !important;
}

body.white-theme .accordion-header.active .accordion-toggle {
  color: var(--accent-primary-contrast, #ffffff) !important;
}

body.white-theme .accordion-content {
  background-color: transparent !important;
  color: #000000 !important;
  border-color: #dddddd !important;
  border-top: none !important;
}

body.white-theme .accordion-content.expanded {
  background-color: #ffffff !important;
  border-top: 1px solid #dddddd !important;
}

body.white-theme .accordion-content * {
  color: inherit !important;
}

/* DISABLED - This rule was too aggressive and broke progress bars
   Progress bars now use class-based styling which is more reliable
body.white-theme .accordion-content div[style*="background"]:not(.breakdown-bar-fill):not(.progress-bar):not([class*="bar-fill"]):not(.seo-progress-fill):not(.seo-progress-track):not(.seo-progress-label):not(.seo-progress-shimmer),
body.white-theme .section div[style*="background"]:not(.breakdown-bar-fill):not(.progress-bar):not([class*="bar-fill"]):not(.seo-progress-fill):not(.seo-progress-track):not(.seo-progress-label):not(.seo-progress-shimmer) {
  background: transparent !important;
}
*/

/* Ensure chart containers have clean backgrounds */
body.white-theme .accordion-content > div,
body.white-theme .section > div {
  background-color: transparent !important;
}

/* Info/Alert boxes in light theme - add visible borders */
body.white-theme div[style*="border-left: 4px solid #ff6b6b"],
body.white-theme div[style*="background: rgba(255, 107, 107"] {
  background: #fff5f5 !important;
  border: 3px solid #ff6b6b !important;
  border-left-width: 5px !important;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25) !important;
}

div[style*="background: rgba(0, 255, 65"],
body.white-theme div[style*="background: rgba(0, 255, 65"] {
  background: rgba(var(--accent-primary-rgb), 0.06) !important;
  border: 3px solid var(--accent-primary) !important;
  border-left-width: 5px !important;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.25) !important;
}

/* Text colors in info boxes - more specific targeting */
body.white-theme div[style*="border-left"] p[style*="color: #ff6b6b"] {
  color: #c92a2a !important; /* Accessible red (5.1:1) */
}

body.white-theme div[style*="border-left"] p[style*="color: #e0e0e0"] {
  color: #495057 !important; /* Readable gray (7.4:1) */
}

body.white-theme div[style*="border-left"] p[style*="color: #ff8c00"] {
  color: #d97706 !important; /* Accessible orange (4.5:1) */
  font-weight: 600 !important;
}

body.white-theme div[style*="border-left"] strong {
  color: #1a1a1a !important; /* Darker for better readability */
  font-weight: 700 !important;
}

/* Competitor sections in competitive analysis */
body.white-theme .competitor-section {
  border: 2px solid #c92a2a !important; /* Accessible red */
  background: #fff5f5 !important;
  box-shadow: 0 4px 6px rgba(201, 42, 42, 0.1) !important;
}

/* Improve contrast for all text elements */
body.white-theme h1,
body.white-theme h2,
body.white-theme h3,
body.white-theme h4,
body.white-theme h5,
body.white-theme h6 {
  color: #1a1a1a !important; /* Darker for maximum readability */
  font-weight: 700 !important;
}

body.white-theme p,
body.white-theme span,
body.white-theme div,
body.white-theme label {
  color: #1a1a1a !important;
}

/* Stronger borders for sections and containers */
body.white-theme .section,
body.white-theme section,
body.white-theme .card,
body.white-theme .container > div {
  border: 1px solid #dee2e6 !important; /* Softer, more modern border */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

/* Chart containers - white background with border */
body.white-theme canvas,
body.white-theme .chart-container {
  background: #ffffff !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px !important;
  padding: 1rem !important;
}

/* Score badges and metrics - higher contrast */
body.white-theme .score,
body.white-theme .metric,
body.white-theme .badge {
  color: #000000 !important;
  font-weight: 700 !important;
  border: 2px solid #333333 !important;
}

/* Button contrast improvements */
body.white-theme .btn,
body.white-theme button:not(.text-btn):not(.theme-toggle):not(.header-theme-toggle):not(#headerThemeToggle):not(.auth-user-trigger) {
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* Competitive Analysis specific styles */
body.white-theme .status-winning {
  color: #00a000 !important;
  font-weight: 700 !important;
}

body.white-theme .status-losing {
  color: #d63031 !important;
  font-weight: 700 !important;
}

body.white-theme .status-tied {
  color: #d68000 !important;
  font-weight: 700 !important;
}

body.white-theme .stat-card,
body.white-theme .insight-card {
  background: #ffffff !important;
  border: 2px solid #d0d0d0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  color: #1a1a1a !important;
}

body.white-theme .stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  border-color: #4caf50 !important;
}

body.white-theme .your-site {
  background: #e8f5e9 !important;
  border: 2px solid #4caf50 !important;
  box-shadow: 0 2px 12px rgba(76, 175, 80, 0.3) !important;
}

body.white-theme .insight-success {
  background: #e8f5e9 !important;
  border-left: 4px solid #2e7d32 !important;
  color: #1b5e20 !important;
}

body.white-theme .insight-warning {
  background: #fff3e0 !important;
  border-left: 4px solid #f57c00 !important;
  color: #e65100 !important;
}

body.white-theme .insight-critical {
  background: #ffebee !important;
  border-left: 4px solid #d32f2f !important;
  color: #b71c1c !important;
}

body.white-theme .comparison-table {
  background: #ffffff !important;
  border: 2px solid #d0d0d0 !important;
}

body.white-theme .comparison-table th {
  background: #f5f5f5 !important;
  color: #000000 !important;
  border-bottom: 2px solid #d0d0d0 !important;
  font-weight: 700 !important;
}

body.white-theme .comparison-table td {
  color: #1a1a1a !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

body.white-theme .comparison-table .your-site {
  background: #e8f5e9 !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

/* Override all inline styled backgrounds and text in light theme */
body.white-theme [style*="background: rgba"]:not(.seo-progress-container):not(.seo-progress-container *),
body.white-theme [style*="background:rgba"]:not(.seo-progress-container):not(.seo-progress-container *) {
  background: #ffffff !important;
}

/* Removed overly-broad gradient override - was killing colored progress bars */
/* body.white-theme [style*="background: linear-gradient"],
body.white-theme [style*="background:linear-gradient"] {
  background: #ffffff !important;
} */

body.white-theme [style*="color: rgba"],
body.white-theme [style*="color:rgba"] {
  color: #1a1a1a !important;
}

body.white-theme [style*="color: #e0e0e0"],
body.white-theme [style*="color:#e0e0e0"] {
  color: #495057 !important; /* Readable dark gray (7.4:1) */
}

body.white-theme [style*="color: #ccc"],
body.white-theme [style*="color:#ccc"] {
  color: #495057 !important; /* Readable dark gray (7.4:1) */
}

body.white-theme [style*="color: #999"],
body.white-theme [style*="color:#999"] {
  color: #495057 !important; /* Readable dark gray (7.4:1) */
}

/* Force all containers to have proper backgrounds */
body.white-theme > * {
  background-color: #ffffff !important;
}

body.white-theme main,
body.white-theme .main-content,
body.white-theme .content-wrapper {
  background-color: #ffffff !important;
}

/* Results cards and sections */
body.white-theme .results-card,
body.white-theme .results-section,
body.white-theme [class*="result"] {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #d0d0d0 !important;
}

/* Competitive Analysis - Executive Summary Banner */
body.white-theme .score-banner {
  background: #ffffff !important;
  border: 3px solid #4caf50 !important;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2) !important;
}

body.white-theme .score-banner > div {
  background: transparent !important;
}

body.white-theme .score-banner * {
  color: #000000 !important;
}

body.white-theme .score-banner strong {
  color: #2e7d32 !important;
}

body.white-theme .score-banner [style*="opacity: 0.9"],
body.white-theme .score-banner [style*="opacity: 0.8"],
body.white-theme .score-banner [style*="opacity: 0.7"] {
  color: #333333 !important;
  opacity: 1 !important;
}

/* Score circle in banner */
body.white-theme .score-banner [style*="border-radius: 50%"] {
  background: #ffffff !important; /* White background for contrast */
  border-color: currentColor !important; /* Use score color for border */
}

/* CRITICAL: All score numbers must be dark and readable in light mode */
body.white-theme .score-banner [style*="font-size: 2.5rem"],
body.white-theme .score-banner [style*="font-size: 3rem"],
body.white-theme .score-banner [style*="font-size:2.5rem"],
body.white-theme .score-banner [style*="font-size:3rem"],
body.white-theme [style*="border-radius: 50%"] [style*="font-size"],
body.white-theme [style*="border-radius:50%"] [style*="font-size"],
body.white-theme div[style*="border-radius: 50%"] > div,
body.white-theme div[style*="border-radius:50%"] > div {
  color: #1a1a1a !important; /* Very dark grey - maximum readability */
  font-weight: 700 !important;
  opacity: 1 !important;
}

/* Dial score text - default (dark mode) with glow */
.circular-progress text,
.dial-score-text {
  fill: #ffffff;
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 15px currentColor);
}

/* CRITICAL: SVG text elements in score circles must be dark for light mode */
body.white-theme svg text,
body.white-theme .circular-progress text,
body.white-theme svg.circular-progress text,
body.white-theme .dial-score-text {
  fill: #1a1a1a !important; /* Dark grey for SVG text */
  filter: none !important; /* Remove glow effect */
}

/* Fix: Any circular score containers with inline dark radial gradients should be white in light theme */
body.white-theme div[style*="border-radius: 50%"] {
  background: #ffffff !important;
  /* Tone down heavy glows that look odd on white backgrounds */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Fix: Neutralize inline dark radial gradients inside sections for light theme */
body.white-theme .section [style*="background: radial-gradient"][style*="rgba(0,0,0"] {
  background: #ffffff !important;
}

/* Simple outline icons - light grey for light mode */
body.white-theme a svg {
  stroke: #6c757d !important; /* Medium grey outline icons */
}

body.white-theme a:hover svg {
  stroke: var(--accent-primary) !important;
}

/* Status symbols (✓, ✗, ⚠) - appropriate colors for light mode */
span[style*="color: #00ff41"],
span[style*="color:#00ff41"] {
  color: var(--accent-primary) !important;
}

body.white-theme span[style*="color: #ff4444"],
body.white-theme span[style*="color:#ff4444"] {
  color: #c92a2a !important; /* Accessible red for X marks */
}

body.white-theme span[style*="color: #ffa500"],
body.white-theme span[style*="color:#ffa500"] {
  color: #d97706 !important; /* Accessible orange for warnings */
}

body.white-theme .score-banner [style*="font-size: 0.9rem"] {
  color: #495057 !important; /* Readable gray for labels */
  opacity: 1 !important;
  font-weight: 600 !important;
}

/* Summary stats area */
body.white-theme .score-banner [style*="background: rgba(255, 255, 255, 0.2)"] {
  background: rgba(var(--accent-primary-rgb), 0.06) !important;
}

/* Chart containers */
body.white-theme .chart-container,
body.white-theme .section {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #d0d0d0 !important;
}

body.white-theme .chart-title,
body.white-theme .chart-subtitle {
  color: #000000 !important;
}

/* Tables in results */
body.white-theme table {
  background: #ffffff !important;
  border: 2px solid #d0d0d0 !important;
}

body.white-theme thead {
  background: #f5f5f5 !important;
}

body.white-theme thead th {
  color: #000000 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #d0d0d0 !important;
}

body.white-theme tbody tr {
  background: #ffffff !important;
  border-bottom: 2px solid #d0d0d0 !important;
}

body.white-theme tbody tr:nth-child(even) {
  background: #f9f9f9 !important;
}

body.white-theme tbody td {
  color: #1a1a1a !important;
  padding: 0.75rem !important;
}

/* Chart legend improvements */
body.white-theme .chart-legend,
body.white-theme [class*="legend"] {
  background: #ffffff !important;
  border: 2px solid #e0e0e0 !important;
  padding: 1rem !important;
  border-radius: 8px !important;
}

body.white-theme .chart-legend span,
body.white-theme [class*="legend"] span,
body.white-theme .chart-legend div,
body.white-theme [class*="legend"] div {
  color: #000000 !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
}

/* Chart.js legend items */
body.white-theme canvas + div,
body.white-theme .chartjs-legend,
body.white-theme #legend {
  color: #000000 !important;
}

body.white-theme .chartjs-legend li,
body.white-theme #legend li {
  color: #000000 !important;
  font-weight: 600 !important;
  margin: 0.5rem 0 !important;
}

body.white-theme .section {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #dddddd !important;
}

body.white-theme .findings-table {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #ddd !important;
}

body.white-theme .findings-table thead th {
  background-color: #f0f0f0 !important;
  color: #000000 !important;
  border-color: #ddd !important;
}

body.white-theme .findings-table tbody tr:hover {
  background-color: #f8f8f8 !important;
}

body.white-theme .findings-table tbody td {
  color: var(--text-secondary) !important;
  border-color: #eeeeee !important;
}

body.white-theme .theme-toggle,
body.white-theme .header-theme-toggle {
  background: transparent !important;
  color: #111 !important;
  border: none !important;
  box-shadow: none !important;
}

body.white-theme .theme-toggle:hover,
body.white-theme .header-theme-toggle:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 0.7;
}

/* PRO badges in light mode - Green */
body.white-theme .nav-badge,
body.white-theme .hot-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
}

/* Language selector in light mode */
body.white-theme .language-selector-header select {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111 !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
}

body.white-theme .language-selector-header select:hover {
  background: rgba(0, 0, 0, 0.09) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

/* Fix score cards and health indicators in white theme */
body.white-theme .score-card {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

body.white-theme .score-card:hover {
  border-color: #bbbbbb !important;
}

body.white-theme .health-item {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

/* SEO Analyzer light mode styles */
body.white-theme .score-grid > div {
  background: rgba(37, 99, 235, 0.05) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
}

body.white-theme .seo-summary {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

body.white-theme .stat-item {
  color: var(--text-secondary) !important;
}

body.white-theme .stat-value {
  color: #2563eb !important;
}

body.white-theme .stat-label {
  color: var(--text-tertiary) !important;
}

/* Light mode table styles */
body.white-theme .seo-table thead tr {
  border-bottom-color: rgba(37, 99, 235, 0.5) !important;
}

body.white-theme .seo-table thead th {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08) !important;
}

body.white-theme .seo-table tbody tr {
  border-bottom-color: rgba(37, 99, 235, 0.15) !important;
}

body.white-theme .seo-table tbody tr:nth-child(odd) {
  background: rgba(37, 99, 235, 0.03) !important;
}

body.white-theme .seo-table tbody td {
  color: var(--text-secondary) !important;
}

body.white-theme .score-card-label {
  color: var(--text-tertiary) !important;
}

/* Enhanced score display light mode */
div[style*="linear-gradient(135deg, rgba(0,255,65"],
body.white-theme div[style*="linear-gradient(135deg, rgba(0,255,65"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.03) 100%) !important;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15) !important;
}

body.white-theme .health-summary {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

body.white-theme .health-summary h3 {
  color: var(--text-secondary) !important;
}

/* Fix any remaining black boxes in white theme */
body.white-theme div[style*="background: #000"],
body.white-theme div[style*="background-color: #000"],
body.white-theme span[style*="background: #000"],
body.white-theme span[style*="background-color: #000"],
body.white-theme div[style*="background: #111"],
body.white-theme div[style*="background-color: #111"],
body.white-theme div[style*="background: var(--bg-input)"],
body.white-theme div[style*="background-color: var(--bg-input)"],
body.white-theme div[style*="background: #1a0000"],
body.white-theme div[style*="background-color: #1a0000"],
body.white-theme div[style*="background: #110000"],
body.white-theme div[style*="background-color: #110000"],
body.white-theme div[style*="background: #220000"],
body.white-theme div[style*="background-color: #220000"],
body.white-theme pre[style*="background: #110000"],
body.white-theme pre[style*="background-color: #110000"],
body.white-theme div[style*="background: #0f0f0f"],
body.white-theme div[style*="background-color: #0f0f0f"],
body.white-theme div[style*="background: #000000"],
body.white-theme div[style*="background-color: #000000"],
body.white-theme div[style*="background: #1a1a1a"],
body.white-theme div[style*="background-color: #1a1a1a"],
body.white-theme pre,
body.white-theme code {
  background: #f8f8f8 !important;
  color: #000000 !important;
  border-color: #ddd !important;
}

/* Fix font display containers specifically */
body.white-theme #systemFontsDisplay > div,
body.white-theme #webFontsDisplay > div,
body.white-theme #googleFontsDisplay > div,
body.white-theme #iconFontsDisplay > div {
  background: #f8f8f8 !important;
  color: #000000 !important;
  border: 1px solid #ddd !important;
}

/* Fix font preview text within containers */
body.white-theme #systemFontsDisplay div[style*="color: #888"],
body.white-theme #webFontsDisplay div[style*="color: #888"],
body.white-theme #googleFontsDisplay div[style*="color: #888"],
body.white-theme #iconFontsDisplay div[style*="color: #888"] {
  color: var(--text-tertiary) !important;
}

/* Fix icon font green text */
body.white-theme div[style*="color: var(--accent-primary)"] {
  color: #059669 !important;
}

/* Fix performance summary boxes for white theme */
body.white-theme .performance-summary {
  color: #000000 !important;
}

body.white-theme .performance-summary.success {
  background-color: #f0fdf4 !important;
  border-left-color: #22c55e !important;
}

body.white-theme .performance-summary.warning {
  background-color: #fffbeb !important;
  border-left-color: #f59e0b !important;
}

body.white-theme .performance-summary.critical {
  background-color: #fef2f2 !important;
  border-left-color: #ef4444 !important;
}

body.white-theme .font-preview {
  background-color: #f8f8f8 !important;
  border-color: #ddd !important;
}

body.white-theme .font-preview-text {
  color: #000000 !important;
}

/* Fix Font Loading Architecture section in white theme */
/* Font Loading Architecture - Light Mode */
body.white-theme .font-loading-architecture {
  background: #ffffff !important;
  border-color: #dee2e6 !important;
}

/* Override inline dark background */
body.white-theme .font-loading-architecture[style*="background: #0a0a0a"] {
  background: #ffffff !important;
}

/* Replace dark blue gradient header with light gradient */
body.white-theme .font-loading-architecture div[style*="background: linear-gradient"] {
  background: linear-gradient(90deg, #f1f3f5, #e9ecef, #f1f3f5) !important;
  border-bottom-color: #dee2e6 !important;
}

/* Make header title dark and readable in light mode */
body.white-theme .font-loading-architecture h4 {
  color: #1a1a1a !important;
}

/* All text in gradient header should be dark */
body.white-theme .font-loading-architecture div[style*="background: linear-gradient"] * {
  color: #1a1a1a !important;
}

/* Secondary text (uppercase labels) */
body.white-theme .font-loading-architecture div[style*="color: #888"],
body.white-theme .font-loading-architecture div[style*="color: #aaa"] {
  color: #495057 !important;
}

/* Metric boxes - adjust backgrounds and text */
.font-loading-architecture div[style*="background: rgba(0, 255, 65"],
body.white-theme .font-loading-architecture div[style*="background: rgba(0, 255, 65"] {
  background: rgba(var(--accent-primary-rgb), 0.1) !important;
  border-color: var(--accent-primary) !important;
}

body.white-theme .font-loading-architecture div[style*="background: rgba(245, 158, 11"] {
  background: rgba(217, 119, 6, 0.1) !important;
  border-color: #d97706 !important;
}

/* Metric values - keep colored but ensure readability */
.font-loading-architecture div[style*="background: rgba(0, 255, 65"] div[style*="color: #00ff41"],
body.white-theme .font-loading-architecture div[style*="background: rgba(0, 255, 65"] div[style*="color: #00ff41"] {
  color: var(--accent-primary) !important;
}

.font-loading-architecture div[style*="color: #00ff41"],
body.white-theme .font-loading-architecture div[style*="color: #00ff41"] {
  color: var(--accent-primary) !important;
}

/* Table styling */
body.white-theme .font-loading-architecture .font-sources-table {
  background: #ffffff !important;
}

body.white-theme .font-loading-architecture .font-sources-header {
  background: #f1f3f5 !important;
}

body.white-theme .font-loading-architecture .font-sources-th {
  color: #1a1a1a !important;
  background: #f1f3f5 !important;
  border-color: #dee2e6 !important;
}

body.white-theme .font-loading-architecture td {
  color: #1a1a1a !important;
  border-color: #dee2e6 !important;
  background: #ffffff !important;
}

body.white-theme .font-loading-architecture tr {
  border-bottom-color: #dee2e6 !important;
}

/* Font source labels and descriptions */
body.white-theme .font-loading-architecture td div[style*="font-weight: bold"] {
  color: #1a1a1a !important;
}

body.white-theme .font-loading-architecture td div[style*="font-size: 0.8rem"] {
  color: #495057 !important;
}

/* Override any remaining dark backgrounds */
body.white-theme .font-loading-architecture div[style*="background: #111"],
body.white-theme .font-loading-architecture div[style*="background: var(--bg-input)"],
body.white-theme .font-loading-architecture div[style*="background: #0a0a0a"] {
  background: #f8f9fa !important;
  border-color: #dee2e6 !important;
}

/* WCAG Compliance Tables - Light Mode */
body.white-theme .wcag-compliance-table thead tr,
body.white-theme .wcag-requirements-table thead tr {
  background: #f1f3f5 !important;
  border-bottom-color: #dee2e6 !important;
}

body.white-theme .wcag-compliance-table th,
body.white-theme .wcag-requirements-table th {
  color: #1a1a1a !important;
  border-color: #dee2e6 !important;
  background: #f1f3f5 !important;
}

body.white-theme .wcag-compliance-table td,
body.white-theme .wcag-requirements-table td {
  color: #1a1a1a !important;
  border-color: #dee2e6 !important;
  background: #ffffff !important;
}

body.white-theme .wcag-compliance-table tbody tr,
body.white-theme .wcag-requirements-table tbody tr {
  border-bottom-color: #dee2e6 !important;
}

/* Override inline dark backgrounds in table headers */
body.white-theme table[style*="border-collapse"] thead tr[style*="background: #1a1a1a"] {
  background: #f1f3f5 !important;
}

body.white-theme table[style*="border-collapse"] th[style*="color: #fff"] {
  color: #1a1a1a !important;
}

/* Improvement Priority Section - Light Mode */
body.white-theme .improvement-priority-section {
  background: #ffffff !important;
  border-width: 1px !important;
}

body.white-theme .improvement-priority-section .priority-label {
  color: #1a1a1a !important;
}

body.white-theme .improvement-priority-section .priority-description {
  color: #495057 !important;
  background: #f8f9fa !important;
}

/* Analysis Tables - Light Mode (Font Categories, Readability, Font Size, Mobile Accessibility) */
body.white-theme table.analysis-table {
  background: #ffffff !important;
  border-color: #dee2e6 !important;
}

body.white-theme table.analysis-table thead tr {
  background: #f1f3f5 !important;
  border-bottom-color: #dee2e6 !important;
}

body.white-theme table.analysis-table th {
  color: #1a1a1a !important;
  border-color: #dee2e6 !important;
  background: #f1f3f5 !important;
}

body.white-theme table.analysis-table td {
  color: #1a1a1a !important;
  border-color: #dee2e6 !important;
  background: #ffffff !important;
}

body.white-theme table.analysis-table tbody tr {
  border-bottom-color: #dee2e6 !important;
}

/* Font Status Badges - Light Mode (GOOGLE, FALLBACK, SYSTEM, LOADED) */
body.white-theme span[style*="background: #1a3d5c"] {
  /* GOOGLE badge - keep dark blue but ensure white text */
  background: #1e40af !important;
  color: #ffffff !important;
}

body.white-theme span[style*="background: #4d3a1a"] {
  /* FALLBACK badge - keep brown but ensure white text */
  background: #92400e !important;
  color: #ffffff !important;
}

body.white-theme span[style*="background: #1a4d1a"] {
  /* SYSTEM badge - keep green but ensure readable text */
  background: #166534 !important;
  color: #ffffff !important;
}

body.white-theme span[style*="background: #2d1a4d"] {
  /* LOADED badge - keep purple but ensure white text */
  background: #6d28d9 !important;
  color: #ffffff !important;
}

/* Section Headings (Font Categories, Readability Assessment, etc.) */
body.white-theme h4[style*="color: #4A9EFF"] {
  color: #1e40af !important;
}

body.white-theme .font-group {
  background-color: #fafafa !important;
  border-color: #ddd !important;
}

body.white-theme .font-weight {
  background-color: #f0f0f0 !important;
  color: #000000 !important;
}

/* Override table backgrounds in white theme */
body.white-theme .findings-table {
  background-color: var(--text-primary) !important;
  border-color: #ddd !important;
}

body.white-theme .findings-table thead th {
  background-color: #f0f0f0 !important;
  color: #000000 !important;
  border-color: #ddd !important;
}

body.white-theme .findings-table tbody tr:hover {
  background-color: #f8f8f8 !important;
}

/* Override all metric containers, analysis sections, and error displays */
body.white-theme .readability-metrics,
body.white-theme .font-size-metrics,
body.white-theme .screen-reader-metrics,
body.white-theme .wcag-compliance,
body.white-theme .error-display {
  background-color: #f8f8f8 !important;
  color: #000000 !important;
  border-color: #ddd !important;
}

/* Ensure all text is readable in white theme */
body.white-theme p,
body.white-theme span,
body.white-theme div {
  color: #000000 !important;
}

/* Progress and loading styles */
.animate-pulse {
  animation: progressGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate !important;
  color: var(--text-primary) !important;
  text-shadow: 0 0 5px rgba(var(--accent-primary-rgb), 0.5) !important;
}

@keyframes progressGlow {
  from {
    text-shadow: 0 0 5px rgba(var(--accent-primary-rgb), 0.5) !important;
  }
  to {
    text-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.8), 0 0 15px rgba(var(--accent-primary-rgb), 0.6) !important;
  }
}

#loadingMessage {
  border: 3px solid var(--accent-primary) !important;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%) !important;
  color: var(--text-primary) !important;
  padding: 2.5rem !important;
  margin: 2rem 0 !important;
  border-radius: 8px !important;
  position: relative !important;
  box-shadow: 
    0 0 30px rgba(var(--accent-primary-rgb), 0.5),
    inset 0 1px 0 rgba(var(--accent-primary-rgb), 0.5) !important;
}

#results {
  background-color: var(--bg-primary) !important;
  min-height: 400px;
}

#loadingMessage h2 {
  color: var(--accent-primary) !important;
  margin-bottom: 1.5rem !important;
  text-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5) !important;
  font-size: 1.8rem !important;
  letter-spacing: 0.05em !important;
}

#loadingMessage p {
  color: var(--text-primary) !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.8 !important;
}

#loadingMessage p {
  color: #cccccc !important;
  margin-bottom: 1.5rem !important;
}

/* Enhanced Progress container */
.progress-container {
  width: 100% !important;
  height: 24px !important;
  background-color: var(--bg-tertiary) !important;
  border: 2px solid var(--border-accent) !important;
  border-radius: 8px !important;
  margin: 1.5rem 0 !important;
  overflow: hidden !important;
  position: relative !important;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(var(--accent-primary-rgb), 0.5) !important;
}

.progress-bar {
  height: 100% !important;
  background: linear-gradient(90deg, 
    var(--accent-primary) 0%, 
    var(--accent-primary-dark) 25%, 
    var(--accent-primary) 50%, 
    var(--accent-primary-dark) 75%, 
    var(--accent-primary) 100%) !important;
  background-size: 200% 100% !important;
  animation: progressGradient 2s linear infinite !important;
  border-radius: 6px !important;
  width: 0% !important;
  transition: width 0.8s ease-out !important;
  box-shadow: 
    0 0 20px rgba(var(--accent-primary-rgb), 0.5),
    0 0 40px rgba(var(--accent-primary-rgb), 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.3) !important;
  position: relative !important;
  overflow: visible !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Display percentage inside progress bar */
.progress-bar::after {
  content: attr(data-progress) !important;
  position: absolute !important;
  right: 8px !important;
  color: #000 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-shadow: 0 0 10px var(--accent-primary) !important;
  z-index: 10 !important;
  mix-blend-mode: difference !important;
}

@keyframes progressGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Animated progress bar shimmer effect */
.progress-bar::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent) !important;
  animation: shimmer 2s infinite !important;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Color-coded progress bars based on score */
.progress-bar.score-excellent {
  background: linear-gradient(90deg, 
    var(--accent-primary) 0%, 
    var(--accent-primary-dark) 50%, 
    var(--accent-primary) 100%) !important;
  box-shadow: 
    0 0 15px rgba(var(--accent-primary-rgb), 0.6),
    0 0 30px rgba(var(--accent-primary-rgb), 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.3) !important;
}

.progress-bar.score-good {
  background: linear-gradient(90deg, 
    #22c55e 0%, 
    #16a34a 50%, 
    #22c55e 100%) !important;
  box-shadow: 
    0 0 15px rgba(34, 197, 94, 0.5),
    0 0 30px rgba(34, 197, 94, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.3) !important;
}

/* Score: 50-74% - Yellow/Amber (Poor in JS, but visually "needs improvement") */
.progress-bar.score-poor {
  background: linear-gradient(90deg, 
    #facc15 0%, 
    #eab308 50%, 
    #facc15 100%) !important;
  box-shadow: 
    0 0 15px rgba(250, 204, 21, 0.5),
    0 0 30px rgba(250, 204, 21, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.3) !important;
}

/* Score: 0-49% - Red (Critical) */
.progress-bar.score-critical {
  background: linear-gradient(90deg, 
    #ef4444 0%, 
    #dc2626 50%, 
    #ef4444 100%) !important;
  box-shadow: 
    0 0 15px rgba(239, 68, 68, 0.5),
    0 0 30px rgba(239, 68, 68, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.3) !important;
}

/* Heartbeat animation for long-running operations */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(1.05); }
  20%, 40% { transform: scale(0.95); }
}

.heartbeat {
  animation: heartbeat 2s ease-in-out infinite !important;
  display: inline-block !important;
}

/* Progress text styling */
.progress-text {
  color: var(--accent-primary) !important;
  font-size: 1.1rem !important;
  margin-top: 0.75rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-shadow: 0 0 5px rgba(var(--accent-primary-rgb), 0.5) !important;
  letter-spacing: 0.05em !important;
}

/* Button active state when analyzing */
button:disabled {
  background-color: #001100 !important;
  color: #0f0f14 !important;
  border-color: #0f0f14 !important;
  cursor: not-allowed !important;
}

/* White theme loading message */
body.white-theme #loadingMessage {
  border-color: #2563eb !important;
  background-color: #f0f4ff !important;
  color: #1e40af !important;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.1) !important;
}

body.white-theme #loadingMessage h2 {
  color: #1e40af !important;
  text-shadow: none !important;
}

body.white-theme #loadingMessage p {
  color: #64748b !important;
  text-shadow: none !important;
}

body.white-theme .progress-container {
  background-color: #e0e7ff !important;
  border-color: #c7d2fe !important;
}

body.white-theme .progress-bar {
  background: linear-gradient(90deg, #2563eb, #1d4ed8, #2563eb) !important;
  background-size: 200% 100% !important;
  animation: progressGradient 2s linear infinite !important;
  /* Subtle shadow for light mode - no glow */
  box-shadow: 
    0 2px 4px rgba(37, 99, 235, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

/* Color-coded progress bars for light mode */
body.white-theme .progress-bar.score-excellent {
  background: linear-gradient(90deg, #059669, #047857, #059669) !important;
  box-shadow: 
    0 2px 4px rgba(5, 150, 105, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

body.white-theme .progress-bar.score-good {
  background: linear-gradient(90deg, #16a34a, #15803d, #16a34a) !important;
  box-shadow: 
    0 2px 4px rgba(22, 163, 74, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

/* Light mode: 50-74% - Yellow/Amber */
body.white-theme .progress-bar.score-poor {
  background: linear-gradient(90deg, #eab308, #ca8a04, #eab308) !important;
  box-shadow: 
    0 2px 4px rgba(234, 179, 8, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

/* Light mode: 0-49% - Red */
body.white-theme .progress-bar.score-critical {
  background: linear-gradient(90deg, #dc2626, #b91c1c, #dc2626) !important;
  box-shadow: 
    0 2px 4px rgba(220, 38, 38, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
}

body.white-theme .progress-text {
  color: #2563eb !important;
  text-shadow: none !important;
}

body.white-theme .animate-pulse {
  color: #1e40af !important;
  text-shadow: none !important;
  animation: none !important;
}

body.white-theme #loadingMessage div[style*="background: rgba(0, 255, 20"] {
  background: rgba(37, 99, 235, 0.1) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
}

body.white-theme #loadingMessage span[style*="color: var(--accent-primary)"] {
  color: #2563eb !important;
}

/* Executive Summary Styling */
.executive-summary {
  margin-bottom: 2rem !important;
}

.summary-intro {
  margin-bottom: 2rem !important;
  padding: 1.5rem !important;
  background-color: #0f0f0f !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px !important;
}

.summary-description {
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
  color: #cccccc !important;
  margin-bottom: 1rem !important;
}

.scan-metadata {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  margin-bottom: 1.5rem !important;
}

.scan-info {
  font-size: 0.9rem !important;
  color: #888888 !important;
  padding: 0.25rem 0.5rem !important;
  background-color: var(--bg-tertiary) !important;
  border-radius: 3px !important;
}

.performance-summary {
  padding: 1rem !important;
  border-radius: 4px !important;
  border-left: 4px solid #666666 !important;
}

.performance-summary.success {
  background-color: #003300 !important;
  border-left-color: #00ff14 !important;
}

.performance-summary.warning {
  background-color: #332200 !important;
  border-left-color: #ffd000 !important;
}

.performance-summary.critical {
  background-color: #330000 !important;
  border-left-color: var(--status-error) !important;
}

.summary-status {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  font-size: 1rem !important;
}

.status-indicator {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

.status-indicator.success {
  background-color: #00ff14 !important;
}

.status-indicator.warning {
  background-color: #ffd000 !important;
}

.status-indicator.critical {
  background-color: var(--status-error) !important;
}

.summary-recommendations {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
}

.recommendation {
  font-size: 0.9rem !important;
  color: #cccccc !important;
}

/* 4-Column Executive Grid */
.executive-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
}

@media (max-width: 1024px) {
  .executive-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

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

.executive-card {
  background-color: var(--bg-tertiary) !important;
  border: 2px solid var(--border-primary) !important;
  border-radius: 8px !important;
  padding: 1.5rem !important;
  text-align: center !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.executive-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.executive-card.health-good {
  border-color: #00ff14 !important;
  box-shadow: 0 0 15px rgba(0, 255, 20, 0.2) !important;
}

.executive-card.health-warning {
  border-color: #ffd000 !important;
  box-shadow: 0 0 15px rgba(255, 208, 0, 0.2) !important;
}

.executive-card.health-poor {
  border-color: var(--status-error) !important;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.2) !important;
}

.card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  margin-bottom: 1rem !important;
}

.card-icon {
  font-size: 1.25rem !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  transition: all 0.3s ease;
  margin: 0 auto 0.5rem;
}

.card-title {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #cccccc !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.card-score {
  margin-bottom: 1rem !important;
}

.score-value {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  line-height: 1 !important;
}

.score-max {
  font-size: 1.2rem !important;
  color: #888888 !important;
  font-weight: 400 !important;
}

.card-status {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  margin-bottom: 1rem !important;
}

.status-icon {
  font-size: 1rem !important;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(var(--accent-primary-rgb), 0.06);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.12);
  transition: all 0.3s ease;
}

.status-text {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
}

.card-progress {
  height: 4px !important;
  background-color: var(--text-secondary) !important;
  border-radius: 2px !important;
  overflow: hidden !important;
}

.progress-fill {
  height: 100% !important;
  border-radius: 2px !important;
  transition: width 0.8s ease !important;
}

.progress-fill.health-good {
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-dark)) !important;
}

.progress-fill.health-warning {
  background: linear-gradient(90deg, #ffd000, #ffaa00) !important;
}

.progress-fill.health-poor {
  background: linear-gradient(90deg, #ff4444, #ff6666) !important;
}

/* Secondary Metrics Row */
.secondary-metrics {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1rem !important;
  margin-top: 1.5rem !important;
}

@media (max-width: 768px) {
  .secondary-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .secondary-metrics {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

.metric-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 1rem !important;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
}

.metric-item:hover {
  background-color: var(--bg-tertiary) !important;
  border-color: #444444 !important;
}

.metric-icon {
  font-size: 1.25rem !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  transition: all 0.3s ease;
  margin: 0 auto 0.5rem !important;
}

.metric-label {
  font-size: 0.8rem !important;
  color: #888888 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-bottom: 0.25rem !important;
}

.metric-value {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

/* White Theme Executive Summary */
body.white-theme .summary-intro {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

body.white-theme .summary-description {
  color: var(--text-secondary) !important;
}

body.white-theme .scan-info {
  color: var(--text-tertiary) !important;
  background-color: #f0f0f0 !important;
}

body.white-theme .executive-card {
  background-color: #ffffff !important;
  border-color: #dee2e6 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

body.white-theme .executive-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

body.white-theme .executive-card.health-good {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 2px 8px rgba(var(--accent-primary-rgb), 0.15) !important;
}

body.white-theme .executive-card.health-warning {
  border-color: #d97706 !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15) !important;
}

body.white-theme .executive-card.health-poor {
  border-color: #c92a2a !important;
  box-shadow: 0 2px 8px rgba(201, 42, 42, 0.15) !important;
}

body.white-theme .card-title {
  color: var(--text-secondary) !important;
}

body.white-theme .score-value {
  color: #1a1a1a !important; /* Very dark grey - maximum readability */
  font-weight: 700 !important;
  opacity: 1 !important;
}

body.white-theme .score-max {
  color: #495057 !important; /* Readable gray for /100 text */
  opacity: 1 !important;
}

/* Catch ANY large text in circles - super aggressive targeting */
body.white-theme [style*="border-radius: 50%"] *,
body.white-theme [style*="border-radius:50%"] * {
  color: #1a1a1a !important;
  font-weight: 700 !important;
}

body.white-theme .status-text {
  color: var(--text-secondary) !important;
}

body.white-theme .card-progress {
  background-color: var(--text-secondary) !important;
}

body.white-theme .metric-item {
  background-color: #f8f8f8 !important;
  border-color: #dddddd !important;
}

body.white-theme .metric-item:hover {
  background-color: #f0f0f0 !important;
  border-color: #cccccc !important;
}

body.white-theme .metric-label {
  color: var(--text-tertiary) !important;
}

body.white-theme .metric-value {
  color: #000000 !important;
}

body.white-theme .metric-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary) !important;
}

body.white-theme .card-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary) !important;
}

body.white-theme .status-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary) !important;
}

/* Fix status boxes for white theme */
body.white-theme .status-pass {
  background-color: rgba(var(--accent-primary-rgb), 0.15) !important;
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.3) !important;
  text-shadow: 0 0 2px rgba(var(--accent-primary-rgb), 0.5) !important;
}

body.white-theme .status-fail {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3) !important;
  text-shadow: 0 0 2px rgba(239, 68, 68, 0.5) !important;
}

body.white-theme .status-warning {
  background-color: rgba(234, 179, 8, 0.15) !important;
  color: #ca8a04 !important;
  border-color: #eab308 !important;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.3) !important;
  text-shadow: 0 0 2px rgba(234, 179, 8, 0.5) !important;
}

body.white-theme .status-info {
  background-color: #eff6ff !important;
  color: #2563eb !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.2) !important;
}

/* Audit Categories Table Styling */
.audit-categories-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1rem 0 !important;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.audit-categories-table th {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  padding: 1rem !important;
  text-align: left !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #444444 !important;
  font-size: 0.9rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.audit-categories-table td {
  padding: 1rem !important;
  border-bottom: 1px solid var(--border-primary)333 !important;
  color: #cccccc !important;
  vertical-align: top !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
}

.audit-categories-table td strong {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.audit-categories-table tr:hover {
  background-color: var(--bg-tertiary) !important;
}

/* White theme overrides for audit categories table */
body.white-theme .audit-categories-table {
  background-color: var(--text-primary) !important;
  border-color: #dddddd !important;
}

body.white-theme .audit-categories-table th {
  background-color: #f8f9fa !important;
  color: var(--text-secondary) !important;
  border-bottom-color: #dddddd !important;
}

body.white-theme .audit-categories-table td {
  color: #555555 !important;
  border-bottom-color: #eeeeee !important;
}

body.white-theme .audit-categories-table td strong {
  color: #000000 !important;
}

body.white-theme .audit-categories-table tr:hover {
  background-color: #f8f9fa !important;
}

/* Contrast Card Color Coding */
.contrast-card {
  transition: all 0.3s ease !important;
}

.contrast-excellent {
  border-left: 4px solid var(--accent-primary) !important;
  box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.5) !important;
}

.contrast-good {
  border-left: 4px solid #ffaa00 !important;
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.2) !important;
}

.contrast-fair {
  border-left: 4px solid #ff6b6b !important;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.2) !important;
}

.contrast-poor {
  border-left: 4px solid #ff4444 !important;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.3) !important;
}

.contrast-unknown {
  border-left: 4px solid #666666 !important;
  box-shadow: 0 0 8px rgba(102, 102, 102, 0.2) !important;
}

/* White theme overrides for contrast cards */
body.white-theme .contrast-excellent {
  background-color: rgba(var(--accent-primary-rgb), 0.06) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.15) !important;
}

body.white-theme .contrast-good {
  background-color: #fffbeb !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15) !important;
}

body.white-theme .contrast-fair {
  background-color: #fef2f2 !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.15) !important;
}

body.white-theme .contrast-poor {
  background-color: #fef2f2 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2) !important;
}

body.white-theme .contrast-unknown {
  background-color: #f8f9fa !important;
  border-color: #6b7280 !important;
  box-shadow: 0 0 8px rgba(107, 114, 128, 0.15) !important;
}

/* Action Column Styling */
.action-cell {
  font-size: 0.85rem !important;
  line-height: 1.3 !important;
}

.action-code {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 4px !important;
  padding: 0.5rem !important;
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
  margin: 0.25rem 0 !important;
}

.action-code code {
  background-color: var(--bg-tertiary) !important;
  color: var(--accent-primary) !important;
  padding: 0.2rem 0.4rem !important;
  border-radius: 3px !important;
  font-size: 0.8rem !important;
  display: block !important;
  margin: 0.2rem 0 !important;
  border: 1px solid #444444 !important;
}

.action-note {
  color: #888888 !important;
  font-style: italic !important;
  font-size: 0.75rem !important;
  display: block !important;
  margin-top: 0.25rem !important;
}

/* White theme overrides for action column */
body.white-theme .action-code {
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
  color: var(--text-secondary) !important;
}

body.white-theme .action-code code {
  background-color: #e9ecef !important;
  color: #0d6efd !important;
  border-color: #ced4da !important;
}

body.white-theme .action-note {
  color: #6c757d !important;
}

/* Analysis Tables Styling */
.analysis-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1rem 0 !important;
  font-size: 0.9rem !important;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.analysis-table td {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid var(--border-primary)333 !important;
  color: #cccccc !important;
  vertical-align: middle !important;
}

.analysis-table td:first-child {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  background-color: var(--bg-tertiary) !important;
  width: 30% !important;
}

.analysis-table td:nth-child(2) {
  font-weight: 500 !important;
  width: 40% !important;
}

.analysis-table td:last-child {
  text-align: center !important;
  font-weight: bold !important;
  width: 30% !important;
}

.analysis-table tr:hover {
  background-color: var(--bg-tertiary) !important;
}

.analysis-table tr:last-child td {
  border-bottom: none !important;
}

/* Status indicators in analysis tables */
.analysis-table td:last-child {
  color: var(--accent-primary) !important;
}

.analysis-table td:contains("⚠️"),
.analysis-table td:contains("✗") {
  color: #ff6666 !important;
}

/* White theme overrides for analysis tables */
body.white-theme .analysis-table {
  background-color: var(--text-primary) !important;
  border-color: #dddddd !important;
}

body.white-theme .analysis-table td {
  color: #555555 !important;
  border-bottom-color: #eeeeee !important;
}

body.white-theme .analysis-table td:first-child {
  color: #000000 !important;
  background-color: #f8f9fa !important;
}

body.white-theme .analysis-table tr:hover {
  background-color: #f8f9fa !important;
}

body.white-theme .analysis-table td:last-child {
  color: #22c55e !important;
}

/* Section headers styling for readability sections */
.readability-metrics h4,
.font-size-metrics h4,
.screen-reader-metrics h4,
.wcag-compliance h4 {
  color: var(--accent-primary) !important;
  margin: 1.5rem 0 0.5rem 0 !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
}

body.white-theme .readability-metrics h4,
body.white-theme .font-size-metrics h4,
body.white-theme .screen-reader-metrics h4,
body.white-theme .wcag-compliance h4 {
  color: #1e40af !important;
}

/* Font Loading Diagram Styles */
.font-loading-diagram {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-primary) !important;
  padding: 2rem !important;
  margin: 1rem 0 !important;
  border-radius: 8px !important;
}

.diagram-title {
  text-align: center !important;
  color: var(--accent-primary) !important;
  margin-bottom: 2rem !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
}

.diagram-container {
  position: relative !important;
  height: 500px !important;
  background: var(--bg-secondary) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.webpage-container {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 200px !important;
  height: 250px !important;
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a) !important;
  border: 2px solid var(--border-accent) !important;
  border-radius: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.5) !important;
  z-index: 10 !important;
}

.webpage-icon {
  color: var(--accent-primary) !important;
  font-weight: bold !important;
  margin-bottom: 1rem !important;
  font-size: 0.9rem !important;
}

.webpage-content {
  color: #888888 !important;
  font-size: 0.8em !important;
  text-align: center !important;
  line-height: 1.4 !important;
}

.webpage-count {
  margin-top: 1rem !important;
  font-size: 0.7em !important;
  color: #555555 !important;
}

.font-source {
  position: absolute !important;
  width: 140px !important;
  height: 100px !important;
  border-radius: 6px !important;
  padding: 0.75rem !important;
  transition: all 0.3s ease !important;
}

.font-source:hover {
  transform: scale(1.05) !important;
  z-index: 15 !important;
}

.system-fonts {
  top: 20px !important;
  left: 20px !important;
  background: linear-gradient(145deg, #2a1a4a, #3a2a5a) !important;
  border: 1px solid #6666ff !important;
  animation: pulse-blue 4s infinite !important;
}

.web-fonts {
  top: 20px !important;
  right: 20px !important;
  background: linear-gradient(145deg, #4a2a1a, #5a3a2a) !important;
  border: 1px solid #ff6666 !important;
  animation: pulse-red 4s infinite 1s !important;
}

.google-fonts {
  bottom: 20px !important;
  left: 20px !important;
  background: linear-gradient(145deg, #1a4a2a, #2a5a3a) !important;
  border: 1px solid #66ff66 !important;
  animation: pulse-green 4s infinite 2s !important;
}

.icon-fonts {
  bottom: 20px !important;
  right: 20px !important;
  background: linear-gradient(145deg, #4a4a1a, #5a5a2a) !important;
  border: 1px solid #ffff66 !important;
  animation: pulse-yellow 4s infinite 3s !important;
}

.source-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.source-icon {
  font-size: 0.8em !important;
}

.source-title {
  font-weight: bold !important;
  font-size: 0.75em !important;
}

.system-fonts .source-title {
  color: #6666ff !important;
}

.web-fonts .source-title {
  color: #ff6666 !important;
}

.google-fonts .source-title {
  color: #66ff66 !important;
}

.icon-fonts .source-title {
  color: #ffff66 !important;
}

.source-content {
  color: #aaaaaa !important;
  font-size: 0.7em !important;
  line-height: 1.3 !important;
}

.source-count {
  margin-top: 0.25rem !important;
  font-weight: 500 !important;
}

.connection-lines {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 5 !important;
}

.loading-stats {
  position: absolute !important;
  top: 10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(0, 0, 0, 0.8) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 4px !important;
  color: #888888 !important;
  font-size: 0.7em !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.performance-icon {
  color: var(--accent-primary) !important;
}

.diagram-legend {
  display: flex !important;
  justify-content: center !important;
  gap: 2rem !important;
  margin-top: 1.5rem !important;
  font-size: 0.8em !important;
  flex-wrap: wrap !important;
}

.legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.legend-color {
  width: 12px !important;
  height: 12px !important;
  border-radius: 2px !important;
  display: inline-block !important;
}

.system-legend {
  color: #6666ff !important;
}

.system-legend .legend-color {
  background: #6666ff !important;
}

.web-legend {
  color: #ff6666 !important;
}

.web-legend .legend-color {
  background: #ff6666 !important;
}

.google-legend {
  color: #66ff66 !important;
}

.google-legend .legend-color {
  background: #66ff66 !important;
}

.icon-legend {
  color: #ffff66 !important;
}

.icon-legend .legend-color {
  background: #ffff66 !important;
}

/* Pulse Animations */
@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 0 5px rgba(102, 102, 255, 0.5); }
  50% { box-shadow: 0 0 20px rgba(102, 102, 255, 0.8), 0 0 30px rgba(102, 102, 255, 0.6); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 102, 102, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 102, 102, 0.8), 0 0 30px rgba(255, 102, 102, 0.6); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 5px rgba(102, 255, 102, 0.5); }
  50% { box-shadow: 0 0 20px rgba(102, 255, 102, 0.8), 0 0 30px rgba(102, 255, 102, 0.6); }
}

@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 102, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 102, 0.8), 0 0 30px rgba(255, 255, 102, 0.6); }
}

/* Light Mode Overrides for Font Loading Diagram */
body.white-theme .font-loading-diagram {
  background: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
}

body.white-theme .diagram-title {
  color: #1e40af !important;
}

body.white-theme .diagram-container {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

body.white-theme .webpage-container {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0) !important;
  border: 2px solid #1e40af !important;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.2) !important;
}

body.white-theme .webpage-icon {
  color: #1e40af !important;
}

body.white-theme .webpage-content {
  color: #4b5563 !important;
}

body.white-theme .webpage-count {
  color: #6b7280 !important;
}

body.white-theme .system-fonts {
  background: linear-gradient(145deg, #e0e7ff, #c7d2fe) !important;
  border: 1px solid #3730a3 !important;
}

body.white-theme .web-fonts {
  background: linear-gradient(145deg, #fef2f2, #fecaca) !important;
  border: 1px solid #dc2626 !important;
}

body.white-theme .google-fonts {
  background: linear-gradient(145deg, #f0fdf4, #bbf7d0) !important;
  border: 1px solid #16a34a !important;
}

body.white-theme .icon-fonts {
  background: linear-gradient(145deg, #fefce8, #fef08a) !important;
  border: 1px solid #ca8a04 !important;
}

body.white-theme .system-fonts .source-title {
  color: #3730a3 !important;
}

body.white-theme .web-fonts .source-title {
  color: #dc2626 !important;
}

body.white-theme .google-fonts .source-title {
  color: #16a34a !important;
}

body.white-theme .icon-fonts .source-title {
  color: #ca8a04 !important;
}

body.white-theme .source-content {
  color: #4b5563 !important;
}

body.white-theme .loading-stats {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #4b5563 !important;
  border: 1px solid #e5e7eb !important;
}

body.white-theme .performance-icon {
  color: #16a34a !important;
}

body.white-theme .system-legend {
  color: #3730a3 !important;
}

body.white-theme .system-legend .legend-color {
  background: #3730a3 !important;
}

body.white-theme .web-legend {
  color: #dc2626 !important;
}

body.white-theme .web-legend .legend-color {
  background: #dc2626 !important;
}

body.white-theme .google-legend {
  color: #16a34a !important;
}

body.white-theme .google-legend .legend-color {
  background: #16a34a !important;
}

body.white-theme .icon-legend {
  color: #ca8a04 !important;
}

body.white-theme .icon-legend .legend-color {
  background: #ca8a04 !important;
}

/* Enhanced Font Loading Architecture Styles */
.font-loading-architecture {
  padding: 0 !important;
}

.architecture-intro {
  margin-bottom: 2rem !important;
}

.architecture-intro h3 {
  color: var(--accent-primary) !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.5rem !important;
}

.architecture-intro p {
  color: #888888 !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

.enhanced-font-diagram {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 12px !important;
  padding: 2rem !important;
  margin: 1.5rem 0 !important;
}

.diagram-header {
  margin-bottom: 2rem !important;
}

.diagram-metrics {
  display: flex !important;
  justify-content: center !important;
  gap: 3rem !important;
  flex-wrap: wrap !important;
}

.metric-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.metric-label {
  color: #888888 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.metric-value {
  color: var(--accent-primary) !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
}

.diagram-canvas {
  position: relative !important;
  height: 650px !important;
  background: var(--bg-secondary) !important;
  border-radius: 8px !important;
  margin: 2rem 0 !important;
  overflow: hidden !important;
}

.webpage-hub {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 220px !important;
  height: 260px !important;
  background: linear-gradient(145deg, #1a1a2e, #16213e) !important;
  border: 3px solid var(--accent-primary) !important;
  border-radius: 16px !important;
  padding: 1rem !important;
  box-shadow: 
    0 20px 40px rgba(var(--accent-primary-rgb), 0.5),
    0 0 0 1px var(--bg-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  z-index: 20 !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
}

.hub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  margin-bottom: 1.5rem !important;
  padding: 0.75rem !important;
  background: rgba(var(--accent-primary-rgb), 0.12) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.25) !important;
}

.hub-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  transition: all 0.3s ease;
}

.hub-title {
  color: var(--accent-primary) !important;
  font-weight: bold !important;
  font-size: 1.1rem !important;
  letter-spacing: 2px !important;
  text-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5) !important;
}

.font-usage {
  margin-bottom: 1.5rem !important;
}

.usage-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0.75rem 0 !important;
  padding: 0.6rem !important;
  background: linear-gradient(90deg, var(--bg-hover), rgba(255, 255, 255, 0.02)) !important;
  border-radius: 6px !important;
  border-left: 3px solid var(--accent-primary) !important;
  transition: all 0.2s ease !important;
}

.usage-item:hover {
  background: linear-gradient(90deg, rgba(var(--accent-primary-rgb), 0.12), rgba(var(--accent-primary-rgb), 0.12)) !important;
  transform: translateX(2px) !important;
}

.usage-type {
  color: #888888 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.usage-font {
  color: var(--accent-primary) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.usage-font {
  color: var(--accent-primary) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
}

.hub-stats {
  display: flex !important;
  gap: 1rem !important;
  justify-content: center !important;
}

.stat-badge {
  background: rgba(var(--accent-primary-rgb), 0.12) !important;
  color: var(--accent-primary) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 12px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.25) !important;
}

.load-time {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.font-source {
  position: absolute !important;
  width: 145px !important;
  height: 115px !important;
  border-radius: 8px !important;
  padding: 0.75rem !important;
  transition: all 0.3s ease !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
}

.font-source:hover {
  transform: scale(1.05) !important;
  z-index: 25 !important;
}

.enhanced-system {
  top: 15px !important;
  left: 15px !important;
  width: 160px !important;
  height: 130px !important;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.3)) !important;
  border: 2px solid #6366f1 !important;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2) !important;
  padding: 0.8rem !important;
  box-sizing: border-box !important;
}

.enhanced-web {
  top: 15px !important;
  right: 15px !important;
  width: 160px !important;
  height: 130px !important;
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3)) !important;
  border: 2px solid #ef4444 !important;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2) !important;
  padding: 0.8rem !important;
  box-sizing: border-box !important;
}

.enhanced-google {
  bottom: 15px !important;
  left: 15px !important;
  width: 160px !important;
  height: 130px !important;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.3)) !important;
  border: 2px solid #22c55e !important;
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2) !important;
  padding: 0.8rem !important;
  box-sizing: border-box !important;
}

.enhanced-icon {
  bottom: 15px !important;
  right: 15px !important;
  width: 160px !important;
  height: 130px !important;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3)) !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2) !important;
  padding: 0.8rem !important;
  box-sizing: border-box !important;
}

.source-indicator {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  animation: pulse-indicator 2s infinite !important;
}

.system-indicator {
  background: #6366f1 !important;
}

.web-indicator {
  background: #ef4444 !important;
}

.google-indicator {
  background: #22c55e !important;
}

.icon-indicator {
  background: #f59e0b !important;
}

.source-icon-container {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  margin-right: 0.75rem !important;
}

.source-status {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
}

.source-status.online {
  background: #22c55e !important;
}

.source-status.loading {
  background: #f59e0b !important;
  animation: blink 1.5s infinite !important;
}

.source-status.cached {
  background: #3b82f6 !important;
}

/* Fix content overflow and border overlapping issues */
.enhanced-system, .enhanced-web, .enhanced-google, .enhanced-icon {
  overflow: hidden !important;
  position: relative !important;
  z-index: 1 !important;
}

.source-header {
  position: relative !important;
  z-index: 2 !important;
  padding: 0 !important;
  margin: 0 0 0.5rem 0 !important;
}

.source-details {
  position: relative !important;
  z-index: 2 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.font-list {
  margin: 0 0 0.5rem 0 !important;
  padding: 0 !important;
}

.font-item {
  font-size: 0.7rem !important;
  padding: 0.2rem 0.4rem !important;
  margin: 0.1rem 0 !important;
  border-radius: 3px !important;
  background: var(--bg-hover) !important;
  border-left: 2px solid currentColor !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.source-metrics {
  padding: 0.3rem !important;
  margin: 0 !important;
  border-radius: 3px !important;
  background: var(--bg-hover) !important;
}

.metric {
  font-size: 0.65rem !important;
  line-height: 1.1 !important;
  margin: 0.1rem 0 !important;
  padding: 0 !important;
}

.source-title {
  font-size: 0.75rem !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.source-subtitle {
  font-size: 0.6rem !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.font-weight, .font-format, .font-weights, .icon-count {
  font-size: 0.6rem !important;
  opacity: 0.8 !important;
  margin-left: 0.3rem !important;
}

.source-info {
  display: flex !important;
  flex-direction: column !important;
}

.source-title {
  font-weight: bold !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.5px !important;
}

.source-subtitle {
  font-size: 0.65rem !important;
  opacity: 0.7 !important;
  margin-top: 0.2rem !important;
}

.enhanced-system .source-title {
  color: #6366f1 !important;
}

.enhanced-web .source-title {
  color: #ef4444 !important;
}

.enhanced-google .source-title {
  color: #22c55e !important;
}

.enhanced-icon .source-title {
  color: #f59e0b !important;
}

.source-details {
  margin-top: 1rem !important;
}

.font-list {
  margin-bottom: 0.75rem !important;
}

.font-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0.3rem 0 !important;
  padding: 0.25rem 0.4rem !important;
  background: var(--bg-hover) !important;
  border-radius: 3px !important;
  font-size: 0.7rem !important;
  color: #cccccc !important;
}

.font-weight,
.font-format,
.font-weights,
.icon-count {
  font-size: 0.65rem !important;
  opacity: 0.8 !important;
  font-weight: 500 !important;
}

.source-metrics {
  display: flex !important;
  justify-content: space-between !important;
  margin-top: 0.4rem !important;
}

.metric {
  font-size: 0.6rem !important;
  color: #888888 !important;
  text-align: center !important;
}

.connection-network {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 15 !important;
}

.connection-label {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 500 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

.enhanced-legend {
  margin-top: 2rem !important;
  padding-top: 2rem !important;
  border-top: 1px solid #333333 !important;
}

.legend-performance {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 1.5rem !important;
}

.performance-indicator {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  background: rgba(var(--accent-primary-rgb), 0.12) !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 8px !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.25) !important;
}

.indicator-icon {
  font-size: 1.2rem !important;
  color: var(--accent-primary) !important;
}

.indicator-text {
  color: #cccccc !important;
  font-size: 0.9rem !important;
}

.indicator-rating {
  font-weight: 600 !important;
  font-size: 0.9rem !important;
}

.legend-sources {
  display: flex !important;
  justify-content: center !important;
  gap: 2rem !important;
  flex-wrap: wrap !important;
}

.legend-source {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 0.8rem !important;
}

.source-dot {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

.legend-source.system {
  color: #6366f1 !important;
}

.legend-source.system .source-dot {
  background: #6366f1 !important;
}

.legend-source.web {
  color: #ef4444 !important;
}

.legend-source.web .source-dot {
  background: #ef4444 !important;
}

.legend-source.google {
  color: #22c55e !important;
}

.legend-source.google .source-dot {
  background: #22c55e !important;
}

.legend-source.icon {
  color: #f59e0b !important;
}

.legend-source.icon .source-dot {
  background: #f59e0b !important;
}

/* Loading Insights Styles */
.loading-insights-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 1.5rem !important;
  margin: 1.5rem 0 !important;
}

@media (max-width: 480px) {
  .loading-insights-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

.insight-card {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
  padding: 1.5rem !important;
  transition: all 0.3s ease !important;
}

.insight-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.insight-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  margin-bottom: 1rem !important;
}

.insight-icon {
  font-size: 1.1rem !important;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary) !important;
  transition: all 0.3s ease;
  margin: 0 auto 0.5rem;
}

/* Font source table icons */
.font-source-icon {
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.insight-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
}

.insight-content {
  text-align: center !important;
}

.insight-metric {
  margin-bottom: 0.75rem !important;
}

.insight-metric .metric-value {
  display: block !important;
  color: var(--accent-primary) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.25rem !important;
}

.insight-metric .metric-label {
  color: #888888 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.insight-status {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 12px !important;
}

.insight-status.good {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #22c55e !important;
}

.insight-status.warning {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #f59e0b !important;
}

.insight-status.poor {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

/* Architecture Recommendations Styles */
.architecture-recommendations {
  margin: 1.5rem 0 !important;
}

.recommendation-item {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
  margin: 1rem 0 !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}

.recommendation-item:hover {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.5) !important;
}

.recommendation-header {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1rem 1.5rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.recommendation-priority {
  padding: 0.25rem 0.75rem !important;
  border-radius: 12px !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.recommendation-priority.high {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

.recommendation-priority.medium {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #f59e0b !important;
}

.recommendation-priority.low {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #22c55e !important;
}

.recommendation-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
}

.recommendation-content {
  padding: 1.5rem !important;
}

.recommendation-description {
  color: #cccccc !important;
  margin-bottom: 1rem !important;
  line-height: 1.5 !important;
}

.recommendation-action {
  color: #888888 !important;
  margin-bottom: 0.75rem !important;
  font-size: 0.9rem !important;
}

.recommendation-impact {
  color: #888888 !important;
  font-size: 0.9rem !important;
}

.recommendation-action strong,
.recommendation-impact strong {
  color: var(--accent-primary) !important;
}

/* Animations */
@keyframes pulse-indicator {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Light Mode Overrides for Enhanced Architecture */
body.white-theme .architecture-intro h3 {
  color: #1e40af !important;
}

body.white-theme .architecture-intro p {
  color: #4b5563 !important;
}

body.white-theme .enhanced-font-diagram {
  background: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
}

body.white-theme .diagram-canvas {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

body.white-theme .webpage-hub {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0) !important;
  border: 3px solid #1e40af !important;
  box-shadow: 0 8px 32px rgba(30, 64, 175, 0.2) !important;
}

body.white-theme .hub-title {
  color: #1e40af !important;
}

body.white-theme .usage-type {
  color: #6b7280 !important;
}

body.white-theme .usage-font {
  color: #1e40af !important;
}

body.white-theme .stat-badge {
  background: rgba(30, 64, 175, 0.1) !important;
  color: #1e40af !important;
  border-color: rgba(30, 64, 175, 0.3) !important;
}

body.white-theme .insight-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

body.white-theme .insight-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary) !important;
}

body.white-theme .font-source-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
}

body.white-theme .insight-title {
  color: #111827 !important;
}

body.white-theme .insight-metric .metric-value {
  color: #1e40af !important;
}

body.white-theme .insight-metric .metric-label {
  color: #6b7280 !important;
}

body.white-theme .recommendation-item {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
}

body.white-theme .recommendation-item:hover {
  border-color: #1e40af !important;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.1) !important;
}

body.white-theme .recommendation-title {
  color: #111827 !important;
}

body.white-theme .recommendation-description {
  color: #4b5563 !important;
}

body.white-theme .recommendation-action,
body.white-theme .recommendation-impact {
  color: #6b7280 !important;
}

body.white-theme .recommendation-action strong,
body.white-theme .recommendation-impact strong {
  color: #1e40af !important;
}

body.white-theme .performance-indicator {
  background: rgba(30, 64, 175, 0.1) !important;
  border-color: rgba(30, 64, 175, 0.3) !important;
}

body.white-theme .indicator-icon {
  color: #1e40af !important;
}

body.white-theme .indicator-text {
  color: #4b5563 !important;
}

/* 🚀 BEST-IN-CLASS TOGGLE STYLES */
.scan-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: all 0.3s ease;
}

.toggle-container:hover {
  transform: translateY(-1px);
}

.toggle-container input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: var(--bg-tertiary);
  border: 1px solid #333;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #666;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(26px);
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.toggle-description {
  color: #888;
  font-size: 0.8rem;
  text-align: center;
  max-width: 400px;
  line-height: 1.3;
  margin-top: 0.25rem;
}

/* White theme overrides for toggle */
body.white-theme .toggle-slider {
  background: #f3f4f6;
  border-color: #d1d5db;
}

body.white-theme .toggle-slider::after {
  background: #9ca3af;
}

body.white-theme .toggle-container input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

body.white-theme .toggle-label {
  color: #111827;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.white-theme .toggle-description {
  color: #6b7280;
}

/* Best-in-Class Grade Display */
.best-in-class-grade {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.grade-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.grade-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.grade-value {
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.grade-score {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  font-weight: 600;
}

/* White theme overrides for improvement priority section */
body.white-theme .improvement-priority-section {
  background: #f8f9fa !important;
  border: 2px solid #dee2e6 !important;
  color: #212529 !important;
}

body.white-theme .improvement-priority-section[style*="border: 2px solid #dc2626"] {
  background: #fef2f2 !important;
  border: 2px solid #dc2626 !important;
}

body.white-theme .improvement-priority-section[style*="border: 2px solid #f59e0b"] {
  background: #fffbeb !important;
  border: 2px solid #f59e0b !important;
}

body.white-theme .improvement-priority-section[style*="border: 2px solid #22c55e"] {
  background: #f0fdf4 !important;
  border: 2px solid #22c55e !important;
}

/* Override priority text colors for white theme */
body.white-theme .improvement-priority-section .priority-label {
  color: #111827 !important;
}

body.white-theme .improvement-priority-section .priority-value-high {
  color: #dc2626 !important;
}

body.white-theme .improvement-priority-section .priority-value-medium {
  color: #d97706 !important;
}

body.white-theme .improvement-priority-section .priority-value-low {
  color: #059669 !important;
}

body.white-theme .improvement-priority-section .priority-description {
  color: #374151 !important;
}

/* Font Sources Table Styles */
.font-sources-table {
  background: #111 !important;
}

.font-sources-header {
  background: var(--bg-tertiary) !important;
}

.font-sources-th {
  padding: 12px !important;
  text-align: left !important;
  border: 1px solid #333 !important;
  color: #fff !important;
  font-weight: bold !important;
}

.font-sources-th:nth-child(2),
.font-sources-th:nth-child(3),
.font-sources-th:nth-child(4) {
  text-align: center !important;
}

/* White theme overrides for font sources table */
body.white-theme .font-sources-table {
  background: #ffffff !important;
  border: 1px solid #dee2e6 !important;
}

body.white-theme .font-sources-header {
  background: #f8f9fa !important;
}

body.white-theme .font-sources-th {
  border: 1px solid #dee2e6 !important;
  color: #212529 !important;
  background: #f8f9fa !important;
}

body.white-theme .font-sources-table tbody tr {
  border-bottom: 1px solid #dee2e6 !important;
  background: #ffffff !important;
}

body.white-theme .font-sources-table tbody tr:hover {
  background: #f8f9fa !important;
}

body.white-theme .font-sources-table tbody td {
  border: 1px solid #dee2e6 !important;
  color: #212529 !important;
}

/* Fix text colors in cells for white theme */
body.white-theme .font-sources-table td div[style*="color: #6366f1"] {
  color: #4f46e5 !important;
}

body.white-theme .font-sources-table td div[style*="color: #ef4444"] {
  color: #dc2626 !important;
}

body.white-theme .font-sources-table td div[style*="color: #22c55e"] {
  color: #16a34a !important;
}

body.white-theme .font-sources-table td div[style*="color: #888"] {
  color: #6b7280 !important;
}

body.white-theme .font-sources-table td[style*="color: #aaa"] {
  color: #6b7280 !important;
}

body.white-theme .font-sources-table td[style*="color: #6366f1"] {
  color: #4f46e5 !important;
}

body.white-theme .font-sources-table td[style*="color: #22c55e"] {
  color: #16a34a !important;
}

body.white-theme .font-sources-table td[style*="color: #f59e0b"] {
  color: #d97706 !important;
}

/* Benchmark Status Banner Styles */
.benchmark-status {
  margin: 1rem 0 !important;
  padding: 1rem !important;
  background: linear-gradient(90deg, #1a1a2e, #16213e) !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-accent) !important;
  transition: all 0.3s ease !important;
}

.benchmark-content {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.benchmark-title {
  color: var(--accent-primary) !important;
  margin: 0 !important;
  font-size: 1rem !important;
}

.benchmark-subtitle {
  color: #cccccc !important;
  margin: 0.5rem 0 0 0 !important;
  font-size: 0.9rem !important;
}

.benchmark-score-container {
  text-align: right !important;
}

.benchmark-score {
  color: var(--accent-primary) !important;
  font-size: 1.5rem !important;
  font-weight: bold !important;
}

.benchmark-ranking {
  color: #888888 !important;
  font-size: 0.8rem !important;
}

/* White theme overrides for benchmark banner */
body.white-theme .benchmark-status {
  background: linear-gradient(90deg, #dbeafe, #bfdbfe) !important;
  border: 1px solid #3b82f6 !important;
}

body.white-theme .benchmark-title {
  color: #1e40af !important;
}

body.white-theme .benchmark-subtitle {
  color: #374151 !important;
}

body.white-theme .benchmark-score {
  color: #1e40af !important;
}

body.white-theme .benchmark-ranking {
  color: #6b7280 !important;
}
/* ========================================
   LIGHTHOUSE DASHBOARD STYLES
   ======================================== */

/* Lighthouse Analysis Container */
.lighthouse-analysis {
  padding: 1rem;
}

/* Lighthouse Dashboard Grid */
.lighthouse-dashboard {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  border-radius: 8px;
}

/* Scores Grid Layout */
.lighthouse-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Score Gauge Component */
.lighthouse-score-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  transition: transform 0.2s;
}

.lighthouse-score-gauge:hover {
  transform: translateY(-4px);
  background: rgba(0, 0, 0, 0.4);
}

/* Circular Score Display */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 8px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  position: relative;
}

.score-value {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
}

.score-label {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.25rem;
  text-align: center;
}

.score-grade {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.score-device {
  font-size: 0.8rem;
  color: #666;
}

/* Core Web Vitals Section */
.core-web-vitals-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 165, 0, 0.05);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 8px;
}

/* CWV Metrics Grid */
.cwv-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Individual CWV Metric */
.cwv-metric {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 4px solid;
  border-left-color: inherit;
}

.cwv-metric-name {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.cwv-metric-value {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.cwv-metric-status {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cwv-metric-threshold {
  font-size: 0.75rem;
  color: #666;
}

/* Audit Categories Table */
.audit-categories-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.2);
}

.audit-categories-table th {
  background: rgba(var(--accent-primary-rgb), 0.12);
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid rgba(var(--accent-primary-rgb), 0.25);
  font-weight: 600;
}

.audit-categories-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--bg-hover);
}

.audit-categories-table tr:hover {
  background: rgba(var(--accent-primary-rgb), 0.08);
}

/* Mobile Not Available Message */
.mobile-not-available {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* White Theme Overrides */
body.white-theme .lighthouse-dashboard {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
}

body.white-theme .lighthouse-score-gauge {
  background: rgba(255, 255, 255, 0.5);
}

body.white-theme .lighthouse-score-gauge:hover {
  background: rgba(255, 255, 255, 0.7);
}

body.white-theme .score-label {
  color: #666;
}

body.white-theme .score-device {
  color: #999;
}

body.white-theme .core-web-vitals-section {
  background: rgba(255, 165, 0, 0.08);
  border-color: rgba(255, 165, 0, 0.3);
}

body.white-theme .cwv-metric {
  background: rgba(255, 255, 255, 0.5);
}

body.white-theme .cwv-metric-name {
  color: #666;
}

body.white-theme .cwv-metric-threshold {
  color: #999;
}

body.white-theme .audit-categories-table {
  background: rgba(255, 255, 255, 0.3);
}

body.white-theme .audit-categories-table th {
  background: rgba(59, 130, 246, 0.1);
  border-bottom-color: rgba(59, 130, 246, 0.3);
}

body.white-theme .audit-categories-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.white-theme .audit-categories-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .lighthouse-scores-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cwv-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .score-circle {
    width: 100px;
    height: 100px;
    border-width: 6px;
  }
  
  .score-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .lighthouse-scores-grid {
    grid-template-columns: 1fr;
  }
}

/* Score Breakdown Visualization */
.score-breakdown {
  background: var(--bg-secondary);
  border: 2px solid var(--border-accent);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.5);
}

.score-breakdown h2 {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5);
  margin-bottom: 1.5rem;
}

.breakdown-header {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.breakdown-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.breakdown-final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: #000;
  border: 2px solid var(--border-accent);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.5);
}

.breakdown-final-label {
  font-size: 0.9rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.breakdown-final-value {
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 0 10px currentColor;
}

.breakdown-final-grade {
  font-size: 1.2rem;
  color: var(--accent-primary);
  opacity: 0.8;
}

.breakdown-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  flex: 1;
}

.breakdown-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.breakdown-stat .stat-label {
  font-size: 0.85rem;
  color: #888;
}

.breakdown-stat .stat-value {
  font-size: 1.1rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.breakdown-components {
  margin-top: 2rem;
}

.breakdown-components h3 {
  color: var(--accent-primary);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.breakdown-description {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.breakdown-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5);
}

.breakdown-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.breakdown-icon {
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(var(--accent-primary-rgb), 0.08);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.breakdown-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.breakdown-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-weight {
  color: #888;
  font-size: 0.85rem;
  white-space: nowrap;
}

.breakdown-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 180px;
}

.breakdown-bar {
  flex: 1;
  height: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease, background 0.3s ease;
  position: relative;
  box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.5);
}

.breakdown-value {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
  text-shadow: 0 0 5px currentColor;
}

.breakdown-footer {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.breakdown-note {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.no-breakdown {
  color: #888;
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .breakdown-summary {
    flex-direction: column;
  }
  
  .breakdown-stats {
    grid-template-columns: 1fr;
  }
  
  .breakdown-item {
    flex-direction: column;
    align-items: stretch;
  }
  
  .breakdown-score {
    width: 100%;
  }
}

/* White theme adjustments */
body.white-theme .score-breakdown {
  background: #ffffff;
  border-color: rgba(var(--accent-primary-rgb), 0.3);
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.15);
}

body.white-theme .score-breakdown h2 {
  color: var(--accent-primary);
  text-shadow: none;
}

body.white-theme .breakdown-header {
  background: #fff;
  border-color: rgba(var(--accent-primary-rgb), 0.3);
}

body.white-theme .breakdown-final-score {
  background: #f8f8f8;
  border-color: rgba(var(--accent-primary-rgb), 0.3);
  box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.15);
}

body.white-theme .breakdown-final-value {
  color: var(--accent-primary);
  text-shadow: none;
}

body.white-theme .breakdown-final-grade {
  color: var(--accent-primary);
}

body.white-theme .breakdown-stat .stat-value {
  color: var(--accent-primary);
}

body.white-theme .breakdown-description {
  color: #495057;
}

body.white-theme .breakdown-description svg {
  stroke: var(--accent-primary);
}

body.white-theme .breakdown-item {
  background: #fff;
  border-color: #e5e7eb;
}

body.white-theme .breakdown-icon {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary);
}

body.white-theme .breakdown-icon svg {
  stroke: currentColor;
}

body.white-theme .breakdown-item:hover {
  background: rgba(var(--accent-primary-rgb), 0.06);
  border-color: rgba(var(--accent-primary-rgb), 0.3);
  box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.15);
}

body.white-theme .breakdown-label {
  color: #333;
}

body.white-theme .breakdown-bar {
  background: #e5e7eb;
  border-color: #d1d5db;
}

body.white-theme .breakdown-bar-fill {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  opacity: 1 !important;
  filter: saturate(1.2) brightness(0.85);
}

body.white-theme .breakdown-value {
  text-shadow: none;
  filter: saturate(1.3) brightness(0.7);
}

body.white-theme .breakdown-footer {
  background: #fff;
  border-color: #e5e7eb;
}

body.white-theme .breakdown-note {
  color: #495057;
}

body.white-theme .breakdown-note svg {
  stroke: #0c7792;
}

/* ===================================================================
   UTILITY CLASSES - Use these instead of inline styles
   =================================================================== */

/* Text Color Utilities */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent-primary) !important; }
.text-accent-secondary { color: var(--accent-secondary) !important; }
.text-success { color: var(--status-success) !important; }
.text-warning { color: var(--status-warning) !important; }
.text-error { color: var(--status-error) !important; }
.text-info { color: var(--status-info) !important; }

/* Background Color Utilities */
.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-tertiary { background-color: var(--bg-tertiary) !important; }
.bg-hover { background-color: var(--bg-hover) !important; }
.bg-input { background-color: var(--bg-input) !important; }

/* Border Color Utilities */
.border-primary { border-color: var(--border-primary) !important; }
.border-secondary { border-color: var(--border-secondary) !important; }
.border-accent { border-color: var(--border-accent) !important; }

/* Score Color Utilities (for dynamic scoring) */
.score-excellent { color: var(--score-excellent) !important; }
.score-good { color: var(--score-good) !important; }
.score-fair { color: var(--score-fair) !important; }
.score-poor { color: var(--score-poor) !important; }

/* Helper function for JavaScript - returns appropriate score class */
/* Usage: element.className = getScoreClass(85) */

/* ===================================================================
   MODERN UI IMPROVEMENTS - Summary Ribbon & Quick Navigation
   =================================================================== */

/* Summary Ribbon - Top-level health snapshot */
.summary-ribbon {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  box-shadow: var(--shadow-2xl);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: slideInFromTop 0.6s ease-out;
}

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

.summary-ribbon-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  align-items: center;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.summary-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-primary-rgb), 0.1);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
  transition: all 0.3s ease;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.summary-value {
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.ribbon-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ribbon-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.ribbon-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.1);
}

.ribbon-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-secondary);
}

.ribbon-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
}

/* Quick Navigation Panel */
.quick-nav {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: slideInFromRight 0.5s ease-out;
}

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

.quick-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
  color: var(--accent-primary);
}

.quick-nav-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
  transition: transform 0.3s ease;
}

.quick-nav-toggle:hover {
  color: var(--accent-primary);
}

.quick-nav.collapsed .quick-nav-toggle {
  transform: rotate(-90deg);
}

.quick-nav-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.quick-nav.collapsed .quick-nav-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.quick-nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.quick-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.quick-nav-link:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.quick-nav-link:hover::before {
  transform: scaleY(1);
}

.nav-icon {
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(var(--accent-primary-rgb), 0.05);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.1);
  filter: grayscale(70%) opacity(0.8);
  transition: all 0.3s ease;
}

.quick-nav-link:hover .nav-icon {
  filter: grayscale(0%) opacity(1);
  background: rgba(var(--accent-primary-rgb), 0.12);
  border-color: rgba(var(--accent-primary-rgb), 0.25);
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .summary-ribbon-content {
    grid-template-columns: 1fr;
  }

  .quick-nav {
    position: relative;
    top: 0;
  }

  .ribbon-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .summary-ribbon-content {
    gap: var(--spacing-md);
  }

  .summary-item {
    gap: var(--spacing-sm);
  }

  .summary-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

@media (max-width: 375px) {
  .summary-ribbon-content {
    gap: var(--spacing-sm);
  }

  .summary-icon {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }
}

/* Light theme adjustments */
body.white-theme .summary-ribbon {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.white-theme .quick-nav {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.white-theme .quick-nav-link {
  background: #f9fafb;
}

body.white-theme .quick-nav-link:hover {
  background: #f0fdf4;
}

body.white-theme .ribbon-btn-primary {
  color: #ffffff;
}

/* Ensure readable CTAs in light theme (red background -> white text) */
body.white-theme .btn-primary,
body.white-theme .btn-primary *,
body.white-theme #analyzeButton *,
body.white-theme #dashboardAnalyzeButton *,
body.white-theme #seoAnalyzeButton *,
body.white-theme #perfAnalyzeButton *,
body.white-theme #cwvAnalyzeButton *,
body.white-theme #scanButton *,
body.white-theme #analyzeBtn *,
body.white-theme .analyze-button *,
body.white-theme .pro-report-block__upgrade-button--primary,
body.white-theme .pro-report-block__upgrade-button--primary *,
body.white-theme .pro-report-block[data-paid-unlock-card] .pro-report-block__btn:not(.pro-report-block__btn--secondary),
body.white-theme .pro-report-block[data-paid-unlock-card] .pro-report-block__btn:not(.pro-report-block__btn--secondary) * {
  color: #ffffff !important;
}

/* PaidUnlockCard secondary CTA (e.g. "Buy credits") must remain readable in light mode */
body.white-theme .pro-report-block[data-paid-unlock-card] .pro-report-block__btn--secondary {
  background: #ffffff !important;
  border: 2px solid var(--accent-primary) !important;
  color: var(--accent-primary) !important;
}

body.white-theme .pro-report-block[data-paid-unlock-card] .pro-report-block__btn--secondary:hover:not(:disabled) {
  background: rgba(var(--accent-primary-rgb), 0.06) !important;
}

body.white-theme .pro-report-block[data-paid-unlock-card] .pro-report-block__btn--secondary:disabled {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
  color: #6b7280 !important;
  opacity: 1 !important;
}

body.white-theme .ribbon-btn-secondary {
  background: #f9fafb;
  color: #111827;
}

/* Light mode specific overrides */
body.white-theme .summary-icon {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
}

body.white-theme .hub-icon {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.12);
}

body.white-theme .nav-icon {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.08);
  filter: grayscale(60%) opacity(0.9);
}

body.white-theme .quick-nav-link:hover .nav-icon {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  filter: grayscale(0%) opacity(1);
  transform: translateY(-2px);
}

/* CRITICAL: Force dark background on body element - override ALL other rules */
html, body {
  background: #000000 !important;
  background-color: #000000 !important;
}

/* Dark mode backgrounds (applied when white-theme class is NOT present) */
body:not(.white-theme) {
  background: #000000 !important;
  background-color: #000000 !important;
}

/* Ensure containers in dark mode are transparent */
body:not(.white-theme) .container,
body:not(.white-theme) #results,
body:not(.white-theme) .results-container {
  background: transparent;
}

/* ========================================
   CRO Analyzer Responsive Styles
   ======================================== */

/* CRO Score Breakdown - 4 column grid on desktop, 2 on tablet, 1 on mobile */
@media (max-width: 1024px) {
  #results [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  #results [style*="grid-template-columns: repeat(4"],
  #results [style*="grid-template-columns: repeat(3"],
  #results [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Stack score overview on mobile */
  #results [style*="grid-template-columns: auto 1fr"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Center the score circle on mobile */
  #results [style*="grid-template-columns: auto 1fr"] > div:first-child {
    margin: 0 auto 1.5rem;
  }
  
  /* Quick Wins cards - stack on mobile */
  #results [style*="grid-template-columns: auto 1fr auto"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Hide Quick Win number on mobile */
  #results [style*="grid-template-columns: auto 1fr auto"] > div:last-child {
    display: none;
  }
  
  /* Center Quick Win icon on mobile */
  #results [style*="grid-template-columns: auto 1fr auto"] > div:first-child {
    margin: 0 auto;
  }
}

/* Light theme adjustments for CRO */
body.white-theme #results .section h2,
body.white-theme #results .section h3 {
  color: #1a1a2e;
}

body.white-theme #results [style*="color: #c0c0c0"] {
  color: #555 !important;
}

body.white-theme #results [style*="border-bottom: 1px solid #333"] {
  border-bottom-color: #e0e0e0 !important;
}

/* ============================================
   HOMEPAGE SWISS-MINIMAL STYLES
   ============================================ */

/* Homepage Hero Section */
.homepage-hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--swiss-section-gap, 20px) 40px;
  padding-top: 6px;
  padding-bottom: 16px;
  position: relative;
  z-index: 10;
}

/* Hero Grid - Single column layout */
.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  width: 100%;
}

/* Hero Left Column - Tightened flow with intentional spacing */
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

/* Hero Headline */
.hero-headline {
  font-family: var(--font-serif, 'DM Serif Text', Georgia, serif);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 3.75rem;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
  white-space: pre-line;
  text-align: left;
}

/* Hero Subhead */
.hero-subhead {
  font-size: var(--hero-subhead-size, 1.125rem);
  font-weight: var(--hero-subhead-weight, 400);
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  max-width: 720px;
  text-align: left;
}

/* Hero Form - Primary action container */
.hero-form {
  margin-bottom: 4px;
  width: 100%;
  min-width: min(100%, 800px);
}

/* Hero Form Row - Fused pill container */
.hero-form__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  background: var(--bg-card, var(--bg-secondary));
  border: 2px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-form__row:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(var(--accent-primary-rgb, 59, 130, 246), 0.15);
}

.hero-form__input {
  flex: 1;
  height: 52px;
  padding: 0 20px;
  font-size: 1.125rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  min-width: 500px;
  max-width: none;
  margin: 0;
}

.hero-form__input:focus {
  outline: none;
}

.hero-form__input::placeholder {
  color: var(--text-muted);
}

.hero-form__button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 40px;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent-primary);
  color: var(--accent-primary-contrast, #000);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.1s ease;
  min-width: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.hero-form__button:hover {
  background: var(--accent-primary-dark);
}

.hero-form__button:active {
  transform: scale(0.98);
}

.hero-form__button:focus {
  outline: none;
}

/* Hero Form - Light Theme */
body.white-theme .hero-form__row {
  background: #ffffff;
  border-color: #e0e0e0;
}

body.white-theme .hero-form__row:focus-within {
  border-color: var(--accent-primary);
}

body.white-theme .hero-form__input {
  color: #1a1a1a;
}

body.white-theme .hero-form__input::placeholder {
  color: #9ca3af;
}

body.white-theme .hero-form__button {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(var(--accent-primary-rgb), 0.3) !important;
}

body.white-theme .hero-form__button:hover {
  background: var(--accent-primary-dark) !important;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.4) !important;
}

/* Hero Helper Text */
.hero-helper-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

/* Hero Usage Pill */
.hero-usage-pill {
  margin: 8px 0 12px 0;
  min-height: 1.5rem;
}

.hero-usage-pill:empty {
  display: none;
}

/* Page Shell Usage Pill (for analyzer pages using PageShell) */
.page-shell-usage-pill {
  margin: 1rem 0 0 0;
  display: flex;
  justify-content: center;
}

.page-shell-usage-pill:empty {
  display: none;
}

/* Hero Usage Pill - center it */
.hero-usage-pill {
  display: flex;
  justify-content: center;
}

/* Example URL Chips */
.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.example-chips__label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: var(--swiss-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.example-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* What's Included Link */
.whats-included-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.whats-included-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.whats-included-link__arrow {
  transition: transform 0.2s ease;
}

.whats-included-link:hover .whats-included-link__arrow {
  transform: translateY(2px);
}

/* Abstract Diagnostic Graphic */
.hero-graphic {
  position: absolute;
  bottom: -40px;
  right: -20px;
  width: 200px;
  height: 200px;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.hero-graphic svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .hero-graphic {
    display: none;
  }
}

/* Hero Right Panel - Now below form */
.hero-right {
  background: var(--bg-card, var(--bg-secondary));
  border: var(--swiss-border);
  border-radius: 12px;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
  margin-top: 16px;
}

/* Subtle scan-line grid overlay */
.hero-right::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  opacity: 0.03;
  background:
    repeating-linear-gradient(
      90deg,
      var(--text-primary) 0px,
      var(--text-primary) 1px,
      transparent 1px,
      transparent 8px
    ),
    repeating-linear-gradient(
      0deg,
      var(--text-primary) 0px,
      var(--text-primary) 1px,
      transparent 1px,
      transparent 8px
    );
  pointer-events: none;
}

.hero-right__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.hero-right__list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-right__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

.hero-right__item::before {
  content: '▸';
  color: var(--accent-primary);
  font-size: 0.625rem;
}

/* Pro Callout Box inside hero-right */
.hero-right__pro-callout {
  background: var(--bg-gradient-primary, rgba(var(--accent-primary-rgb), 0.05));
  border: 1px solid rgba(var(--accent-primary-rgb), 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.hero-right__pro-callout p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Sample Report Link */
.hero-right__sample-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
  position: relative;
  z-index: 1;
}

.hero-right__sample-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Hero Right Panel - Light Theme */
body.white-theme .hero-right {
  background: #ffffff;
  border-color: #e0e0e0;
}

body.white-theme .hero-right__pro-callout {
  background: rgba(var(--accent-primary-rgb), 0.06);
}

/* Example Chips - Light Theme */
body.white-theme .example-chip {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #4b5563;
}

body.white-theme .example-chip:hover {
  background: #f3f4f6;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ============================================
   FEATURE STRIP
   ============================================ */

.feature-strip {
  max-width: var(--container-hero, 1120px);
  margin: 0 auto;
  padding: 40px var(--swiss-section-gap, 20px);
  border-top: var(--swiss-border);
  position: relative;
  z-index: 10;
}

.feature-strip__title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}

.feature-strip__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.feature-strip__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-strip__item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.feature-strip__item-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   PRO UPSELL BLOCK
   ============================================ */

.pro-upsell {
  max-width: var(--container-hero, 1120px);
  margin: 0 auto;
  padding: 0 var(--swiss-section-gap, 20px) 40px;
  position: relative;
  z-index: 10;
}

.pro-upsell__card {
  background: var(--bg-gradient-primary, linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.08), rgba(var(--accent-primary-rgb), 0.02)));
  border: 1px solid rgba(var(--accent-primary-rgb), 0.15);
  border-radius: 12px;
  padding: var(--swiss-card-padding, 20px) 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.pro-upsell__content {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.pro-upsell__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.pro-upsell__bullets {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.pro-upsell__bullet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.pro-upsell__bullet::before {
  content: '✓';
  color: var(--accent-primary);
  font-weight: 700;
}

.pro-upsell__cta {
  height: var(--swiss-btn-height, 44px);
  padding: 0 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid var(--accent-primary);
  border-radius: var(--swiss-btn-radius, 10px);
  background: transparent;
  color: var(--accent-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-width: auto;
}

.pro-upsell__cta:hover {
  background: var(--accent-primary);
  color: var(--accent-primary-contrast, #000);
}

/* ============================================
   HOMEPAGE FOOTER BAR
   ============================================ */

.homepage-footer-bar {
  max-width: var(--container-hero, 1120px);
  margin: 0 auto;
  padding: 20px var(--swiss-section-gap, 20px);
  text-align: center;
  border-top: var(--swiss-border);
  position: relative;
  z-index: 10;
}

.homepage-footer-bar__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.homepage-footer-bar__link {
  color: var(--accent-primary);
  text-decoration: none;
  margin-left: 4px;
}

.homepage-footer-bar__link:hover {
  text-decoration: underline;
}

/* ============================================
   HOMEPAGE RESPONSIVE STYLES
   ============================================ */

/* Stack to 1-column at 900px */
@media (max-width: 900px) {
  .hero-headline {
    font-size: 2rem;
    margin-bottom: 6px;
  }

  .hero-subhead {
    margin-bottom: 20px;
  }

  .hero-right::before {
    display: none;
  }

  .feature-strip__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pro-upsell__card {
    flex-direction: column;
    text-align: center;
  }

  .pro-upsell__content {
    flex-direction: column;
    gap: 12px;
  }

  .pro-upsell__bullets {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .homepage-hero {
    padding: 16px;
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .hero-headline {
    font-size: 1.75rem;
    margin-bottom: 6px;
  }

  .hero-subhead {
    font-size: 1rem;
    margin-bottom: 16px;
  }

  .hero-form {
    margin-bottom: 6px;
  }

  .hero-form__row {
    flex-direction: column;
    padding: 6px;
    border-radius: 12px;
  }

  .hero-form__input {
    height: 48px;
    border-radius: 8px;
    text-align: center;
  }

  .hero-form__button {
    height: 48px;
    border-radius: 8px;
    margin-top: 4px;
  }

  .hero-form__input,
  .hero-form__button {
    width: 100%;
  }

  .hero-helper-text {
    margin-bottom: 12px;
    text-align: center;
  }

  .example-chips {
    justify-content: center;
    margin-bottom: 16px;
  }

  .whats-included-link {
    justify-content: center;
    width: 100%;
  }

  .feature-strip {
    padding: 32px 16px;
  }

  .feature-strip__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pro-upsell {
    padding: 0 16px 32px;
  }

  .pro-upsell__bullets {
    flex-direction: column;
    gap: 8px;
  }
}
