/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip Navigation Links - Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Enhanced Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:root {
    /* Primary Nature-Inspired Colors */
    --primary-color: #2c5f2d;
    --primary-light: #4a8c4d;
    --primary-dark: #1e4620;
    --primary-hover: #4a8c4d;
    
    /* Secondary Earthy Tones */
    --secondary-color: #8b6f47;
    --secondary-light: #a68a65;
    --secondary-dark: #6b5537;
    
    /* Accent & Highlight Colors */
    --accent-color: #d4a574;
    --accent-light: #e5c09a;
    --accent-dark: #b88a5a;
    
    /* Text Colors */
    --text-dark: #2c2c2c; /* reconciled to variables.css --color-text-primary (was #2c3e2d) */
    --text-medium: #4a5a4b;
    --text-light: #5a6b5c;
    --text-lighter: #7a8b7c;
    --text-white: #ffffff;
    
    /* Background Colors */
    --bg-light: #f5f5f0;
    --bg-lighter: #fafaf7;
    --bg-white: #ffffff;
    --bg-cream: #faf8f3;
    --bg-dark: #2c3e2d;
    
    /* Border & Divider Colors */
    --border-color: #e0e0d0;
    --border-light: #ebebdb;
    --border-dark: #d0d0c0;
    
    /* Status Colors */
    --warning-color: #d97706;
    --warning-bg: #fff3cd;
    --success-color: #16a34a;
    --success-bg: #d1fae5;
    --error-color: #dc2626;
    --error-bg: #fee2e2;
    --info-color: #2563eb;
    --info-bg: #dbeafe;

    /* Potency/Difficulty Badge Colors (comparison chart) */
    --potency-low-text: #1e40af;
    --potency-medium-text: #065f46;
    --potency-high-bg: #fed7aa;
    --potency-high-text: #9a3412;
    --potency-veryhigh-bg: #fecaca;
    --potency-veryhigh-text: #991b1b;
    --difficulty-moderate-bg: #fef3c7;
    --difficulty-moderate-text: #92400e;

    /* Shadow & Overlay */
    /* Values match css/variables.css exactly (15.08.2026) -- main.min.css
       loads after style.min.css on every page that has both, so its
       same-named tokens already won the cascade; these numbers only ever
       rendered on the handful of pages that load style.css alone. */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --overlay-light: rgba(255,255,255,0.9);
    --overlay-dark: rgba(44,62,45,0.8);
    
    /* Spacing System */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 0.5rem;
    --radius-xl: 15px;
    --radius-full: 999px;

    /* Typography -- values match css/variables.css's modular type scale
       exactly (15.08.2026), same reason as the Shadow block above. */
    --font-size-xs: 0.64rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.563rem;
    --font-size-2xl: 1.953rem;
    --font-size-3xl: 2.441rem;
    --font-size-4xl: 3.052rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: all 200ms ease-in-out;
    --transition-slow: 0.5s ease;

    /* ========================================
       Cross-Scheme Aliases (prefix naming -> suffix tokens)
       Keeps variables.css-style names resolving when style.css is loaded.
       Literal values live in the suffix tokens above; these only alias.
       ======================================== */
    --color-primary: var(--primary-color);
    --color-primary-light: var(--primary-light);
    --color-primary-dark: var(--primary-dark);
    --color-secondary: var(--secondary-color);
    --color-secondary-light: var(--secondary-light);
    --color-secondary-dark: var(--secondary-dark);
    --color-accent: var(--accent-color);
    --color-text-primary: var(--text-dark);
    --color-text-secondary: var(--text-medium);
    --color-text-inverse: var(--text-white);
    --color-bg-primary: var(--bg-white);
    --color-bg-secondary: var(--bg-light);
    --color-border: var(--border-color);

    /* Spacing scale equivalences */
    --spacing-1: var(--spacing-xs);
    --spacing-2: var(--spacing-sm);
    --spacing-4: var(--spacing-md);
    --spacing-6: var(--spacing-lg);
    --spacing-8: var(--spacing-xl);

    /* Radius scale equivalences */
    --border-radius-base: var(--radius-sm);
    --border-radius-md: var(--radius-md);
    --border-radius-lg: var(--radius-lg);
    --border-radius-xl: var(--radius-xl);
    --border-radius-full: var(--radius-full);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

/* main.css's base/typography.css sets `color` directly on h1-h6 globally,
   which always overrides an inherited value (the .hero white above)
   regardless of selector specificity. Re-assert white here so headings
   inside .hero (h1 on 372 pages, h3 on 3) stay legible on the gradient
   background instead of rendering in near-invisible dark grey. */
.hero h1,
.hero h2,
.hero h3 {
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Base .btn / .btn-primary / .btn-secondary: canonical definitions live in
   css/components/buttons.css (loaded after this file via main.css).
   Only the hero-specific padding override remains here. */
.btn {
    padding: 0.75rem 2rem;
}

/* Features Section */
.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.feature-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.feature-link:hover {
    color: var(--secondary-color);
}

/* Quick Links Section */
.quick-links {
    padding: 4rem 0;
    background-color: var(--bg-white);
}

.quick-links h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

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

.quick-link-card {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.quick-link-card:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    transform: translateY(-3px);
}

.quick-link-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.quick-link-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Disclaimer Section */
.disclaimer {
    padding: 3rem 0;
}

.disclaimer-box {
    background-color: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 2rem;
    border-radius: 5px;
}

.disclaimer-box h3 {
    /* var(--warning-color) (#d97706) on this box's #fff3cd background is ~2.9:1,
       below WCAG AA's 4.5:1 for normal text. Darker shade of the same amber
       family keeps the visual design while reaching ~6.4:1. */
    color: #92400e;
    margin-bottom: 1rem;
}

.disclaimer-box p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

.alt-section {
    background-color: var(--bg-white);
}

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

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pill:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.info-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.info-card h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.faq-list {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding-left: 1.25rem;
}

.faq-list li {
    margin-left: 0.5rem;
    color: var(--text-dark);
}

.faq-list strong {
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

/* .site-footer (components/footer.css, added sitewide in the Wave 26-28
   footer standardization) has a LIGHT background, unlike the plain dark
   <footer> above. Its own .footer-section nav a rule only matches links
   wrapped in <nav>, but the actual footer sitemap markup is plain
   <ul><li><a>, so nothing overrode the white .footer-section a color
   above -- white-on-light-grey, on 1277 pages' footer sitemap links.
   Higher-specificity override restores readable dark links there. */
.site-footer .footer-section a {
    color: var(--color-text-secondary);
}

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

/* The dark-mode toggle sets both body.dark-mode (legacy) and data-theme
   (current) simultaneously for cross-compatibility, but the two systems'
   token cascades interact in a way that leaves --color-text-secondary
   resolving to a too-dark grey here specifically when both are active at
   once. Hardcoded light override sidesteps that rather than untangling
   the two token systems' interaction, which is a larger unification
   task -- see TODO/tech/TODO_known_issues_active.md. */
body.dark-mode .site-footer .footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .site-footer .footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
}

/* Extended Button Styles */
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* .btn-success duplicate removed (canonical: components/buttons.css) */

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #c2410c;
}

.btn-error {
    background-color: var(--error-color);
    color: white;
}

.btn-error:hover {
    background-color: #b91c1c;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* .btn:disabled duplicate removed (canonical: components/buttons.css) */

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: var(--bg-white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox,
.form-radio {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error-color);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: var(--success-color);
}

/* Card Styles */
.card {
    background-color: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Card aliases: make .info-card/.feature-card/.content-card share .card treatment */
.info-card,
.feature-card,
.content-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover,
.feature-card:hover,
.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-title {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.card-text {
    color: var(--text-light);
    line-height: 1.6;
}

/* Alert/Notice Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-success {
    background-color: #dcfce7;
    border-color: var(--success-color);
    color: #14532d; /* was #15803d (4.57:1 on #dcfce7, failed WCAG AAA 7:1); now 8.30:1 */
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #663c00; /* was #b45309 (4.53:1 on #fff3cd, failed WCAG AAA 7:1); now 8.57:1 */
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--error-color);
    color: #7a1c1c; /* was #b91c1c (5.30:1 on #fee2e2, failed WCAG AAA 7:1); now 8.55:1 */
}

.alert-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-error {
    background-color: var(--error-color);
    color: white;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--bg-white);
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.modal-title {
    margin: 0;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Accordion Styles */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.accordion-header:hover {
    background-color: var(--border-color);
}

.accordion-header.active {
    background-color: var(--primary-color);
    color: white;
}

.accordion-icon {
    transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 1000px;
}

.accordion-body {
    padding: 1.5rem;
}

/* Tab Styles */
.tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-list {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.table tr:hover {
    background-color: var(--bg-light);
}

.table-striped tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Dark Mode Support */
body.dark-mode {
    --primary-color: #5fae62;
    --primary-dark: #2c5f2d; /* reconciled to variables.css [data-theme="dark"] --color-primary-dark (was unset, fell back to #1e4620) */
    --secondary-color: #a39179; /* reconciled to variables.css [data-theme="dark"] --color-secondary (was #a08259) */
    --accent-color: #d4a574;
    --text-dark: #e5e7eb;
    --text-light: #9ca3af;
    --bg-light: #1f2937;
    --bg-white: #111827;
    --border-color: #374151;

    /* Chart surface tokens (comparison-chart / chart-controls / chart-search / chart-filter) */
    --chart-dark-bg: #2a2a2a;
    --chart-dark-surface: #333;
    --chart-dark-border: #444;
    --chart-dark-border-light: #555;
}

body.dark-mode .card,
body.dark-mode .feature-card {
    background-color: var(--bg-white);
}

/* footer{} uses var(--text-dark) as its BACKGROUND (a naming leftover --
   in light mode --text-dark happens to be a dark grey that also works as
   a dark footer background). body.dark-mode redefines --text-dark to a
   LIGHT grey (correct for actual text-on-dark-bg use elsewhere), which
   flips the footer's background to light while its own color:white stays
   white -- invisible footer text whenever dark mode is active. Pin it to
   a fixed dark value instead of following --text-dark's inverted meaning. */
body.dark-mode footer {
    background-color: #111827;
}

body.dark-mode .alert-info {
    background-color: #1e3a5f;
    color: #bfdbfe; /* was #93c5fd (6.38:1, failed WCAG AAA 7:1); now 8.10:1 */
}

body.dark-mode .alert-success {
    background-color: #14532d;
    color: #bbf7d0; /* was #86efac (6.49:1, failed WCAG AAA 7:1); now 7.52:1 */
}

body.dark-mode .alert-warning {
    background-color: #713f12;
    color: #fef08a; /* was #fde047 (6.58:1, failed WCAG AAA 7:1); now 7.45:1 */
}

body.dark-mode .alert-error {
    background-color: #7f1d1d;
    color: #fee2e2; /* was #fca5a5 (5.28:1, failed WCAG AAA 7:1); now 8.20:1 */
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    border-radius: 5px;
    padding: 0.5rem 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    white-space: nowrap;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-dark) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem 0;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    padding: 0 0.5rem;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

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

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

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

    .tab-list {
        flex-direction: column;
    }

    .modal {
        width: 95%;
    }

    .dark-mode-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Dosage Calculator Styles */
.warning-banner {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-color);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
}

.calculator-container {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.dosage-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-base);
    background-color: var(--bg-white);
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.result-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.result-label {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.result-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
}

.result-secondary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    opacity: 0.95;
}

.result-secondary .result-label {
    font-size: var(--font-size-base);
}

.result-secondary .result-value {
    font-size: var(--font-size-lg);
}

.safety-warnings {
    background-color: var(--error-bg);
    border-left: 4px solid var(--error-color);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
}

.safety-warnings h4 {
    color: var(--error-color);
    margin-bottom: 0.5rem;
}

.safety-warnings ul {
    margin-left: 1.5rem;
    color: var(--text-dark);
}

.safety-warnings ul li {
    margin-bottom: 0.5rem;
}

.preparation-tips,
.integration-tips {
    background-color: var(--bg-cream);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.preparation-tips h4,
.integration-tips h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.preparation-tips ul,
.integration-tips ul {
    margin-left: 1.5rem;
}

.preparation-tips ul li,
.integration-tips ul li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Responsive Calculator */
@media (max-width: 768px) {
    .calculator-container {
        padding: 1rem;
    }
    
    .result-main,
    .result-secondary {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .result-value {
        font-size: var(--font-size-xl);
    }
}
/* Search Results Styles */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 0.5rem;
}

.search-result-item {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-dark);
    transition: background-color var(--transition-fast);
}

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

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

.search-result-title {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.search-result-snippet {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
    line-height: 1.4;
}

.search-result-snippet mark,
.search-result-title mark {
    background-color: var(--accent-light);
    color: var(--text-dark);
    padding: 0 0.2rem;
    border-radius: 2px;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

.search-form {
    position: relative;
}

/* Trip Planner Styles */
.trip-planner-container {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.planner-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.planner-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    transition: all var(--transition-base);
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.progress-step.completed .step-number::after {
    content: '✓';
    position: absolute;
}

.step-label {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.planner-step {
    display: none;
}

.planner-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.safety-checklist,
.checklist {
    background-color: var(--bg-cream);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.checkbox-label:hover {
    background-color: var(--bg-light);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.plan-summary {
    background: linear-gradient(135deg, var(--bg-cream), var(--bg-lighter));
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
}

.summary-section {
    margin-bottom: 1.5rem;
}

.summary-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.summary-section p {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.integration-section {
    background-color: var(--success-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success-color);
    margin-top: 2rem;
}

.integration-section h3 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.integration-section ul {
    margin-left: 1.5rem;
}

.integration-section li {
    margin-bottom: 0.5rem;
}

/* Responsive Trip Planner */
@media (max-width: 768px) {
    .planner-progress {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .planner-progress::before {
        display: none;
    }
    
    .progress-step {
        flex: 0 0 calc(33.333% - 1rem);
        min-width: 80px;
    }
    
    .step-label {
        font-size: var(--font-size-xs);
    }
    
    .trip-planner-container {
        padding: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}

/* Tolerance Calculator Styles */
.info-banner {
    background-color: var(--info-bg);
    border-left: 4px solid var(--info-color);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
}

.tolerance-status {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.tolerance-status.safe {
    background-color: var(--success-bg);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.tolerance-status.caution {
    background-color: var(--warning-bg);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
}

.tolerance-status.wait {
    background-color: var(--error-bg);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.adjusted-dose {
    background-color: var(--bg-white);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: center;
    border: 2px solid var(--primary-color);
}

.highlight-dose {
    display: block;
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Enhanced Dark Mode */
body.dark-mode .back-to-top {
    background-color: var(--primary-light);
}

body.dark-mode .back-to-top:hover {
    background-color: var(--primary-color);
}

body.dark-mode .calculator-container,
body.dark-mode .trip-planner-container {
    background-color: #2a2a2a;
    border: 1px solid #444;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

body.dark-mode .result-card {
    background: linear-gradient(135deg, #2c4a3a, #234436);
}

body.dark-mode .tolerance-status.safe {
    background-color: rgba(22, 163, 74, 0.2);
}

body.dark-mode .tolerance-status.caution {
    background-color: rgba(217, 119, 6, 0.2);
}

body.dark-mode .tolerance-status.wait {
    background-color: rgba(220, 38, 38, 0.2);
}

body.dark-mode .safety-checklist,
body.dark-mode .checklist,
body.dark-mode .preparation-tips,
body.dark-mode .integration-tips {
    background-color: #2a2a2a;
}

body.dark-mode .plan-summary {
    background: linear-gradient(135deg, #2a2a2a, #333);
}

body.dark-mode .checkbox-label:hover {
    background-color: #333;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: var(--font-size-xl);
    }
}

/* Comparison Charts Styles */
.comparison-selector {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    text-align: center;
}

.selector-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.selector-btn {
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-dark);
}

.selector-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.selector-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.comparison-chart {
    display: none;
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.comparison-chart.active {
    display: block;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chart-search {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
}

.chart-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chart-filter {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    font-size: var(--font-size-base);
    cursor: pointer;
}

.export-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.export-btn:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
}

.comparison-table thead {
    background-color: var(--primary-color);
    color: white;
}

.comparison-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

.comparison-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.comparison-table th.sortable:hover {
    background-color: var(--primary-dark);
}

.sort-icon {
    margin-left: 0.5rem;
    opacity: 0.6;
}

.comparison-table th.sorted-asc .sort-icon::after {
    content: '↑';
}

.comparison-table th.sorted-desc .sort-icon::after {
    content: '↓';
}

.comparison-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition-fast);
}

.comparison-table tbody tr:hover {
    background-color: var(--bg-cream);
}

.comparison-table td {
    padding: 1rem;
}

.potency-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.potency-low {
    background-color: var(--info-bg);
    color: var(--potency-low-text);
}

.potency-medium {
    background-color: var(--success-bg);
    color: var(--potency-medium-text);
}

.potency-high {
    background-color: var(--potency-high-bg);
    color: var(--potency-high-text);
}

.potency-veryhigh {
    background-color: var(--potency-veryhigh-bg);
    color: var(--potency-veryhigh-text);
}

.difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.difficulty-easy {
    background-color: var(--success-bg);
    color: var(--potency-medium-text);
}

.difficulty-moderate {
    background-color: var(--difficulty-moderate-bg);
    color: var(--difficulty-moderate-text);
}

.difficulty-hard {
    background-color: var(--error-bg);
    color: var(--potency-veryhigh-text);
}

/* Dark Mode for Charts */
body.dark-mode .comparison-selector,
body.dark-mode .comparison-chart {
    background-color: var(--chart-dark-bg);
    border: 1px solid var(--chart-dark-border);
}

body.dark-mode .selector-btn {
    background-color: var(--chart-dark-surface);
    border-color: var(--chart-dark-border-light);
    color: var(--text-white);
}

body.dark-mode .selector-btn:hover {
    background-color: var(--primary-dark);
}

body.dark-mode .comparison-table {
    background-color: var(--chart-dark-bg);
}

body.dark-mode .comparison-table tbody tr {
    border-color: var(--chart-dark-border);
}

body.dark-mode .comparison-table tbody tr:hover {
    background-color: var(--chart-dark-surface);
}

body.dark-mode .chart-search,
body.dark-mode .chart-filter {
    background-color: var(--chart-dark-surface);
    border-color: var(--chart-dark-border-light);
    color: var(--text-white);
}

/* Responsive Tables */
@media (max-width: 768px) {
    .selector-buttons {
        flex-direction: column;
    }
    
    .selector-btn {
        width: 100%;
    }
    
    .chart-controls {
        flex-direction: column;
    }
    
    .chart-search {
        width: 100%;
    }
    
    .comparison-table {
        font-size: var(--font-size-sm);
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .comparison-selector,
    .chart-controls,
    .nav-menu,
    footer,
    .dark-mode-toggle,
    .back-to-top {
        display: none !important;
    }
    
    .comparison-chart {
        display: block !important;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .comparison-table {
        border: 1px solid #000;
    }
    
    .comparison-table th {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000;
    }
    
    .comparison-table td {
        border: 1px solid #000;
    }
}

/* ========================================
   PWA UPDATE NOTIFICATION
   ======================================== */

.update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.update-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.update-content p {
    margin: 0;
    font-weight: 600;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Install PWA Button */
#installBtn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 600;
    display: none;
    z-index: 999;
    transition: all 0.3s;
}

#installBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .update-notification {
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
    }
    
    .update-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .update-content button {
        width: 100%;
    }
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-lighter);
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 500;
}

/* Dark mode breadcrumbs */
body.dark-mode .breadcrumb {
    color: var(--dark-text-secondary);
}

body.dark-mode .breadcrumb-link {
    color: var(--primary-light);
}

body.dark-mode .breadcrumb-link:hover {
    color: var(--accent-light);
}

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

@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.75rem 0;
    }
    
    .breadcrumb-separator {
        margin: 0 0.3rem;
    }
}

/* ========================================
   SOCIAL SHARING BUTTONS
   ======================================== */

.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.social-share-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-right: 0.5rem;
}

.social-share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.share-btn-twitter {
    background: #1DA1F2;
}

.share-btn-facebook {
    background: #4267B2;
}

.share-btn-reddit {
    background: #FF4500;
}

.share-btn-email {
    background: var(--text-medium);
}

.share-btn-copy {
    background: var(--primary-color);
}

.share-btn.copied {
    background: var(--success-color);
}

/* Dark mode social share */
body.dark-mode .social-share {
    background: var(--dark-bg-elevated);
}

body.dark-mode .social-share-title {
    color: var(--dark-text-primary);
}

@media (max-width: 768px) {
    .social-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .social-share-buttons {
        width: 100%;
    }
    
    .share-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ========================================
   LAZY LOADING PLACEHOLDERS
   ======================================== */

.lazy-image {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
}

.lazy-image.loading {
    background: linear-gradient(
        90deg,
        var(--bg-light) 0%,
        var(--bg-lighter) 50%,
        var(--bg-light) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

.lazy-image img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-image img.loaded {
    opacity: 1;
}

/* Image placeholder icons */
.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: var(--bg-light);
    color: var(--text-lighter);
    font-size: 3rem;
}

body.dark-mode .lazy-image {
    background: var(--dark-bg-elevated);
}

body.dark-mode .image-placeholder {
    background: var(--dark-bg-elevated);
    color: var(--dark-text-tertiary);
}

/* ========================================
   ENHANCED PRINT STYLES
   ======================================== */

@media print {
    /* Hide non-essential elements */
    header,
    .navbar,
    .dark-mode-toggle,
    #backToTop,
    #installBtn,
    .social-share,
    .update-notification,
    footer,
    .breadcrumb,
    .hero-buttons,
    .search-widget,
    .nav-toggle,
    .export-btn,
    .share-btn {
        display: none !important;
    }
    
    /* Reset colors for print */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Optimize typography */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1 { font-size: 24pt; page-break-after: avoid; }
    h2 { font-size: 18pt; page-break-after: avoid; }
    h3 { font-size: 14pt; page-break-after: avoid; }
    h4 { font-size: 12pt; page-break-after: avoid; }
    
    /* Avoid page breaks inside elements */
    .calculator-container,
    .planner-container,
    .comparison-chart,
    .info-section,
    .warning-banner,
    table,
    ul,
    ol {
        page-break-inside: avoid;
    }
    
    /* Show links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }

    /* Skip internal anchor links */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    /* Table styling for print */
    table {
        border-collapse: collapse;
        width: 100%;
        margin: 1em 0;
    }
    
    table th,
    table td {
        border: 1px solid #000;
        padding: 0.5em;
        text-align: left;
    }
    
    table th {
        background: #f0f0f0 !important;
        font-weight: bold;
    }
    
    /* Warning banners */
    .warning-banner {
        border: 2px solid #000 !important;
        padding: 1em !important;
        margin: 1em 0 !important;
    }
    
    /* Results display */
    .results-section {
        border: 1px solid #000 !important;
        padding: 1em !important;
        margin: 1em 0 !important;
    }
    
    /* Page title */
    .hero h2,
    .page-header h1 {
        margin-top: 0;
        border-bottom: 2px solid #000;
        padding-bottom: 0.5em;
    }
    
    /* Optimize images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Ensure content fits on page */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}

/* ========================================
   BOOKMARKS & HISTORY
   ======================================== */

.bookmark-btn {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.bookmark-btn.bookmarked {
    color: #FFD700;
    border-color: #FFD700;
}

body.dark-mode .bookmark-btn {
    background: var(--dark-bg-elevated);
    color: var(--dark-text-primary);
    border-color: var(--dark-border-color);
}

/* Bookmarks Page */
.bookmarks-container,
.history-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bookmarks-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookmark-category,
.history-date {
    margin-bottom: 2rem;
}

.bookmark-category h2,
.history-date h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.bookmark-list,
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-item,
.history-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s;
}

.bookmark-item:hover,
.history-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.bookmark-link,
.history-item a {
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.bookmark-link strong,
.history-item strong {
    color: var(--primary-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
}

.bookmark-link strong:hover,
.history-item strong:hover {
    text-decoration: underline;
}

.bookmark-link p {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.bookmark-date,
.history-time {
    font-size: 0.85rem;
    color: var(--text-lighter);
    margin-top: 0.5rem;
    display: block;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--error-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--error-bg);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-lighter);
    font-size: 1.1rem;
}

/* Dark mode bookmarks */
body.dark-mode .bookmark-category h2,
body.dark-mode .history-date h2 {
    color: var(--primary-light);
    border-color: var(--dark-border-color);
}

body.dark-mode .bookmark-item,
body.dark-mode .history-item {
    background: var(--dark-bg-elevated);
    border-color: var(--dark-border-color);
}

body.dark-mode .bookmark-link strong,
body.dark-mode .history-item strong {
    color: var(--primary-light);
}

body.dark-mode .bookmark-link p {
    color: var(--dark-text-secondary);
}

@media (max-width: 768px) {
    .bookmark-btn {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .bookmarks-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bookmarks-actions {
        width: 100%;
    }
    
    .bookmarks-actions button {
        flex: 1;
    }
}

/* ========================================
   EXPERIENCE JOURNAL
   ======================================== */

.experience-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.experience-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.experience-header h3 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.experience-date {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.experience-rating {
    color: #FFD700;
    font-size: 1.2rem;
}

.experience-body {
    margin-bottom: 1rem;
}

.experience-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 4px;
}

.experience-meta span {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.experience-intention,
.experience-insights {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-lighter);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.experience-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Journal Form */
.journal-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.form-group-full {
    grid-column: 1 / -1;
}

.rating-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rating-input input[type="range"] {
    flex: 1;
}

.rating-value {
    min-width: 3rem;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.effects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.effect-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.effect-tag:hover {
    border-color: var(--primary-color);
}

.effect-tag.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dark mode journal */
body.dark-mode .experience-card {
    background: var(--dark-bg-elevated);
    border-color: var(--dark-border-color);
}

body.dark-mode .experience-header h3 {
    color: var(--primary-light);
}

body.dark-mode .experience-meta {
    background: var(--dark-bg);
}

body.dark-mode .experience-intention,
body.dark-mode .experience-insights {
    background: var(--dark-bg);
    border-color: var(--primary-light);
}

body.dark-mode .journal-form {
    background: var(--dark-bg-elevated);
}

body.dark-mode .effect-tag {
    background: var(--dark-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-text-primary);
}

body.dark-mode .effect-tag.selected {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   MICRODOSING CALENDAR
   ======================================== */

.calendar-container {
    max-width: 800px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: 8px;
}

.calendar-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 0.75rem;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--bg-lighter);
}

.calendar-day:not(.empty):hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
    transform: scale(1.05);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    border-color: var(--primary-color);
    border-width: 2px;
    background: var(--accent-light);
}

.calendar-day.has-dose {
    background: var(--success-bg);
    border-color: var(--success-color);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.dose-indicator {
    position: absolute;
    bottom: 4px;
    font-size: 0.5rem;
    color: var(--success-color);
}

/* Dose Form */
.dose-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dose-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* Dark mode calendar */
body.dark-mode .calendar-header,
body.dark-mode .calendar-grid,
body.dark-mode .dose-form,
body.dark-mode .stat-card {
    background: var(--dark-bg-elevated);
}

body.dark-mode .calendar-header h3 {
    color: var(--primary-light);
}

body.dark-mode .calendar-day {
    background: var(--dark-bg);
    border-color: var(--dark-border-color);
}

body.dark-mode .calendar-day.today {
    border-color: var(--primary-light);
    background: var(--dark-bg-elevated);
}

body.dark-mode .calendar-day.has-dose {
    background: #1a4d2e;
    border-color: var(--success-color);
}

body.dark-mode .day-number {
    color: var(--dark-text-primary);
}

body.dark-mode .stat-card {
    border-color: var(--dark-border-color);
}

body.dark-mode .stat-value {
    color: var(--primary-light);
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .calendar-day {
        padding: 0.25rem;
        font-size: 0.85rem;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .experience-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .experience-actions {
        flex-wrap: wrap;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .dose-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* ============================================
   PROTOCOL SELECTOR
   ============================================ */

.protocol-selector-container {
    margin: 2rem 0;
}

.protocol-selector {
    background: var(--bg-lighter);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.protocol-selector h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.selector-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.selector-step.active {
    display: block;
}

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

.selector-step h4 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

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

.option-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: block;
}

.option-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.15);
    transform: translateY(-2px);
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light-bg);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.2);
}

.option-content strong {
    display: block;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.option-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Results Display */
.selector-results {
    animation: fadeIn 0.5s ease-in;
}

.result-card {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.result-protocol-name {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.result-protocol-details p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.result-protocol-details strong {
    color: var(--primary-dark);
}

.result-protocol-details h5 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.result-reasons {
    list-style: none;
    padding: 0;
}

.result-reasons li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.6;
}

.result-reasons li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.result-tips {
    background: var(--info-light-bg);
    border-left: 4px solid var(--info-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.result-tips p {
    margin: 0;
    line-height: 1.6;
}

/* Navigation */
.selector-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-prev,
.btn-next,
.btn-restart-selector {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-prev:hover,
.btn-next:hover,
.btn-restart-selector:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-prev {
    background: var(--secondary-color);
}

.btn-prev:hover {
    background: var(--secondary-light);
}

.btn-restart-selector {
    display: block;
    margin: 2rem auto 0;
    background: var(--secondary-color);
}

.btn-restart-selector:hover {
    background: var(--secondary-light);
}

/* Progress Bar */
.selector-progress {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .protocol-selector {
        padding: 1.5rem;
    }
    
    .option-group {
        grid-template-columns: 1fr;
    }
    
    .option-card {
        padding: 1rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .selector-navigation {
        flex-direction: column;
    }
    
    .btn-prev,
    .btn-next {
        width: 100%;
    }
}

/* ============================================
   SAFETY CHECKLIST
   ============================================ */

.safety-checklist-container {
    margin: 2rem 0;
}

.safety-checklist {
    background: var(--bg-lighter);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.checklist-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1.5rem;
}

.checklist-header h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.checklist-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 6px;
}

.checklist-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checklist-section h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light-bg);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--bg-lighter);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.checklist-item:hover {
    background: white;
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
}

.checklist-item.checked {
    background: var(--primary-light-bg);
    border-color: var(--primary-color);
}

.checklist-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    margin-right: 1rem;
    flex-shrink: 0;
    position: relative;
    background: white;
    transition: all 0.2s ease;
}

.checklist-item input:checked + .checkmark {
    background: var(--primary-color);
}

.checklist-item input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.item-text {
    flex: 1;
    line-height: 1.5;
    color: var(--text-dark);
}

.checklist-item.checked .item-text {
    color: var(--primary-dark);
    font-weight: 500;
}

/* Results Summary */
.checklist-results {
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-summary {
    margin-bottom: 1.5rem;
}

.status-box {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid;
    margin-bottom: 1.5rem;
}

.status-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.status-box p {
    margin: 0;
    line-height: 1.6;
}

.status-ready {
    background: var(--success-light-bg);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.status-ready h4 {
    color: var(--success-color);
}

.status-almost {
    background: var(--warning-light-bg);
    border-color: var(--warning-color);
    color: var(--warning-dark);
}

.status-almost h4 {
    color: var(--warning-color);
}

.status-progress {
    background: var(--info-light-bg);
    border-color: var(--info-color);
    color: var(--info-dark);
}

.status-progress h4 {
    color: var(--info-color);
}

.status-start {
    background: var(--bg-light);
    border-color: var(--text-light);
    color: var(--text-dark);
}

.status-start h4 {
    color: var(--text-dark);
}

/* Category Breakdown */
.category-breakdown h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.category-stat {
    background: var(--bg-lighter);
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

.category-stat.complete {
    border-color: var(--success-color);
    background: var(--success-light-bg);
}

.category-stat.partial {
    border-color: var(--warning-color);
    background: var(--warning-light-bg);
}

.category-stat.incomplete {
    border-color: var(--error-color);
    background: var(--error-light-bg);
}

.category-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.category-progress {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-count {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.mini-progress {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.category-stat.complete .mini-progress-fill {
    background: var(--success-color);
}

.category-stat.partial .mini-progress-fill {
    background: var(--warning-color);
}

.category-stat.incomplete .mini-progress-fill {
    background: var(--error-color);
}

/* Action Buttons */
.results-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-print-checklist,
.btn-save-checklist,
.btn-reset-checklist {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-print-checklist {
    background: var(--primary-color);
    color: white;
}

.btn-print-checklist:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-save-checklist {
    background: var(--secondary-color);
    color: white;
}

.btn-save-checklist:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-reset-checklist {
    background: var(--text-lighter);
    color: white;
}

.btn-reset-checklist:hover {
    background: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive Design for Safety Checklist */
@media (max-width: 768px) {
    .safety-checklist {
        padding: 1.5rem;
    }
    
    .checklist-section {
        padding: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn-print-checklist,
    .btn-save-checklist,
    .btn-reset-checklist {
        width: 100%;
    }
}

/* ============================================
   EMERGENCY CONTACT CARD GENERATOR
   ============================================ */

.emergency-card-generator {
    background: var(--bg-lighter);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.generator-form h3,
.card-preview h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions,
.card-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* .btn-primary / .btn-secondary base + hover duplicate removed here
   (canonical: components/buttons.css). Emergency-card-generator context
   only needed the border-radius/border reset below. */
.emergency-card-generator .btn-primary,
.emergency-card-generator .btn-secondary {
    border: none;
    border-radius: 6px;
}

.preview-note {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Emergency Card Styles */
.emergency-card {
    background: white;
    border: 3px solid var(--error-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Scoped to .emergency-card-generator: unscoped .card-header collided with
   the generic Bootstrap-style .card-header used sitewide (components/
   cards.css / style.css line ~731), silently forcing white text onto every
   plain card's heading. This was masked while global h1-h6 rules hardcoded
   a text color (overriding any inherited white); once headings switched to
   color:inherit (see css/base/typography.css) to fix an unrelated hero-
   heading bug, this collision surfaced as invisible card headers sitewide.
   Confirmed via emergency-procedures/index.html's #btn-preview-card flow --
   the only page relying on this unscoped rule without an inline override. */
.emergency-card-generator .card-header {
    background: var(--error-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.emergency-card-generator .card-header h4 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.card-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.card-body {
    padding: 2rem;
}

.card-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 6px;
}

.card-section.highlight {
    background: var(--warning-light-bg);
    border: 2px solid var(--warning-color);
}

.card-section.important {
    background: var(--error-light-bg);
    border: 2px solid var(--error-color);
}

.card-section h5 {
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.card-section p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.card-section strong {
    color: var(--text-dark);
    min-width: 150px;
    display: inline-block;
}

.card-footer {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.card-disclaimer {
    font-style: italic;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.card-actions {
    margin-top: 2rem;
}

/* Responsive Design for Emergency Card */
@media (max-width: 768px) {
    .emergency-card-generator {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions,
    .card-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-section {
        padding: 0.75rem;
    }
}

/* ============================================
   MYTH CARDS (for Myths Debunked page)
   ============================================ */

.myth-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.myth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.myth-header {
    padding: 1.5rem;
    border-bottom: 3px solid;
}

.myth-header.myth-false {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: var(--error-color);
}

.myth-header.myth-true {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: var(--success-color);
}

.myth-header h3 {
    color: var(--error-color);
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.myth-header.myth-true h3 {
    color: var(--success-color);
}

.myth-header p {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
}

.myth-reality {
    padding: 2rem;
}

.myth-reality h3 {
    color: var(--success-color);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.myth-reality h4 {
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.1rem;
}

.myth-reality p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.myth-reality ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

.myth-reality ul li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.6;
}

.myth-reality ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* FAQ Grid for smaller myth items */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.faq-item {
    background: var(--bg-lighter);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-hover);
}

.faq-item h3 {
    color: var(--text-dark);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.faq-item p {
    margin: 0;
    line-height: 1.6;
}

.faq-item strong {
    color: var(--success-color);
}

/* Responsive Design for Myth Cards */
@media (max-width: 768px) {
    .myth-card {
        margin: 1.5rem 0;
    }
    
    .myth-header,
    .myth-reality {
        padding: 1.25rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============================================
   PAGE OF THE DAY WIDGET
   ============================================ */

.page-of-day {
    background: linear-gradient(135deg, var(--primary-light-bg) 0%, var(--bg-lighter) 100%);
    padding: 3rem 0;
    margin: 2rem 0;
}

.potd-featured {
    max-width: 900px;
    margin: 0 auto;
}

.potd-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.potd-main-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    border: 2px solid transparent;
}

.potd-main-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.potd-main-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

.potd-icon-large {
    font-size: 4rem;
    flex-shrink: 0;
    text-align: center;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light-bg), var(--primary-light));
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.2);
}

.potd-content {
    flex: 1;
}

.potd-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.potd-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-weight: 700;
    line-height: 1.3;
}

.potd-description {
    font-size: 1.05rem;
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.potd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.potd-tag {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.potd-tag:hover {
    background: var(--primary-light-bg);
    border-color: var(--primary-light);
}

.potd-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(74, 124, 89, 0.3);
}

.potd-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 124, 89, 0.4);
}

.potd-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.potd-info {
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    color: var(--text-medium);
    font-size: 0.95rem;
    margin: 0;
    display: inline-block;
}

.potd-info strong {
    color: var(--primary-color);
}

/* Responsive Design for Page of the Day */
@media (max-width: 768px) {
    .page-of-day {
        padding: 2rem 0;
    }
    
    .potd-main-card {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .potd-icon-large {
        width: 80px;
        height: 80px;
        font-size: 3rem;
        margin: 0 auto;
    }
    
    .potd-title {
        font-size: 1.5rem;
    }
    
    .potd-description {
        font-size: 1rem;
    }
    
    .potd-button {
        width: 100%;
        text-align: center;
    }
    
    .potd-info {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   ENHANCED SITE STATISTICS
   ============================================ */

.site-stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.site-stats h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.stat-card.animated::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(123, 97, 255, 0.2);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInDown 0.6s ease forwards;
}

.stat-card.animated .stat-icon {
    opacity: 1;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stat-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Stats Highlights */
.stats-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.highlight-stat {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.highlight-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(123, 97, 255, 0.15);
}

.highlight-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.highlight-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.highlight-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.highlight-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Counter Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-card.animated .stat-number {
    animation: countUp 0.6s ease forwards;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    .stat-description {
        font-size: 0.8rem;
    }
    
    .stats-highlights {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .highlight-stat {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .highlight-number {
        font-size: 1.5rem;
    }
}


/* ============================================
   SEARCH SUGGESTIONS & RESULTS
   ============================================ */

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

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

.suggestion-item {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.suggestion-item:hover {
    background: rgba(123, 97, 255, 0.1);
}

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

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.suggestion-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    flex: 1;
}

.suggestion-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    white-space: nowrap;
}

.suggestion-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.suggestion-item mark,
.search-result-item mark {
    background: rgba(255, 215, 0, 0.3);
    color: inherit;
    font-weight: 600;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.no-results {
    padding: 2rem;
    text-align: center;
}

.no-results p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.no-results-tip {
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 1.5rem;
}

.no-results-suggestions {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-suggestions li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.no-results-suggestions li::before {
    content: '→ ';
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Search Results Modal */
.search-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.search-results-container {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-gradient);
    color: white;
}

.search-results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-search-results {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-search-results:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-results-content {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.results-count {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-item {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
}

.search-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(123, 97, 255, 0.15);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.result-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-dark);
    flex: 1;
}

.result-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    white-space: nowrap;
}

.result-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.result-url {
    display: block;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    font-family: monospace;
}

/* Responsive Search */
@media (max-width: 768px) {
    .search-results-modal {
        padding: 0;
    }
    
    .search-results-container {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .search-results-header {
        padding: 1rem 1.5rem;
    }
    
    .search-results-header h2 {
        font-size: 1.25rem;
    }
    
    .search-results-content {
        padding: 1rem;
    }
    
    .search-result-item {
        padding: 1rem;
    }
    
    .suggestion-item {
        padding: 0.875rem;
    }
}

/* Search Box Positioning */
.search-box {
    position: relative;
}

.search-form {
    position: relative;
}

/* ========================================
   SAFETY DISCLAIMER / CALLOUT COMPONENT
   Mirrors css/components/alerts.css so the ~645 pages that load this
   monolith also style .warning-box (harm-reduction/medical disclaimer)
   and the other callout classes. Previously .warning-box was undefined
   here and rendered unstyled. No HTML edits required.
   ======================================== */

.alert,
.warning-box,
.warning,
.callout,
.note,
.disclaimer,
.info-box,
.notice {
    position: relative;
    padding: var(--spacing-md) var(--spacing-lg);
    padding-left: calc(var(--spacing-lg) + 0.25rem);
    margin: 0 0 var(--spacing-md) 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--info-color);
    border-radius: var(--radius-md);
    background-color: var(--info-bg);
    color: #1f2933;
    font-size: 0.95rem;
    line-height: 1.6;
}

.alert > :first-child,
.warning-box > :first-child,
.callout > :first-child,
.disclaimer > :first-child,
.info-box > :first-child,
.notice > :first-child {
    margin-top: 0;
}

.alert > :last-child,
.warning-box > :last-child,
.callout > :last-child,
.disclaimer > :last-child,
.info-box > :last-child,
.notice > :last-child {
    margin-bottom: 0;
}

.alert__icon,
.warning-box__icon {
    margin-right: 0.5rem;
}

/* Warning (default for the harm-reduction disclaimer) */
.alert--warning,
.warning-box,
.warning,
.disclaimer {
    background-color: var(--warning-bg);
    border-left-color: var(--warning-color);
    border-color: rgba(217, 119, 6, 0.25);
    color: #663c00;
}

/* Danger */
.alert--danger {
    background-color: var(--error-bg);
    border-left-color: var(--error-color);
    border-color: rgba(220, 38, 38, 0.25);
    color: #7a1c1c;
}

/* Info */
.alert--info,
.info-box,
.note,
.notice {
    background-color: var(--info-bg);
    border-left-color: var(--info-color);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1e3a5f;
}

/* Success */
.alert--success {
    background-color: var(--success-bg);
    border-left-color: var(--success-color);
    border-color: rgba(22, 163, 74, 0.25);
    color: #14532d;
}

/* Generic neutral callout */
.callout {
    background-color: var(--bg-light);
    border-left-color: var(--primary-color);
    border-color: rgba(74, 124, 89, 0.2);
    color: var(--text-dark);
}

/* Dark mode */
body.dark-mode .alert--warning,
body.dark-mode .warning-box,
body.dark-mode .warning,
body.dark-mode .disclaimer,
[data-theme="dark"] .alert--warning,
[data-theme="dark"] .warning-box,
[data-theme="dark"] .warning,
[data-theme="dark"] .disclaimer {
    background-color: #3a2e0a;
    border-left-color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
    color: #fde9bd;
}

body.dark-mode .alert--danger,
[data-theme="dark"] .alert--danger {
    background-color: #3a1414;
    border-left-color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    color: #fcd2d2;
}

body.dark-mode .alert--info,
body.dark-mode .info-box,
body.dark-mode .note,
body.dark-mode .notice,
[data-theme="dark"] .alert--info,
[data-theme="dark"] .info-box,
[data-theme="dark"] .note,
[data-theme="dark"] .notice {
    background-color: #14243a;
    border-left-color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.4);
    color: #cfe2ff;
}

body.dark-mode .alert--success,
[data-theme="dark"] .alert--success {
    background-color: #102a1a;
    border-left-color: #22c55e;
    border-color: rgba(34, 197, 94, 0.4);
    color: #bbf7d0;
}

body.dark-mode .callout,
[data-theme="dark"] .callout {
    background-color: #1f2937;
    border-left-color: #5fae62;
    border-color: rgba(95, 174, 98, 0.4);
    color: #e5e7eb;
}

