/* US Water Systems Wiki - Main Stylesheet */
/* Dark theme with US Water brand colors */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Dark theme base (GitHub-style) */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --bg-tertiary: #21262d;
    --bg-hover: #262c36;
    --border-color: #30363d;
    --border-light: #444c56;
    
    /* Text colors */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #7a8590;
    --text-muted: #6e7681;
    --text-link: #58a6ff;
    --text-link-hover: #79c0ff;
    --border-highlight: rgba(88, 166, 255, 0.35);
    
    /* US Water Brand Colors */
    --brand-blue: #003060;        /* Berkeley Blue - Primary */
    --brand-blue-light: #24638E;  /* Lapis Lazuli - Secondary */
    --brand-red: #FC0322;         /* US Water Red - Accent */
    --brand-gray: #CCCCCC;
    
    /* Accent colors for dark mode */
    --accent-blue: #58a6ff;
    --accent-blue-dim: #388bfd;
    --accent-green: #3fb950;
    --accent-green-dim: #238636;
    --accent-red: #f85149;
    --accent-red-dim: #da3633;
    --accent-orange: #f0883e;
    --accent-orange-dim: #bd561d;
    --accent-purple: #a371f7;
    --accent-yellow: #d29922;
    
    /* Badge colors */
    --badge-city: #388bfd;
    --badge-city-bg: rgba(56, 139, 253, 0.15);
    --badge-well: #d29922;
    --badge-well-bg: rgba(210, 153, 34, 0.15);
    --badge-emerging: #f0883e;
    --badge-emerging-bg: rgba(240, 136, 62, 0.15);
    --badge-epa: #3fb950;
    --badge-epa-bg: rgba(63, 185, 80, 0.15);
    --badge-health: #f85149;
    --badge-health-bg: rgba(248, 81, 73, 0.15);
    --badge-residential: #79c0ff;
    --badge-residential-bg: rgba(121, 192, 255, 0.15);
    --badge-commercial: #a371f7;
    --badge-commercial-bg: rgba(163, 113, 247, 0.15);
    
    /* Category colors */
    --cat-symptoms: #f85149;
    --cat-contaminants: #f0883e;
    --cat-treatments: #3fb950;
    --cat-applications: #a371f7;
    --cat-systems: #58a6ff;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --font-family: 'Avenir Next LT Pro', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Layout */
    --max-width: 1400px;
    --sidebar-width: 280px;
    --header-height: 64px;

    /* Surface System (premium card aesthetic) */
    --surface-gradient: linear-gradient(135deg, #0a0f1a 0%, #003060 60%, #0a1628 100%);
    --surface-gradient-soft: linear-gradient(135deg, #12192a 0%, #1a2d4a 60%, #12192a 100%);
    --surface-border: rgba(88, 166, 255, 0.12);
    --surface-border-hover: rgba(88, 166, 255, 0.28);
    --surface-glow-blue: rgba(26, 109, 206, 0.35);
    --surface-glow-blue-soft: rgba(26, 109, 206, 0.08);
    --surface-glow-red: rgba(206, 44, 44, 0.18);
    --surface-glow-red-soft: rgba(206, 44, 44, 0.05);
    --surface-shimmer: linear-gradient(90deg, transparent 5%, var(--brand-red) 30%, var(--brand-red) 70%, transparent 95%);
    --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
    --transition-card: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(26, 109, 206, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 80% 100%, rgba(252, 3, 34, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

a:focus-visible,
button:focus-visible {
    outline-offset: 3px;
}

/* Selection */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: #fff;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand-blue-light); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-orange); }
.text-danger { color: var(--accent-red); }

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-xl) 0;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.92) 0%, rgba(22, 27, 34, 0.98) 100%);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--surface-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(88, 166, 255, 0.35) 50%, transparent 100%);
    pointer-events: none;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    height: 28px;
    width: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.header-brand-logo {
    height: 36px;
    max-height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
    max-width: 200px;
    opacity: 0.9;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.header-brand-logo:hover {
    opacity: 1;
}

.logo-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.logo-text .us {
    color: var(--brand-red);
}

.beta-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(88, 166, 255, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(88, 166, 255, 0.35);
    vertical-align: middle;
    margin-left: 6px;
    line-height: 1.4;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.mobile-search-container {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: all 0.15s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Category-specific nav colors */
.nav-link[data-category="symptoms"]:hover,
.nav-link[data-category="symptoms"].active { color: var(--cat-symptoms); }
.nav-link[data-category="contaminants"]:hover,
.nav-link[data-category="contaminants"].active { color: var(--cat-contaminants); }
.nav-link[data-category="treatments"]:hover,
.nav-link[data-category="treatments"].active { color: var(--cat-treatments); }
.nav-link[data-category="applications"]:hover,
.nav-link[data-category="applications"].active { color: var(--cat-applications); }
.nav-link[data-category="systems"]:hover,
.nav-link[data-category="systems"].active { color: var(--cat-systems); }

/* Explore Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-trigger .nav-chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-trigger .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--surface-glow-blue-soft);
    padding: var(--space-xs);
    z-index: 200;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-dropdown-item[data-category="symptoms"]:hover { color: var(--cat-symptoms); }
.nav-dropdown-item[data-category="contaminants"]:hover { color: var(--cat-contaminants); }
.nav-dropdown-item[data-category="treatments"]:hover { color: var(--cat-treatments); }
.nav-dropdown-item[data-category="applications"]:hover { color: var(--cat-applications); }
.nav-dropdown-item[data-category="systems"]:hover { color: var(--cat-systems); }

/* Tools nav button with glow */
.nav-tools-link {
    border: 1px solid rgba(88, 166, 255, 0.35);
    animation: glowPulse 3s ease-in-out infinite;
}

.nav-tools-link:hover {
    color: var(--accent-blue) !important;
    background-color: rgba(88, 166, 255, 0.1);
}

/* ============================================
   SEARCH
   ============================================ */
.search-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: 36px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all 0.15s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: var(--bg-card);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 400px;
    max-width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow: hidden;
    overflow-y: auto;
    display: none;
    z-index: 200;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
    overflow: hidden;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-hover);
    text-decoration: none;
}

.search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.search-result-category {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.search-result-description {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item.active-result,
.search-result-item.active-result:hover {
    background-color: var(--accent-blue-dim);
    background-color: rgba(56, 139, 253, 0.2);
}

.search-result-title strong {
    color: var(--accent-blue);
    font-weight: 700;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs,
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--text-link);
}

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

.breadcrumb-current {
    color: var(--text-primary);
}

/* Normalize bare breadcrumb children (no wrapper spans) */
.breadcrumb > a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb > a:hover {
    color: var(--text-link);
}

.breadcrumb > span {
    color: var(--text-muted);
}

.breadcrumb > span:last-child {
    color: var(--text-primary);
}

/* ============================================
   SURFACE SYSTEM (premium card utilities)
   ============================================ */
.surface-card {
    position: relative;
    background: var(--surface-gradient);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-card);
}

.surface-card--soft {
    background: var(--surface-gradient-soft);
}

.surface-card--accent-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--surface-shimmer);
    z-index: 2;
    pointer-events: none;
}

.surface-card__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.surface-card__glow::before,
.surface-card__glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.surface-card__glow::before {
    top: -40%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, var(--surface-glow-blue-soft) 0%, transparent 70%);
    animation: heroShift 20s ease-in-out infinite alternate;
}

.surface-card__glow::after {
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(ellipse, var(--surface-glow-red-soft) 0%, transparent 70%);
    animation: heroShift 20s ease-in-out infinite alternate-reverse;
}

.surface-card--hover-lift {
    cursor: pointer;
}

.surface-card--hover-lift:hover {
    transform: translateY(-2px);
    border-color: var(--surface-border-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 40px var(--surface-glow-blue-soft);
}

/* Section heading with gradient underline */
.section-heading {
    position: relative;
    display: inline-block;
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.section-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-red), var(--accent-blue));
    border-radius: 2px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: var(--transition-card);
    position: relative;
}

.card:hover {
    border-color: var(--surface-border-hover);
    box-shadow: var(--shadow-md), 0 0 30px var(--surface-glow-blue-soft);
    transform: translateY(-1px);
}

.card-link {
    text-decoration: none;
    display: block;
}

.card-link:hover {
    text-decoration: none;
}

/* Category Cards (Homepage) */
.category-card {
    position: relative;
    overflow: hidden;
    padding: var(--space-xl);
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(22, 27, 34, 0.95) 100%);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.25s var(--ease-smooth), opacity 0.25s var(--ease-smooth);
    z-index: 1;
}

.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth);
    background: radial-gradient(circle at top, currentColor 0%, transparent 70%);
    mix-blend-mode: screen;
}

.category-card:hover {
    transform: translateY(-3px);
}

.category-card:hover::before {
    height: 6px;
}

.category-card:hover::after {
    opacity: 0.08;
}

.category-card[data-category="symptoms"] { color: var(--cat-symptoms); }
.category-card[data-category="contaminants"] { color: var(--cat-contaminants); }
.category-card[data-category="treatments"] { color: var(--cat-treatments); }
.category-card[data-category="applications"] { color: var(--cat-applications); }
.category-card[data-category="systems"] { color: var(--cat-systems); }

.category-card[data-category="symptoms"]::before { background-color: var(--cat-symptoms); }
.category-card[data-category="contaminants"]::before { background-color: var(--cat-contaminants); }
.category-card[data-category="treatments"]::before { background-color: var(--cat-treatments); }
.category-card[data-category="applications"]::before { background-color: var(--cat-applications); }
.category-card[data-category="systems"]::before { background-color: var(--cat-systems); }

.category-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.category-card:hover .category-icon {
    transform: scale(1.06);
    box-shadow: 0 0 30px currentColor;
}

.category-title,
.category-description,
.category-count {
    position: relative;
    z-index: 1;
}

.category-card[data-category="symptoms"] .category-icon { 
    background-color: rgba(248, 81, 73, 0.15); 
    color: var(--cat-symptoms);
}
.category-card[data-category="contaminants"] .category-icon { 
    background-color: rgba(240, 136, 62, 0.15); 
    color: var(--cat-contaminants);
}
.category-card[data-category="treatments"] .category-icon { 
    background-color: rgba(63, 185, 80, 0.15); 
    color: var(--cat-treatments);
}
.category-card[data-category="applications"] .category-icon { 
    background-color: rgba(163, 113, 247, 0.15); 
    color: var(--cat-applications);
}
.category-card[data-category="systems"] .category-icon { 
    background-color: rgba(88, 166, 255, 0.15); 
    color: var(--cat-systems);
}

.category-icon svg {
    width: 32px;
    height: 32px;
}

.category-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.category-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.category-count {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Item Cards (Index pages) */
.item-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    transition: var(--transition-card);
}

.item-card:hover {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.04) 0%, transparent 100%);
}

.item-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--bg-tertiary);
}

.item-card-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.item-card-content {
    flex: 1;
    min-width: 0;
}

.item-card-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.item-card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.item-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.15s var(--ease-smooth), box-shadow 0.15s var(--ease-smooth);
    letter-spacing: 0.02em;
}

.badge:hover {
    transform: translateY(-1px);
}

.badge-city {
    background-color: var(--badge-city-bg);
    color: var(--badge-city);
    border: 1px solid var(--badge-city);
}

.badge-well {
    background-color: var(--badge-well-bg);
    color: var(--badge-well);
    border: 1px solid var(--badge-well);
}

.badge-emerging {
    background-color: var(--badge-emerging-bg);
    color: var(--badge-emerging);
    border: 1px solid var(--badge-emerging);
}

.badge-epa {
    background-color: var(--badge-epa-bg);
    color: var(--badge-epa);
    border: 1px solid var(--badge-epa);
}

.badge-health {
    background-color: var(--badge-health-bg);
    color: var(--badge-health);
    border: 1px solid var(--badge-health);
}

.badge-residential {
    background-color: var(--badge-residential-bg);
    color: var(--badge-residential);
    border: 1px solid var(--badge-residential);
}

.badge-commercial {
    background-color: var(--badge-commercial-bg);
    color: var(--badge-commercial);
    border: 1px solid var(--badge-commercial);
}

.badge-neutral {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-highlight);
}
.badge-neutral:hover {
    background-color: var(--border-highlight);
    color: #fff;
}

/* MCL Badge */
.badge-mcl {
    font-family: var(--font-mono);
    font-size: 10px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.filter-btn {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--border-color);
    transition: var(--transition-card);
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--surface-border-hover);
    color: var(--text-primary);
    background-color: rgba(88, 166, 255, 0.06);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-blue-dim) 0%, var(--brand-blue-light) 100%);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 18px rgba(88, 166, 255, 0.28);
}

/* ============================================
   TABLES
   ============================================ */
.data-table {
    width: 100%;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.data-table th {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--surface-border);
}

.data-table td {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(88, 166, 255, 0.06);
    color: var(--text-primary);
}

.data-table .mcl {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.page-header {
    margin-bottom: var(--space-xl);
    position: relative;
    padding-bottom: var(--space-md);
}

.page-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-red), var(--accent-blue));
    border-radius: 2px;
}

.page-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.page-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    max-width: 720px;
    line-height: 1.5;
}

.page-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    letter-spacing: -0.005em;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
    border-radius: 2px;
}

.section-content {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.section-content ul,
.section-content ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.section-content li {
    margin-bottom: var(--space-sm);
    list-style: disc;
}

.section-content ol li {
    list-style: decimal;
}

/* Info Box */
.info-box {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    box-shadow: 0 0 18px currentColor;
    opacity: 0.6;
    pointer-events: none;
}

.info-box.info {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.14) 0%, rgba(88, 166, 255, 0.04) 100%);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.info-box.warning {
    background: linear-gradient(135deg, rgba(240, 136, 62, 0.14) 0%, rgba(240, 136, 62, 0.04) 100%);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.info-box.danger {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.14) 0%, rgba(248, 81, 73, 0.04) 100%);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.info-box.success {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.14) 0%, rgba(63, 185, 80, 0.04) 100%);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.info-box > * {
    position: relative;
    color: var(--text-primary);
}

.info-box-content,
.info-box p {
    color: var(--text-secondary);
}

.info-box-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.info-box-content {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

/* Quick Facts */
.quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.quick-fact {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    transition: var(--transition-card);
}

.quick-fact:hover {
    border-color: var(--surface-border-hover);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), 0 0 20px var(--surface-glow-blue-soft);
    transform: translateY(-1px);
}

.quick-fact-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.quick-fact-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.quick-fact-value.mono {
    font-family: var(--font-mono);
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.product-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-card);
    position: relative;
}

.product-card:hover {
    border-color: var(--surface-border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 40px var(--surface-glow-blue-soft);
}

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

.product-image {
    aspect-ratio: 4/3;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.product-image img {
    max-height: 100%;
    object-fit: contain;
}

.product-image svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
}

.product-info {
    padding: var(--space-md);
}

.product-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.product-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.product-specs {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 48, 96, 0.4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-top: var(--space-sm);
    transition: background-color 0.15s ease;
}

.product-link:hover {
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, var(--accent-blue) 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(0, 48, 96, 0.55);
}

/* ============================================
   SYSTEM NAV (Treatment → System links)
   ============================================ */
.system-nav {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.system-nav-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.system-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.system-nav-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    transition: var(--transition-card);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.system-nav-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-red), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.25s var(--ease-smooth);
}

.system-nav-card:hover {
    border-color: var(--surface-border-hover);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 30px var(--surface-glow-blue-soft);
    transform: translateY(-2px);
    text-decoration: none;
}

.system-nav-card:hover::before {
    opacity: 1;
}

.system-nav-card h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.system-nav-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.system-nav-card .system-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-xs) var(--space-md);
    background-color: var(--brand-blue);
    color: white;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    align-self: flex-start;
    margin-top: auto;
    transition: background-color 0.15s ease;
}

.system-nav-card:hover .system-nav-btn {
    background-color: var(--brand-blue-light);
}

/* System Nav — Horizontal pill/tab bar (used on sub-pages) */
nav.system-nav {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    background: transparent;
    border: none;
    padding: 0;
}

nav.system-nav .system-nav-link {
    display: inline-block;
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
}

nav.system-nav .system-nav-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-blue);
    background-color: rgba(88, 166, 255, 0.08);
    text-decoration: none;
}

nav.system-nav .system-nav-link.active {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background-color: rgba(88, 166, 255, 0.12);
}

/* Card CTA link text */
.card-cta {
    display: inline-block;
    margin-top: auto;
    padding-top: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent-blue);
}

/* System type cards — override product-link when used on a card */
a.card.product-link {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.15s ease;
}

a.card.product-link:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: var(--text-primary);
    background-color: var(--bg-card);
}

a.card.product-link h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

a.card.product-link .card-cta {
    color: var(--accent-blue);
}

/* ============================================
   CROSS-LINKS
   ============================================ */
.cross-links {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 48, 96, 0.3) 100%);
    border: 1px solid var(--surface-border);
    border-top: 2px solid var(--accent-blue);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    position: relative;
    overflow: hidden;
    overflow: hidden;
}

.cross-links::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(88, 166, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.cross-links-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cross-links-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 2px;
    flex-shrink: 0;
}

.cross-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.cross-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.cross-link:hover {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--text-link);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(88, 166, 255, 0.15);
}

.cross-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.18s ease;
}

.cross-link:hover svg {
    opacity: 1;
    color: var(--accent-blue);
}

/* ============================================
   FROM THE BLOG PANEL
   ============================================ */
.blog-panel {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 48, 96, 0.15) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.blog-panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--brand-red) 45%, var(--accent-blue) 55%, transparent 90%);
    opacity: 0.6;
    pointer-events: none;
}

.blog-panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.blog-panel-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.blog-panel-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.blog-panel-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    padding-left: 28px;
}

.blog-post-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.blog-post-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-card);
    position: relative;
}

.blog-post-item:hover {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.08) 0%, transparent 100%);
    transform: translateX(2px);
}

.blog-post-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 64px;
    font-family: var(--font-mono);
}

.blog-post-link {
    font-size: var(--font-size-sm);
    color: var(--text-link);
    text-decoration: none;
    line-height: 1.4;
}

.blog-post-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.blog-post-core {
    display: inline-block;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-yellow);
    margin-left: var(--space-xs);
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.blog-post-note {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
    padding-left: var(--space-sm);
}

@media (max-width: 768px) {
    .blog-post-item {
        flex-wrap: wrap;
    }
    .blog-post-note {
        display: none;
    }
    .blog-post-date {
        min-width: 56px;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #0a0f1a 100%);
    border-top: 1px solid var(--surface-border);
    padding: var(--space-xl) 0;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: var(--surface-shimmer);
    opacity: 0.5;
    pointer-events: none;
}

.site-footer::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: 50%;
    width: 60%;
    height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, var(--surface-glow-blue-soft) 0%, transparent 60%);
    pointer-events: none;
}

.footer-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-brand img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.footer-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-link {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.footer-link:hover {
    color: var(--text-link);
}

/* ============================================
   SVG PLACEHOLDER
   ============================================ */
.svg-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.svg-placeholder svg {
    width: 50%;
    height: 50%;
    max-width: 120px;
    max-height: 120px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu-btn {
    display: none;
    padding: var(--space-sm);
    color: var(--text-secondary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block;
        order: 99;
        margin-left: auto;
    }

    .header-brand-logo {
        display: none;
    }

    .header-inner > .search-container {
        display: none;
    }

    .mobile-search-container {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: var(--space-md);
    }
    
    .main-nav.active {
        display: flex;
    }

    .main-nav .mobile-search-container {
        position: relative;
        width: 100%;
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-md);
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav .mobile-search-container .search-input {
        width: 100%;
        padding: var(--space-md);
        padding-left: 40px;
        font-size: var(--font-size-base);
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
    }

    .main-nav .mobile-search-container .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(calc(-50% - var(--space-md) / 2));
        width: 18px;
        height: 18px;
        color: var(--text-muted);
        pointer-events: none;
    }

    .main-nav .mobile-search-container .search-results {
        position: absolute;
        top: calc(100% - var(--space-md) + 4px);
        left: 0;
        right: 0;
        z-index: 250;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        max-height: 300px;
        overflow-y: auto;
    }

    .logo .beta-badge {
        display: none;
    }

    .logo-text {
        font-size: var(--font-size-base);
    }
    
    .nav-link {
        width: 100%;
        padding: var(--space-md);
    }

    .nav-dropdown { width: 100%; }
    .nav-dropdown-trigger { width: 100%; }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 var(--space-md);
    }

    .nav-dropdown-item {
        padding: var(--space-sm) var(--space-md);
    }

    .nav-tools-link { width: 100%; }
}

/* ============================================
   GLOW PULSE ANIMATION
   ============================================ */
@keyframes glowPulse {
    0%   { box-shadow: 0 0 4px rgba(88, 166, 255, 0.3), 0 0 12px rgba(88, 166, 255, 0.1); border-color: rgba(88, 166, 255, 0.35); }
    50%  { box-shadow: 0 0 12px rgba(88, 166, 255, 0.5), 0 0 30px rgba(88, 166, 255, 0.2); border-color: rgba(88, 166, 255, 0.6); }
    100% { box-shadow: 0 0 4px rgba(88, 166, 255, 0.3), 0 0 12px rgba(88, 166, 255, 0.1); border-color: rgba(88, 166, 255, 0.35); }
}

.card-glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
    border: 1px solid rgba(88, 166, 255, 0.35);
}

.card-glow-pulse:hover {
    animation: none;
    box-shadow: 0 0 16px rgba(88, 166, 255, 0.5), 0 0 40px rgba(88, 166, 255, 0.2);
    border-color: rgba(88, 166, 255, 0.7);
}

/* Strong glow pulse — more noticeable for key cards */
@keyframes glowPulseStrong {
    0%   { box-shadow: 0 0 8px rgba(88, 166, 255, 0.4), 0 0 20px rgba(88, 166, 255, 0.15), 0 0 40px rgba(88, 166, 255, 0.05); border-color: rgba(88, 166, 255, 0.45); }
    50%  { box-shadow: 0 0 18px rgba(88, 166, 255, 0.6), 0 0 45px rgba(88, 166, 255, 0.3), 0 0 70px rgba(88, 166, 255, 0.1); border-color: rgba(88, 166, 255, 0.75); }
    100% { box-shadow: 0 0 8px rgba(88, 166, 255, 0.4), 0 0 20px rgba(88, 166, 255, 0.15), 0 0 40px rgba(88, 166, 255, 0.05); border-color: rgba(88, 166, 255, 0.45); }
}

.card-glow-pulse-strong {
    animation: glowPulseStrong 2.2s ease-in-out infinite;
    border: 1.5px solid rgba(88, 166, 255, 0.45);
}

.card-glow-pulse-strong:hover {
    animation: none;
    box-shadow: 0 0 24px rgba(88, 166, 255, 0.6), 0 0 60px rgba(88, 166, 255, 0.25);
    border-color: rgba(88, 166, 255, 0.8);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .search-container,
    .filter-bar {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .info-box {
        border: 1px solid #ccc;
        background: white;
    }
}

/* ============================================
   AUTHENTICATION UI
   ============================================ */

/* Auth content is hidden by default; auth.js reveals it on login */
.auth-content { display: none; }

/* Landing gate — shown to unauthenticated visitors */
.landing-gate {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.landing-gate::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(26,109,206,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 75% 60%, rgba(206,44,44,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 800px 500px at 50% 100%, rgba(26,109,206,0.08) 0%, transparent 60%);
    animation: heroShift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes heroShift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-3%, 2%) scale(1.05); }
    100% { transform: translate(2%, -2%) scale(1); }
}

.landing-gate > * {
    position: relative;
    z-index: 1;
}

.landing-hero {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

.landing-hero .logo-mark {
    height: 100px;
    margin-bottom: var(--space-md);
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: brightness(0) invert(1) drop-shadow(0 0 30px rgba(26,109,206,0.35)) drop-shadow(0 0 60px rgba(26,109,206,0.15));
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: brightness(0) invert(1) drop-shadow(0 0 30px rgba(26,109,206,0.35)) drop-shadow(0 0 60px rgba(26,109,206,0.15)); }
    50%      { filter: brightness(0) invert(1) drop-shadow(0 0 40px rgba(26,109,206,0.5)) drop-shadow(0 0 80px rgba(26,109,206,0.25)); }
}

.landing-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, #ffffff 0%, #c8ddf0 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.landing-hero h1 .us,
.hero-card__title .us {
    background: linear-gradient(135deg, #cc0018 0%, #e8102a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero .landing-subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.04em;
}

.landing-hero .landing-version {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-2xl);
}

/* Hero Card — OG-image-style branding card */
.hero-card {
    background: linear-gradient(135deg, #0a0f1a 0%, #003060 60%, #0a1628 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(88, 166, 255, 0.12);
    padding: 3rem 2.5rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 5%, var(--brand-red) 30%, var(--brand-red) 70%, transparent 95%);
}

.hero-card__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.hero-card__glow::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(26, 109, 206, 0.08) 0%, transparent 70%);
    animation: heroShift 20s ease-in-out infinite alternate;
}

.hero-card__glow::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(206, 44, 44, 0.05) 0%, transparent 70%);
    animation: heroShift 20s ease-in-out infinite alternate-reverse;
}

.hero-card__icon {
    position: relative;
    display: block;
    margin: 0 auto var(--space-lg);
    width: fit-content;
}

.hero-card__icon img {
    height: 90px;
    width: 90px;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.hero-card__icon::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 109, 206, 0.35) 0%, rgba(26, 109, 206, 0.08) 60%, transparent 80%);
    animation: iconGlow 4s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.08); }
}

.hero-card__title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.hero-card__title .us {
    color: var(--brand-red);
}

.hero-card__subtitle {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

.hero-card__domain {
    font-size: var(--font-size-sm);
    color: #58a6ff;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.hero-card__attrib {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

.hero-card__logo {
    height: 28px;
    width: auto;
    display: block;
    margin: 0 auto;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    .hero-card {
        padding: 2rem 1.5rem 1.5rem;
    }
    .hero-card__title {
        font-size: 2.5rem;
    }
    .hero-card__icon img {
        height: 70px;
        width: 70px;
    }
}

/* Sign In button (landing page) */
.landing-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 16px 48px;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #24638e 100%);
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 48, 96, 0.4), 0 0 40px rgba(26,109,206,0.1);
    position: relative;
    overflow: hidden;
}
.landing-signin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}
.landing-signin-btn:hover::before {
    left: 100%;
}
.landing-signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 48, 96, 0.5), 0 0 60px rgba(26,109,206,0.15);
    border-color: rgba(88, 166, 255, 0.5);
}

/* Divider between sign-in and request access */
.landing-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}
.landing-divider::before,
.landing-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Request Access form */
.request-access-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: left;
}

.request-access-card h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-md);
    text-align: center;
    color: var(--text-primary);
}

.request-access-card .form-field {
    margin-bottom: var(--space-md);
}

.request-access-card label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.request-access-card input,
.request-access-card select {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.request-access-card input:focus,
.request-access-card select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}
.request-access-card input::placeholder {
    color: var(--text-muted);
}

.request-access-card select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.request-access-card select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.request-access-submit {
    width: 100%;
    padding: 12px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--brand-red);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--space-sm);
}
.request-access-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.request-access-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form response messages */
.request-form-message {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    text-align: center;
}
.request-form-message--success {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: var(--accent-green);
}
.request-form-message--error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
}

/* ---- Header auth button ---- */

.auth-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.auth-header-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: rgba(88, 166, 255, 0.4);
}

.auth-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-btn {
    display: none;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.auth-logout-btn:hover {
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.4);
    background: rgba(248, 81, 73, 0.08);
}

/* User dropdown menu */
.auth-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 1000;
    padding: 6px 0;
}
.auth-menu-email {
    padding: 10px 16px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    word-break: break-all;
}
.auth-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}
.auth-menu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}
.auth-menu-item:hover {
    background: var(--bg-hover);
}
.auth-menu-item--danger {
    color: #f85149;
}
.auth-menu-item--danger:hover {
    background: rgba(248,81,73,0.08);
}

/* Change Password modal */
.pw-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.pw-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 90%;
}
.pw-modal h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
}
.pw-modal-field {
    margin-bottom: var(--space-md);
}
.pw-modal-field label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.pw-modal-field input {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}
.pw-modal-field input:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}
.pw-requirements {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-top: 4px;
}
.pw-modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}
.pw-modal-btn {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
}
.pw-modal-btn--cancel {
    color: var(--text-secondary);
    background: transparent;
    border-color: var(--border-color);
}
.pw-modal-btn--cancel:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.pw-modal-btn--submit {
    color: #fff;
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}
.pw-modal-btn--submit:hover {
    opacity: 0.9;
}
.pw-modal-btn--submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pw-modal-message {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
}
.pw-modal-message--success {
    background: rgba(63,185,80,0.1);
    color: #3fb950;
    border: 1px solid rgba(63,185,80,0.3);
}
.pw-modal-message--error {
    background: rgba(248,81,73,0.1);
    color: #f85149;
    border: 1px solid rgba(248,81,73,0.3);
}

/* Forgot password form on landing page */
.forgot-pw-link {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: color 0.15s;
}
.forgot-pw-link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}
.forgot-pw-form {
    margin-top: var(--space-md);
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.forgot-pw-form input {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    margin-bottom: var(--space-sm);
}
.forgot-pw-form input:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}
.forgot-pw-submit {
    width: 100%;
    padding: 10px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--brand-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity 0.15s;
}
.forgot-pw-submit:hover { opacity: 0.9; }
.forgot-pw-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.forgot-pw-message {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
}
.forgot-pw-message--success {
    background: rgba(63,185,80,0.1);
    color: #3fb950;
    border: 1px solid rgba(63,185,80,0.3);
}
.forgot-pw-message--error {
    background: rgba(248,81,73,0.1);
    color: #f85149;
    border: 1px solid rgba(248,81,73,0.3);
}

/* Hide auth buttons in header on mobile (login via landing page instead) */
@media (max-width: 900px) {
    .auth-header-controls {
        display: none;
    }
}

/* Landing page responsive */
@media (max-width: 640px) {
    .landing-hero h1 {
        font-size: 2.5rem;
    }
    .landing-hero .landing-subtitle {
        font-size: var(--font-size-base);
    }
    .request-access-card {
        padding: var(--space-lg);
    }
}

/* ============================================
   HOME PAGE — Hero search
   ============================================ */
.hero-search {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    z-index: 10;
}
.hero-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
}
.hero-search-input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    outline: none;
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.hero-search-input::placeholder {
    color: var(--text-muted);
}
.hero-search-input:focus {
    border-color: var(--accent-blue);
    background: rgba(13, 17, 23, 0.85);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18), 0 0 24px rgba(88, 166, 255, 0.15);
}
.hero-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    max-height: 360px;
    overflow-y: auto;
    display: none;
    z-index: 300;
    text-align: left;
}
.hero-search-results.active {
    display: block;
}
.hero-search-results .search-result-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
}
.hero-search-results .search-result-item:last-child {
    border-bottom: none;
}
.hero-search-results .search-result-item:hover {
    background-color: var(--bg-hover);
    text-decoration: none;
}
.hero-search-results .search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}
.hero-search-results .search-result-title strong {
    color: var(--accent-blue);
    font-weight: 700;
}
.hero-search-results .search-result-category {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}
.hero-search-results .search-result-description {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .container > div:first-child {
        grid-template-columns: 1fr !important;
    }
    .container > div:first-child .hero-banner {
        padding: 3rem var(--space-lg) !important;
    }
    .container > div:first-child .hero-banner h1 {
        font-size: 2.8rem !important;
    }
    .hero-search { max-width: 100%; }
    .hero-search-input { font-size: var(--font-size-sm); padding: 12px 14px 12px 42px; }
}

/* ============================================
   HOME PAGE — Water Source cards
   ============================================ */
.source-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--surface-border);
    border-left: 4px solid var(--source-accent, var(--accent-blue));
    border-radius: var(--radius-lg);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition-card);
}

.source-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top left, var(--source-accent, var(--accent-blue)), transparent 60%);
    opacity: 0;
    transition: opacity 0.25s var(--ease-smooth);
    mix-blend-mode: screen;
}

.source-card:hover {
    transform: translateY(-3px);
    border-color: var(--source-accent, var(--accent-blue));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 32px color-mix(in srgb, var(--source-accent, var(--accent-blue)) 22%, transparent);
    text-decoration: none;
}

.source-card:hover::after {
    opacity: 0.12;
}

.source-card--city { --source-accent: var(--badge-city); }
.source-card--well { --source-accent: var(--badge-well); }
.source-card--testing { --source-accent: var(--accent-green); }

.source-card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.source-card__desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.source-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
}

.source-card__cta {
    display: inline-block;
    margin-top: var(--space-md);
    color: var(--source-accent, var(--accent-blue));
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
    transition: transform 0.2s var(--ease-smooth);
}

.source-card__cta:hover,
.source-card:hover .source-card__cta {
    transform: translateX(3px);
}

.source-card__note {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
    position: relative;
    z-index: 1;
}

/* ============================================
   HOME PAGE — Quick Reference
   ============================================ */
.qr-section-wrap {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 48, 96, 0.12) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}
.qr-section-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--accent-blue) 50%, transparent 90%);
    opacity: 0.5;
    pointer-events: none;
}
.qr-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.qr-section-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.qr-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}
.qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: var(--space-lg);
    align-items: start;
}
.qr-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--transition-card);
}
.qr-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--qr-accent) 50%, transparent 100%);
    opacity: 0.75;
    z-index: 1;
    pointer-events: none;
}
.qr-card:hover {
    border-color: var(--qr-accent-border);
    box-shadow: 0 12px 32px -12px var(--qr-accent-shadow), 0 0 24px color-mix(in srgb, var(--qr-accent) 10%, transparent);
    transform: translateY(-2px);
}
.qr-card:hover::before { opacity: 1; height: 3px; }

.qr-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--qr-accent-bg) 0%, transparent 85%);
    position: relative;
}
.qr-icon-chip {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--qr-accent-chip);
    border: 1px solid var(--qr-accent-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 12px color-mix(in srgb, var(--qr-accent) 18%, transparent);
}
.qr-icon-chip svg {
    width: 15px;
    height: 15px;
    color: var(--qr-accent);
    display: block;
}
.qr-card-header h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--qr-accent);
    line-height: 1;
    margin: 0;
    flex: 1;
}
.qr-count {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--qr-accent);
    background: var(--qr-accent-chip);
    border: 1px solid var(--qr-accent-border);
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.qr-card--symptoms {
    --qr-accent: var(--cat-symptoms);
    --qr-accent-bg: rgba(248, 81, 73, 0.08);
    --qr-accent-chip: rgba(248, 81, 73, 0.14);
    --qr-accent-border: rgba(248, 81, 73, 0.32);
    --qr-accent-shadow: rgba(248, 81, 73, 0.28);
}
.qr-card--contaminants {
    --qr-accent: var(--cat-contaminants);
    --qr-accent-bg: rgba(240, 136, 62, 0.08);
    --qr-accent-chip: rgba(240, 136, 62, 0.14);
    --qr-accent-border: rgba(240, 136, 62, 0.32);
    --qr-accent-shadow: rgba(240, 136, 62, 0.28);
}
.qr-card--blog {
    --qr-accent: #ff4455;
    --qr-accent-bg: rgba(252, 3, 34, 0.07);
    --qr-accent-chip: rgba(252, 3, 34, 0.14);
    --qr-accent-border: rgba(252, 3, 34, 0.32);
    --qr-accent-shadow: rgba(252, 3, 34, 0.24);
}
.qr-card-body {
    padding: var(--space-sm) 0;
}
.qr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px var(--space-lg);
    transition: background 0.15s var(--ease-smooth), padding-left 0.15s var(--ease-smooth);
}
.qr-row:hover {
    background: linear-gradient(90deg, var(--qr-accent-bg) 0%, transparent 80%);
    padding-left: calc(var(--space-lg) + 4px);
}
.qr-row a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qr-row a:hover {
    color: var(--text-link-hover);
    text-decoration: none;
}
.qr-row .qr-arrow {
    font-size: 11px;
    color: var(--qr-accent);
    flex-shrink: 0;
    margin-left: var(--space-sm);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}
.qr-row:hover .qr-arrow {
    opacity: 1;
    transform: translateX(0);
}
.qr-row .badge {
    flex-shrink: 0;
    margin-left: var(--space-sm);
}
.qr-footer {
    border-top: 1px solid var(--border-color);
    padding: 10px var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.qr-footer a {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.12s ease, transform 0.15s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qr-footer a:hover {
    color: var(--text-link-hover);
    text-decoration: none;
    transform: translateX(3px);
}
.qr-card--symptoms .qr-footer a:hover { color: var(--cat-symptoms); }
.qr-card--contaminants .qr-footer a:hover { color: var(--cat-contaminants); }
.qr-card--blog .qr-footer a:hover { color: #ff4455; }

@media (max-width: 1024px) {
    .qr-grid {
        grid-template-columns: 1fr 1fr;
    }
    .qr-card--blog {
        grid-column: 1 / -1;
    }
    .qr-card--blog .qr-row a {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}
@media (max-width: 640px) {
    .qr-grid { grid-template-columns: 1fr; }
    .qr-card--blog { grid-column: auto; }
    .qr-section-wrap { padding: var(--space-lg); }
}

/* ============================================
   HOME PAGE — Tools sidebar & CTA
   ============================================ */
.tools-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin: 0 var(--space-md) var(--space-md);
    padding: 12px var(--space-md);
    background: linear-gradient(135deg, #1a4a6e 0%, #24638e 50%, #2d7cb0 100%);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: var(--transition-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tools-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 99, 142, 0.45), 0 0 24px rgba(88, 166, 255, 0.18);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   TOOLS INDEX — tool list cards & featured map
   ============================================ */
.tool-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    transition: var(--transition-card);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-red), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.25s var(--ease-smooth);
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--surface-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 28px var(--surface-glow-blue-soft);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-smooth);
}

.tool-card:hover .tool-icon {
    transform: scale(1.08);
}

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

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tool-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

.tool-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-smooth), color 0.2s ease;
}

.tool-card:hover .tool-arrow {
    transform: translateX(4px);
    color: var(--accent-blue);
}

.tool-arrow svg {
    width: 16px;
    height: 16px;
}

.tool-badges {
    display: flex;
    gap: 5px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* Featured map card */
.featured-map {
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: linear-gradient(135deg, #001830 0%, #003060 50%, #0a4a7a 100%);
    position: relative;
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    transition: var(--transition-card);
    gap: var(--space-lg);
}

.featured-map::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: var(--surface-shimmer);
    opacity: 0.6;
    pointer-events: none;
}

.featured-map:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 48, 96, 0.45), 0 0 40px var(--surface-glow-blue-soft);
}

.featured-map-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.featured-map h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.featured-map p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
    max-width: 500px;
}

.featured-map .map-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.featured-map .map-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--brand-red) 0%, #da3633 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-top: var(--space-md);
    box-shadow: 0 2px 12px rgba(252, 3, 34, 0.35);
    transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.featured-map:hover .map-cta {
    transform: translateX(4px);
    box-shadow: 0 4px 18px rgba(252, 3, 34, 0.5);
}

.map-thumbnail {
    flex-shrink: 0;
    width: 260px;
    height: 170px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
}

.map-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .featured-map {
        flex-direction: column;
    }
    .map-thumbnail {
        width: 100%;
        height: 140px;
    }
    .tools-grid {
        grid-template-columns: 1fr;
    }
}
