/* CleaningHQ — Clean Light Theme with Electric Lime Accents
   Inspired by high-trust clinical sanitation, modern editorial design, and clean SaaS standards.
*/

:root {
  /* Light Theme (Default: Clean Warm Off-White) */
  --theme: light;
  --bg-dark: #f8f8f5;
  --bg-base: #f8f8f5;
  --bg-deep: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5ee;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f3ee;
  --bg-contrast-dark: #1b2529;
  
  --border-subtle: #e5e7eb;
  --border-medium: #cbd5e1;
  --border-glow: rgba(194, 255, 114, 0.4);

  --text-main: #111827;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-lime: #c2ff72;
  --accent-lime-hover: #b4ed6c;
  --accent-lime-tint: rgba(194, 255, 114, 0.28);
  --accent-lime-text: #14532d;
  --accent-cyan: #059669;
  --accent-teal: #15803d;
  --accent-teal-deep: #166534;
  --accent-teal-glow: rgba(194, 255, 114, 0.35);
  
  --hazard-amber: #d97706;
  --hazard-amber-glow: rgba(217, 119, 6, 0.15);
  --bio-crimson: #dc2626;
  --bio-crimson-glow: rgba(220, 38, 38, 0.15);
  --safe-emerald: #16a34a;
  --safe-emerald-glow: rgba(22, 163, 74, 0.18);

  /* Typography */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  /* Layout */
  --container-max: 1260px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 4px 18px rgba(194, 255, 114, 0.3);
  --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-xl: 28px;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);

  /* Semantic Token Aliases & Color Extensions */
  --text-heading: var(--text-main);
  --text-body: var(--text-muted);
  --bg-card-subtle: var(--bg-elevated);
  --bg-main: var(--bg-base);
  --font-sans: var(--font-body);
  --border-strong: var(--border-medium);
  --cat-cyan: #06b6d4;
  --cat-cyan-tint: rgba(6, 182, 212, 0.14);
  --cat-purple: #a855f7;
  --accent-emerald: var(--safe-emerald);
  --neutral-contrast: var(--bg-contrast-dark);
}

/* Dark Mode Theme (High-Tech Clinical Slate & Charcoal) */
[data-theme="dark"] {
  --theme: dark;
  --bg-dark: #080c14;
  --bg-base: #0b0f17;
  --bg-deep: #06090f;
  --bg-card: #111827;
  --bg-card-hover: #172235;
  --bg-surface: #1e293b;
  --bg-elevated: #162032;
  --bg-contrast-dark: #05080e;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(194, 255, 114, 0.25);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-heading: var(--text-main);
  --text-body: var(--text-muted);
  --bg-card-subtle: var(--bg-elevated);
  --bg-main: var(--bg-base);

  --accent-lime: #c2ff72;
  --accent-lime-hover: #b4ed6c;
  --accent-lime-tint: rgba(194, 255, 114, 0.15);
  --accent-lime-text: #c2ff72;
  --accent-cyan: #34d399;
  --accent-teal: #2dd4bf;
  --accent-teal-deep: #14b8a6;
  --accent-teal-glow: rgba(45, 212, 191, 0.25);
  
  --hazard-amber: #f59e0b;
  --hazard-amber-glow: rgba(245, 158, 11, 0.2);
  --bio-crimson: #ef4444;
  --bio-crimson-glow: rgba(239, 68, 68, 0.2);
  --safe-emerald: #10b981;
  --safe-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-emerald: var(--safe-emerald);
  --neutral-contrast: var(--bg-contrast-dark);

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 4px 20px rgba(194, 255, 114, 0.18);
  --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: var(--shadow-card);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
}

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


@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  /* Preserve subtle, non-vestibular state feedback (color, opacity, background) for interactive elements */
  a,
  button,
  input,
  select,
  textarea,
  .btn,
  .nav-link,
  .dropdown-link-row,
  .faq-question,
  .search-modal-backdrop,
  .mobile-drawer {
    transition-property: background-color, border-color, color, opacity, box-shadow !important;
    transition-duration: 0.15s !important;
    transform: none !important;
  }
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: light dark;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Technical Blueprint Grid & Ambient Mesh Background */
.bg-grid-pattern {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse 90% 40% at 50% -5%, rgba(194, 255, 114, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.03) 0%, transparent 40%),
    linear-gradient(to right, rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  background-position: center top, center center, center center, center center;
}

[data-theme="dark"] .bg-grid-pattern {
  background-color: #0b0f17;
  background-image: 
    radial-gradient(ellipse 90% 40% at 50% -5%, rgba(194, 255, 114, 0.09) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(20, 184, 166, 0.05) 0%, transparent 40%),
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  background-position: center top, center center, center center, center center;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  border-color: var(--accent-lime);
  background: var(--bg-card-hover);
  color: var(--text-main);
  box-shadow: 0 0 12px var(--border-glow);
}
.theme-toggle-btn svg {
  transition: transform var(--transition-fast);
}
.theme-toggle-btn:hover svg {
  transform: rotate(15deg);
}

/* Toggle Sun/Moon Icon visibility based on theme */
[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}
:root:not([data-theme="dark"]) .theme-toggle-btn .sun-icon {
  display: none;
}
:root:not([data-theme="dark"]) .theme-toggle-btn .moon-icon {
  display: block;
}

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

h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.3vw, 1.85rem); }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Emergency Dispatch Top Bar */
.emergency-topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  padding: 0.35rem 0;
  color: #e2e8f0;
  border-top: 2px solid;
  border-image: linear-gradient(90deg, #c2ff72, #84cc16, #10b981, #0ea5e9) 1;
}
[data-theme="dark"] .emergency-topbar {
  background: #06090e;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.emergency-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  min-height: 28px;
}
.emergency-status {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(194, 255, 114, 0.18);
  border: 1px solid rgba(194, 255, 114, 0.45);
  flex-shrink: 0;
}
.status-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c2ff72;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #c2ff72;
  box-shadow: 0 0 8px #c2ff72;
  animation: pulse-lime 1.8s infinite;
}
@keyframes pulse-lime {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(194, 255, 114, 0.7); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 5px rgba(194, 255, 114, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(194, 255, 114, 0); }
}
.emergency-title {
  color: #cbd5e1;
  font-size: 0.76rem;
  white-space: nowrap;
}
.emergency-contact-group {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.crisis-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #38bdf8;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.crisis-badge {
  font-size: 0.64rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
}
.crisis-link:hover {
  color: #ffffff;
}
.topbar-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  user-select: none;
}
.hotline-link {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(194, 255, 114, 0.2);
  border: 1px solid rgba(194, 255, 114, 0.45);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.hotline-link:hover {
  background: #c2ff72;
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(194, 255, 114, 0.5);
}

/* Sticky Glass Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(253, 253, 251, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
}
[data-theme="dark"] .site-header {
  background: rgba(11, 15, 23, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.site-header.scrolled {
  background: rgba(253, 253, 251, 0.98);
  border-bottom-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .site-header.scrolled {
  background: rgba(11, 15, 23, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
}
.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 1.25rem;
}

/* Brand Identity */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.brand-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: inherit;
  position: relative;
  z-index: 2;
  transition: all var(--transition-fast);
}
.brand-logo:hover .brand-icon {
  transform: scale(1.04);
  filter: brightness(1.1);
}
.brand-glow {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(194, 255, 114, 0.5);
  filter: blur(10px);
  z-index: 1;
}
.brand-text-group {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.15;
}
.text-gradient-teal {
  color: var(--accent-teal);
}
[data-theme="dark"] .text-gradient-teal {
  color: var(--accent-lime);
}
.brand-subtext {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.brand-badge {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(194, 255, 114, 0.25);
  color: #166534;
  border: 1px solid rgba(132, 204, 22, 0.4);
  margin-left: 0.2rem;
}

/* Desktop Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}
.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-lime);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-lime-tint);
}
.dropdown-chevron {
  transition: transform 0.22s ease;
  color: var(--text-dim);
}
.nav-dropdown-item:hover .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--accent-teal);
}
.nav-micro-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  background: var(--accent-lime-tint);
  color: var(--accent-lime-text);
  border: 1px solid var(--accent-lime);
}
.nav-micro-tag.tag-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

/* Header Action Controls */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 9999px;
  padding: 0.38rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.header-search-btn:hover {
  border-color: var(--accent-lime);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: 0 0 16px var(--border-glow);
}
.search-btn-label {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.search-btn-kbd {
  font-size: 0.68rem;
  font-family: monospace;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  color: var(--text-muted);
}
.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.95rem;
  white-space: nowrap;
}

/* Animated Hamburger Toggle */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mobile-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-lime);
}
.hamburger-box {
  width: 18px;
  height: 13px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* Dedicated Mobile Drawer */
.mobile-drawer {
  display: none;
}

/* Buttons (cta.gallery & reference match) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-lime);
  color: #111827;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(194, 255, 114, 0.45);
  border: 1px solid rgba(163, 230, 53, 0.8);
}
.btn-primary:hover {
  background: var(--accent-lime-hover);
  box-shadow: 0 6px 20px rgba(194, 255, 114, 0.6);
  transform: translateY(-1px);
  color: #0f172a;
}
.btn-emergency {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  border: 1px solid #b91c1c;
}
.btn-emergency:hover {
  background: #b91c1c;
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-lime);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border-medium);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-lime);
  color: var(--text-main);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}
.btn-lg {
  padding: 0.95rem 1.85rem;
  font-size: 1.05rem;
}
.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--accent-lime);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 5rem 0 4.5rem;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%);
}
.hero-backdrop-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 248, 245, 0.96) 80%, #f8f8f5 100%),
    radial-gradient(circle at 50% 20%, rgba(194, 255, 114, 0.22) 0%, transparent 60%),
    url('https://images.unsplash.com/photo-1584634731339-252c581abfc5?auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center 30%;
  opacity: 0.4;
  z-index: 1;
}
[data-theme="dark"] .hero-backdrop-image {
  background-image: 
    linear-gradient(180deg, rgba(11, 15, 23, 0.88) 0%, rgba(11, 15, 23, 0.96) 80%, #0b0f17 100%),
    radial-gradient(circle at 50% 20%, rgba(194, 255, 114, 0.12) 0%, transparent 60%),
    url('https://images.unsplash.com/photo-1584634731339-252c581abfc5?auto=format&fit=crop&w=1920&q=80');
  opacity: 0.55;
}
.hero-badge-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 2;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-teal);
  box-shadow: var(--shadow-card);
}
.hero-badge-tag {
  background: var(--accent-lime);
  color: #111827;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.hero-title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text-main);
}
.hero-subtitle {
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.65;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
}

/* Quick Search Hero Bar */
.hero-search-box {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  position: relative;
}
.hero-search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.55rem 0.65rem 0.55rem 1.35rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}
.hero-search-input-wrapper:focus-within {
  border-color: #84cc16;
  box-shadow: 0 0 25px rgba(194, 255, 114, 0.4);
}
.hero-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-main);
  padding: 0.5rem 0;
}
.hero-search-input::placeholder {
  color: var(--text-dim);
}
.search-shortcut-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-right: 0.75rem;
}
.hero-search-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.95rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.search-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.22rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-fast);
}
.search-chip:hover {
  background: var(--accent-lime);
  color: #111827;
  border-color: var(--accent-lime-hover);
}
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* Real-Time Telemetry Stats Strip */
.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  margin-top: 3rem;
  box-shadow: var(--shadow-card);
}
@media (max-width: 900px) {
  .telemetry-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
  }
}
@media (max-width: 480px) {
  .telemetry-strip {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
}
.telemetry-item {
  text-align: center;
}
.telemetry-num {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}
.telemetry-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Trust Bar */
.trust-bar {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 1.5rem 0;
}
.trust-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.trust-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.trust-items {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-hover);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.trust-badge-item svg {
  color: var(--safe-emerald);
}

/* Section Header */
.section-header {
  margin-bottom: 3rem;
}
.section-header.text-center {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.section-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-lime-text);
  background: var(--accent-lime-tint);
  border: 1px solid var(--accent-lime);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}
.section-title {
  margin-bottom: 0.85rem;
  color: var(--text-main);
}
.section-desc {
  font-size: 1.08rem;
  color: var(--text-muted);
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2.25rem;
}

/* Pillar Cards */
.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.pillar-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-lime);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.12);
}
.pillar-card-photo-header {
  position: relative;
  height: 210px;
  overflow: hidden;
  background-color: var(--bg-elevated);
}
.pillar-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.pillar-card:hover .pillar-card-img {
  transform: scale(1.05);
}
.pillar-photo-scrim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(255, 255, 255, 0.85) 90%, var(--bg-card) 100%);
}
[data-theme="dark"] .pillar-photo-scrim {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(17, 24, 39, 0.85) 90%, var(--bg-card) 100%);
}
.pillar-photo-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
}
.pillar-photo-badge .hazard-level-pill {
  background: rgba(11, 15, 23, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.pillar-photo-badge .pill-extreme {
  border-color: rgba(248, 113, 113, 0.6) !important;
  color: #fca5a5 !important;
}
.pillar-photo-badge .pill-high {
  border-color: rgba(251, 191, 36, 0.6) !important;
  color: #fde68a !important;
}
.pillar-photo-badge .pill-moderate {
  border-color: rgba(74, 222, 128, 0.6) !important;
  color: #86efac !important;
}
.pillar-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.pillar-title {
  font-size: 1.32rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--text-main);
}
.pillar-title a:hover {
  color: var(--accent-teal);
}
.pillar-desc {
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
  color: var(--text-muted);
}
.pillar-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}
.meta-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}
.pillar-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}
.read-time {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.card-link-arrow {
  color: var(--accent-teal);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.pillar-card:hover .card-link-arrow {
  transform: translateX(4px);
}

/* Sub-Cards */
.sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}
.sub-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-lime);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Hazard Level Badges */
/* Hazard Level Badges & Tags */
.hazard-level-pill,
.hazard-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill-minor { 
  background: rgba(16, 185, 129, 0.12); 
  color: var(--safe-emerald); 
  border: 1px solid rgba(16, 185, 129, 0.3); 
}
.pill-moderate { 
  background: rgba(217, 119, 6, 0.12); 
  color: var(--hazard-amber); 
  border: 1px solid rgba(217, 119, 6, 0.3); 
}
.pill-critical,
.pill-extreme { 
  background: rgba(220, 38, 38, 0.12); 
  color: var(--bio-crimson); 
  border: 1px solid rgba(220, 38, 38, 0.3); 
}
.pill-high { 
  background: rgba(217, 119, 6, 0.12); 
  color: var(--hazard-amber); 
  border: 1px solid rgba(217, 119, 6, 0.3); 
}

/* High-Contrast Photo Card Badges (Frosted Dark Glass) */
.photo-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(11, 15, 23, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.photo-card-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.photo-card-badge .dot-green { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.8); }
.photo-card-badge .dot-amber { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.photo-card-badge .dot-red { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.8); }
.photo-card-badge .dot-lime { background: #c2ff72; box-shadow: 0 0 8px rgba(194, 255, 114, 0.8); }
.photo-card-badge .dot-cyan { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.8); }

/* Top Photo Card Scrim to guarantee contrast */
.photo-top-scrim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 75px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 60%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Clutter Matrix Component */
.matrix-section {
  padding: 5rem 0;
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.matrix-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}
.matrix-tabs {
  display: flex;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.matrix-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.matrix-tab-btn:hover {
  border-color: var(--accent-lime);
  color: var(--text-main);
}
.matrix-tab-btn.active {
  background: var(--accent-lime);
  color: #111827;
  border-color: var(--accent-lime-hover);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(194, 255, 114, 0.45);
}
.matrix-panel {
  display: none;
}
.matrix-panel.active {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.matrix-details h4 {
  font-size: 1.45rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
.matrix-details p {
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
  color: var(--text-muted);
}
.matrix-specs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.matrix-specs-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  color: var(--text-main);
}
.matrix-badge-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.matrix-badge-icon.warn { background: #fef3c7; color: #b45309; }
.matrix-badge-icon.danger { background: #fee2e2; color: #b91c1c; }
.matrix-badge-icon.info { background: #dcfce7; color: #166534; }

.matrix-visual-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.matrix-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.matrix-stat-block {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
}
.matrix-stat-label {
  color: var(--text-dim);
}
.matrix-stat-val {
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Immersive CTA Banner (Contrast Slate Forest Section with Lime Button) */
.cta-banner-section {
  padding: 5.5rem 0;
}
.cta-card {
  background: 
    linear-gradient(135deg, rgba(27, 37, 41, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%),
    radial-gradient(circle at 100% 0%, rgba(194, 255, 114, 0.25) 0%, transparent 60%),
    url('https://images.unsplash.com/photo-1582268611958-ebfd161ef9cf?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(194, 255, 114, 0.35);
  border-radius: var(--radius-lg);
  padding: 4rem 3.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
}
.cta-content {
  max-width: 720px;
}
.cta-title {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  margin-bottom: 1.1rem;
  color: #ffffff;
}
.cta-desc {
  font-size: 1.1rem;
  margin-bottom: 2.25rem;
  color: #cbd5e1;
}
.cta-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Clean Live Search Modal */
.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1.5rem;
}
.search-modal-backdrop.open {
  display: flex;
}
.search-modal {
  width: 100%;
  max-width: 680px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 70px -15px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: modal-drop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-drop {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.search-modal-header {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.85rem;
}
.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1.15rem;
  font-family: var(--font-body);
}
.search-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}
.search-results-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.85rem;
  list-style: none;
}
.search-result-item {
  display: block;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  text-decoration: none;
}
.search-result-item:hover {
  background: var(--bg-card-hover);
}
.search-result-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.search-result-cat {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-teal);
  text-transform: uppercase;
}
.search-result-snippet {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.search-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* Grounding Slate Forest Footer */
.site-footer {
  background: var(--bg-contrast-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5rem 0 2.5rem;
  margin-top: auto;
  color: #e2e8f0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr;
  gap: 3.5rem;
  margin-bottom: 3.5rem;
}
.footer-brand p {
  font-size: 0.92rem;
  margin-top: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 340px;
  color: #94a3b8;
}
.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 1.35rem;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-links a {
  font-size: 0.88rem;
  color: #cbd5e1;
}
.footer-links a:hover {
  color: var(--accent-lime);
}
.footer-disclaimer {
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 2.25rem;
  line-height: 1.6;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
  color: #94a3b8;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .matrix-panel.active {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1280px) {
  .nav-links {
    gap: 0.95rem;
  }
  .nav-link {
    font-size: 0.84rem;
  }
  .search-btn-label, .search-btn-kbd {
    display: none;
  }
  .header-search-btn {
    padding: 0;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  .btn-header-cta {
    padding: 0.38rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 1100px) {
  .nav-links {
    display: none !important;
  }
  .mobile-toggle {
    display: flex !important;
  }
  .btn-header-cta {
    display: none;
  }
  .emergency-title {
    display: none;
  }

  /* Dedicated Mobile Drawer */
  .mobile-drawer {
    display: block;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-medium);
    z-index: 999;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }
  .mobile-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .mobile-drawer-inner {
    padding: 1.5rem 1.25rem 3rem;
    max-width: 600px;
    margin: 0 auto;
  }
  .mobile-search-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 0.88rem;
    cursor: pointer;
    margin-bottom: 1.25rem;
    transition: all var(--transition-fast);
  }
  .mobile-search-btn:hover {
    border-color: var(--accent-lime);
    color: var(--text-main);
    background: var(--bg-card);
  }
  .mobile-nav-group {
    margin-bottom: 1.25rem;
  }
  .mobile-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
  }
  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.45rem;
    transition: all var(--transition-fast);
  }
  .mobile-nav-link:hover {
    background: var(--bg-card);
    border-color: var(--accent-lime);
    color: var(--text-main);
    transform: translateX(3px);
  }
  .mobile-nav-link.highlight {
    background: var(--accent-lime-tint);
    border-color: var(--accent-lime);
    font-weight: 600;
  }
  .mobile-link-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }
  .mobile-icon {
    font-size: 1rem;
  }
  .mobile-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-lime-text);
    background: var(--accent-lime-tint);
    border: 1px solid var(--accent-lime);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
  }
  .mobile-tag.tag-purple {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
  }
  .nav-micro-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }
  .dot-amber { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
  .dot-red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
  .dot-teal { background: #16a34a; box-shadow: 0 0 6px #16a34a; }
  .dot-green { background: #10b981; box-shadow: 0 0 6px #10b981; }
  .dot-purple { background: #a855f7; box-shadow: 0 0 6px #a855f7; }
  .dot-slate { background: #94a3b8; box-shadow: 0 0 6px #94a3b8; }
  .dot-blue { background: #0ea5e9; box-shadow: 0 0 6px #0ea5e9; }

  .mobile-emergency-card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
  }
  .emergency-card-badge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--bio-crimson);
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
  }
  .emergency-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
  }
  .emergency-card-p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.85rem;
  }
}

@media (max-width: 580px) {
  .crisis-link {
    display: none;
  }
  .emergency-topbar-inner {
    justify-content: space-between;
  }
  .brand-subtext {
    display: none;
  }
  .brand-badge {
    display: none;
  }
}
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-section {
    padding: 3.5rem 0 2.5rem;
  }
  .cta-card {
    padding: 2.5rem 1.75rem;
  }
}

/* Floating Back-to-Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-normal);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-lime);
  border-color: var(--accent-lime-hover);
  color: #111827;
  box-shadow: 0 12px 30px -4px rgba(194, 255, 114, 0.4);
}
.back-to-top:active {
  transform: scale(0.95);
}

/* Homepage Cost Calculators Grid */
.home-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.home-calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.home-calc-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-hover);
}
.home-calc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.home-calc-range {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-teal);
}
.home-calc-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}
.home-calc-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-calc-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}
.home-calc-cta {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-teal);
}



/* Streamlined Protocols Dropdown */
.nav-dropdown-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}
.mega-menu-container {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 620px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-subtle);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1050;
}
.mega-menu-container::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.nav-dropdown-item:hover .mega-menu-container,
.nav-dropdown-item:focus-within .mega-menu-container {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.mega-menu-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.dropdown-column {
  display: flex;
  flex-direction: column;
}
.dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dropdown-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.dropdown-link-row:hover {
  background: var(--bg-elevated);
  transform: translateX(3px);
}
.dropdown-icon-pill {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}
.dropdown-item-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}
.dropdown-item-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
}
.dropdown-promo-box {
  display: block;
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.dropdown-promo-box:hover {
  border-color: var(--accent-teal);
}
.dropdown-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

/* Article Rich Text Styling (Educational Articles) */
.article-rich-text h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.article-rich-text h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
}
.article-rich-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.75;
}
.article-rich-text strong,
.article-rich-text b {
  color: var(--text-main);
  font-weight: 700;
}
.article-rich-text ul,
.article-rich-text ol {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}
.article-rich-text li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}
.article-rich-text a {
  color: var(--accent-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
[data-theme="dark"] .article-rich-text a {
  color: #5eead4;
}


/* ==========================================================================
   Universal FAQ Accordion Component
   ========================================================================== */
.faq-card,
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.faq-header,
.faq-question-btn,
.faq-question {
  cursor: pointer;
  user-select: none;
}
.faq-header * {
  pointer-events: none;
}

/* Universal Clickable Cards */
.situation-card,
.pillar-card,
.home-calc-card,
.guide-card,
.case-study-card,
.checklist-card,
.resource-card,
.workflow-step-card,
.tool-card-box {
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.situation-card:hover,
.pillar-card:hover,
.home-calc-card:hover,
.guide-card:hover,
.case-study-card:hover,
.checklist-card:hover,
.resource-card:hover,
.workflow-step-card:hover,
.tool-card-box:hover {
  transform: translateY(-2px);
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-hover);
}
.faq-card:hover,
.faq-item:hover {
  border-color: var(--border-glow);
}
.faq-card.open,
.faq-item.open {
  border-color: var(--accent-teal);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.faq-question-btn,
.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.25rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-icon,
.faq-icon-toggle {
  color: var(--accent-teal);
  font-size: 1.25rem;
  font-weight: 700;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.faq-card.open .faq-icon-toggle,
.faq-item.open .faq-icon-toggle {
  transform: rotate(180deg);
}

/* Craft Floor: Themed Browser Surfaces */
::selection {
  background: rgba(194, 255, 114, 0.38);
  color: var(--text-main);
}
[data-theme="dark"] ::selection {
  background: rgba(194, 255, 114, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.tabular-nums, table, [data-tabular] {
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   Homepage Premium Polish & Visual Precision System
   ========================================================================== */

/* Hero Content Max-Width and Action Buttons */
.hero-content {
  max-width: 980px !important;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-action-btn {
  font-size: 0.98rem;
  font-weight: 700;
  padding: 0.82rem 1.5rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hero-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Precision Telemetry Console */
.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 1.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  margin-top: 3rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .telemetry-strip {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.telemetry-item {
  text-align: center;
  padding: 0.5rem 1.25rem;
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border-radius: 8px;
}

.telemetry-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

[data-theme="light"] .telemetry-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.telemetry-item:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}

.telemetry-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

[data-theme="dark"] .telemetry-kicker {
  color: #94a3b8;
}

.telemetry-num {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.telemetry-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

[data-theme="dark"] .telemetry-label {
  color: #cbd5e1;
}

/* Pulsing Status Dot */
.telemetry-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--safe-emerald);
  box-shadow: 0 0 8px var(--safe-emerald);
  animation: pulseBeacon 2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--safe-emerald); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Interactive Flagship Tools Accents */
.tool-accent-emerald:hover {
  border-color: var(--safe-emerald) !important;
  box-shadow: 0 16px 32px -10px rgba(16, 185, 129, 0.18) !important;
}

.tool-accent-lime:hover {
  border-color: var(--accent-lime) !important;
  box-shadow: 0 16px 32px -10px rgba(194, 255, 114, 0.18) !important;
}

.tool-accent-cyan:hover {
  border-color: #0ea5e9 !important;
  box-shadow: 0 16px 32px -10px rgba(14, 165, 233, 0.18) !important;
}

.tool-accent-purple:hover {
  border-color: #a855f7 !important;
  box-shadow: 0 16px 32px -10px rgba(168, 85, 247, 0.18) !important;
}

/* Universal Clickable Cards */
.clickable-card {
  cursor: pointer !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.clickable-card:hover {
  transform: translateY(-3px) !important;
}

/* Step badges for 4-step journey */
.step-number-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-lime);
  color: #022c22 !important;
  font-weight: 800;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(194, 255, 114, 0.3);
}

@media (max-width: 900px) {
  .telemetry-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    padding: 1.25rem !important;
  }
  .telemetry-item:nth-child(2) {
    border-right: none !important;
  }
  .telemetry-item:not(:last-child) {
    border-right: none !important;
  }
}

@media (max-width: 520px) {
  .telemetry-strip {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 1rem !important;
  }
  .telemetry-item {
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    padding-bottom: 0.75rem !important;
  }
  .telemetry-item:last-child {
    border-bottom: none !important;
  }
}


/* ==========================================================================
   GLOBAL COMPREHENSIVE MOBILE & CANVAS RESPONSIVENESS ENGINE
   Guarantees zero horizontal overflow, perfectly fitted cards, and touch ergonomics.
   ========================================================================== */

/* Universal Card Box Class */
.content-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Universal Table Wrapper for Smooth Touch Scrolling */
.table-responsive-wrapper,
.table-responsive,
.clean-table-wrap,
.table-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: block !important;
  position: relative !important;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.table-responsive-wrapper table,
.table-responsive table,
.clean-table-wrap table,
.table-container table {
  min-width: 580px;
  width: 100%;
  border-collapse: collapse;
}

/* Calculator & Tool Workspaces */
.calc-workspace-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.calc-controls-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.calc-output-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.06);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.calc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.solver-workspace-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Medium Tablets & Below (<= 880px) */
@media (max-width: 880px) {
  .calc-workspace-grid,
  .solver-workspace-grid,
  #solverWorkspace {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }
  .calc-output-card,
  .sticky-results-pane,
  #resultsPane {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Small Tablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .home-calc-grid,
  .addons-grid,
  .checklist-cards-grid,
  .articles-grid,
  #articlesGrid,
  .matrix-panel.active {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Universal scaling for inline minmax grids that blow out canvas */
  [style*="minmax(310px"],
  [style*="minmax(320px"],
  [style*="minmax(340px"],
  [style*="minmax(350px"],
  [style*="minmax(360px"],
  [style*="minmax(420px"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Responsive card padding */
  .content-card-box,
  [style*="padding: 2.25rem"],
  [style*="padding: 2.5rem"] {
    padding: 1.6rem 1.25rem !important;
    border-radius: 14px !important;
  }
}

/* Standard & Small Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .content-card-box,
  [style*="padding: 2.25rem"],
  [style*="padding: 2.5rem"],
  [style*="padding: 2rem"] {
    padding: 1.25rem 0.95rem !important;
    border-radius: 12px !important;
  }

  .calc-output-card {
    padding: 1.25rem 0.95rem !important;
  }

  section {
    margin-bottom: 3.5rem !important;
  }

  /* Minmax protector for narrower grids */
  [style*="minmax(280px"],
  [style*="minmax(260px"],
  [style*="minmax(240px"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Coi Schematic Grid in contractor guide */
  .coi-schematic-grid > div,
  [style*="repeat(12, 1fr)"] > div {
    grid-column: span 12 !important;
  }
}

/* Compact Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .content-card-box,
  [style*="padding: 2.25rem"],
  [style*="padding: 2.5rem"],
  [style*="padding: 2rem"] {
    padding: 1.1rem 0.8rem !important;
    border-radius: 10px !important;
  }

  .calc-metrics-grid,
  .interview-flags-grid,
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  /* Form control safety (exclude checkboxes, radios, and buttons) */
  select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea {
    font-size: 16px !important; /* Prevents iOS safari zoom */
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Strict sizing for checkboxes and radios so flex containers never stretch them */
  input[type="checkbox"],
  input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    cursor: pointer;
  }

  /* Button full width on compact mobile when stacked */
  .hero-action-btn,
  .btn-mobile-full {
    width: 100% !important;
    justify-content: center;
  }

  /* Stain solver buttons */
  #soilButtons,
  #substrateButtons,
  [style*="minmax(170px"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .solver-select-btn {
    padding: 0.6rem 0.4rem !important;
    font-size: 0.8rem !important;
  }
}

/* Guarantee Astro Dev Toolbar is hidden from screenshots and presentations */
astro-dev-toolbar,
#astro-dev-toolbar,
[data-astro-dev-toolbar] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ==========================================================================
   MARKET BENCHMARKS & OFFICE SCOPE DUAL DESKTOP/MOBILE COMPONENT SYSTEM
   ========================================================================== */

.market-cards-mobile,
.office-scope-mobile {
  display: none;
  flex-direction: column;
  gap: 1.15rem;
}

.market-table-desktop,
.office-scope-desktop {
  display: block;
}

@media (max-width: 768px) {
  .market-table-desktop,
  .office-scope-desktop {
    display: none !important;
  }
  .market-cards-mobile,
  .office-scope-mobile {
    display: flex !important;
  }
  .market-mobile-card,
  .scope-mobile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    width: 100%;
  }
  .market-mobile-card-header,
  .scope-mobile-zone {
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .market-mobile-title,
  .scope-mobile-zone h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.25rem;
    line-height: 1.35;
  }
  .market-mobile-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: block;
    line-height: 1.4;
  }
  .market-mobile-rates,
  .scope-mobile-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .market-mobile-rate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-sizing: border-box;
  }
  .rate-tier-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
  }
  .tier-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .dot-tier1 {
    background: var(--accent-teal);
    box-shadow: 0 0 6px rgba(45, 212, 191, 0.5);
  }
  .dot-tier2 {
    background: var(--safe-emerald);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  }
  .dot-rural {
    background: var(--text-dim);
  }
  .rate-tier-price {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
  }
  .rate-tier1 .rate-tier-price {
    color: var(--accent-teal);
  }
  .rate-tier2 .rate-tier-price {
    color: var(--safe-emerald);
  }
  .rate-rural .rate-tier-price {
    color: var(--text-muted);
  }

  /* Commercial Office Scope mobile cards */
  .scope-zone-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-teal);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
  }
  .scope-task-block {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
  }
  .scope-task-block p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
  }
  .scope-frequency-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .tag-daily { color: var(--accent-teal); }
  .tag-weekly { color: var(--accent-cyan); }
  .tag-monthly { color: var(--safe-emerald); }
}

/* ==========================================================================
   Header & Navigation Global Styles
   ========================================================================== */
  .header-utility-bar {
    background: #090d16;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    padding: 0.35rem 0;
    color: #e2e8f0;
    border-top: 2px solid;
    border-image: linear-gradient(90deg, #c2ff72, #10b981, #0ea5e9, #818cf8) 1;
  }
  [data-theme="dark"] .header-utility-bar {
    background: #05080f;
    border-bottom-color: rgba(255, 255, 255, 0.07);
  }
  .utility-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 28px;
  }
  .utility-left {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .utility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.12rem 0.5rem;
    border-radius: 9999px;
    background: rgba(194, 255, 114, 0.15);
    border: 1px solid rgba(194, 255, 114, 0.4);
    flex-shrink: 0;
  }
  .utility-badge-text-full {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c2ff72;
    display: inline;
  }
  .utility-badge-text-short {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c2ff72;
    display: none;
  }
  .utility-tagline {
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
  }
  .utility-compliance-tag {
    color: #94a3b8;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    white-space: nowrap;
  }
  .utility-right {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .utility-pipe-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    user-select: none;
  }
  .utility-top-link {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: color var(--transition-fast);
  }
  .utility-top-link:hover {
    color: #f1f5f9;
  }
  .utility-highlight-btn {
    color: #c2ff72;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(194, 255, 114, 0.12);
    border: 1px solid rgba(194, 255, 114, 0.35);
    transition: all var(--transition-fast);
  }
  .utility-highlight-btn:hover {
    background: #c2ff72;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(194, 255, 114, 0.4);
  }

  /* Navigation Dropdown Base */
  .nav-dropdown-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
  }
  .dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
  }
  .dropdown-chevron {
    transition: transform 0.2s ease;
  }
  .nav-dropdown-item:hover .dropdown-chevron,
  .nav-dropdown-item:focus-within .dropdown-chevron,
  .nav-dropdown-item.open .dropdown-chevron {
    transform: rotate(180deg);
    color: var(--accent-teal);
  }

  /* Protocols 2-Column Mega Menu */
  .mega-menu-container {
    position: absolute;
    top: calc(100% + 6px);
    left: -40px;
    width: 860px;
    max-width: 95vw;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 24px 55px -10px rgba(0, 0, 0, 0.38), 0 0 0 1px var(--border-subtle);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
  }
  .mega-menu-container::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
  }
  .nav-dropdown-item:hover .mega-menu-container,
  .nav-dropdown-item:focus-within .mega-menu-container,
  .nav-dropdown-item.open .mega-menu-container {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .mega-menu-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }
  .dropdown-column {
    display: flex;
    flex-direction: column;
  }
  .mega-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  .dropdown-link-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .dropdown-link-row:hover {
    background: var(--bg-elevated);
    transform: translateX(3px);
  }
  .dropdown-icon-pill {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
  }
  .dropdown-item-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }
  .dropdown-item-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.3;
  }
  .protocol-code-badge {
    font-size: 0.62rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 0.08rem 0.32rem;
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--safe-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
  }
  .protocol-code-badge.badge-crisis {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
  }
  .mega-more-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-subtle);
  }
  .chips-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
  }
  .mega-chip {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease;
  }
  .mega-chip:hover {
    color: var(--accent-teal);
    border-color: var(--accent-teal);
    background: var(--bg-elevated);
  }
  .mega-view-all-link {
    display: inline-block;
    margin-top: 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-teal);
    text-decoration: none;
    transition: transform 0.15s ease;
  }
  .mega-view-all-link:hover {
    transform: translateX(3px);
  }
  .dropdown-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.15rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
  }
  .footer-directory-link {
    font-size: 0.82rem;
    color: var(--accent-teal);
    text-decoration: none;
  }
  .footer-compliance-text {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
  }

  /* Compact Single-Column Dropdowns */
  .dropdown-menu-compact {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 380px;
    max-width: 92vw;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 0.65rem;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border-subtle);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
  }
  .dropdown-menu-compact::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
  }
  .nav-dropdown-item:hover .dropdown-menu-compact,
  .nav-dropdown-item:focus-within .dropdown-menu-compact,
  .nav-dropdown-item.open .dropdown-menu-compact {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .nav-dropdown-item:last-child .dropdown-menu-compact {
    left: auto;
    right: 0;
    transform: translateY(8px);
  }
  .nav-dropdown-item:last-child:hover .dropdown-menu-compact,
  .nav-dropdown-item:last-child:focus-within .dropdown-menu-compact,
  .nav-dropdown-item:last-child.open .dropdown-menu-compact {
    transform: translateY(0);
  }

  /* Header Responsive Adjustments */
  @media (max-width: 1200px) {
    .utility-compliance-tag {
      display: none;
    }
    .mega-menu-container {
      width: 780px;
      left: -80px;
    }
  }
  @media (max-width: 1024px) {
    .mega-menu-container {
      width: 720px;
      left: -120px;
    }
  }
  @media (max-width: 992px) {
    .utility-tagline {
      display: none;
    }
  }
  @media (max-width: 680px) {
    .utility-compliance-tag,
    .utility-discretion,
    .utility-pipe-divider {
      display: none;
    }
    .utility-badge-text-full {
      display: none;
    }
    .utility-badge-text-short {
      display: inline;
    }
  }

  .hotline-text-short {
    display: none;
  }
  @media (max-width: 768px) {
    .nav-wrapper {
      gap: 0.5rem;
    }
    .nav-actions {
      gap: 0.45rem;
      flex-shrink: 0;
    }
    .site-header #themeToggleBtn {
      display: none;
    }
    .header-search-btn {
      min-width: 44px;
      min-height: 44px;
      width: 44px;
      height: 44px;
      padding: 0;
      justify-content: center;
    }
    .header-search-btn .search-btn-label,
    .header-search-btn .search-btn-kbd {
      display: none;
    }
  }

  @media (max-width: 580px) {
    .utility-bar-inner {
      padding: 0;
    }
    .utility-badge-text-full {
      display: none !important;
    }
    .utility-badge-text-short {
      display: inline !important;
    }
    .utility-highlight-btn {
      padding: 0.16rem 0.45rem;
      font-size: 0.72rem;
    }
    .utility-badge {
      padding: 0.1rem 0.4rem;
    }
  }

