/* ===================================
   ROVEABILITY WEBSITE - MAIN STYLESHEET
   ===================================
   
   Project: RoveAbility - Accessible Outdoor Trails Platform
   Description: Helping people with mobility needs discover accessible outdoor routes
   Version: 2.0
   Last Updated: 2025
   
   Architecture:
   - CSS Custom Properties (Variables) for design tokens
   - Mobile-first responsive design
   - Component-based organization
   - Semantic HTML5 structure
   - Accessibility-focused styling
   
   Browser Support: Modern browsers (ES2020+)
   =================================== */
@import url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/open-dyslexic.css');
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Lexend:wght@300;400;500;600;700&display=swap');

/* ===================================
   ACCESSIBILITY: REDUCED MOTION (WCAG 2.1 Criterion 2.3.3)
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================
   GLOBAL RESET
   =================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ===================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   =================================== */
:root {
    /* Primary Colors (Light mode defaults) */
    --primary-bg-color: #f5f6f7;
    --secondary-bg-color: #f9bb0115;
    --primary-color: #001727; /* Use primary color as body text color in light mode */
    --accent-color: #F9BB01;  /* Preserve brand accent separately */

    /* Body text color (default for light theme) */
    --body-text-color: #001727;
    --text-color: var(--body-text-color);

    /* Panel / UI surfaces */
    --panel-bg-color: #f8f9fb;
    --panel-text-color: #001727;
    --panel-border-color: #e6e6e6;

    /* Header */
    --header-bg-color: var(--panel-bg-color); /* use light grey panel color instead of white */
    --header-text-color: var(--body-text-color);
    
    /* Table Colors */
    --table-border-color: #8f6a00;
    --table-header-bg: #3d2d00;
    --table-header-text: #ffe494;
    
    /* Accessibility Rating Colors */
    --mustard-tint: #be8b1366;
    --mustard-highlight: #fff1b3;
    --yellow-tint: #b8920066;
    --yellow-highlight: #fff3a0;
    --orange-tint: #b45a0066;
    --orange-highlight: #ffd19a;
    --red-tint: #b71d3f66;
    --red-highlight: #ffc5d1;
    --green-tint: #1c630033;
    --green-highlight: #d4f1d4;
    
    /* Accessibility Scoring Colors */
    --score-green: #1c6300;
    --score-yellow: #ffc107;
    --score-orange: #ff9800;
    --score-red: #b71d3f;
    
    /* Typography */
    --font-family-primary: 'Inter', 'Segoe UI', 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    --line-height-base: 1.6;
    --border-radius-base: 8px;
    --transition-base: 0.3s ease;
    --shadow-base: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.15);
}





.centered {
    text-align: center;
}

/* ===================================
   TYPOGRAPHY IMPROVEMENTS
   =================================== */

body {
    background-color: var(--primary-bg-color);
    color: var(--body-text-color);
    font-family: var(--font-family-primary);
    margin: 0;
    line-height: var(--line-height-base);
    font-weight: 400;
    scroll-behavior: smooth;
}

h1,
h2,
h3 {
    font-weight: 800;
}

h1 {
    font-size: clamp(2.75rem, 5vw, 4.25rem);
}

h2 {
    font-size: clamp(2.15rem, 4vw, 3.25rem);
}

h3 {
    font-size: clamp(1.65rem, 3vw, 2.25rem);
}

th, tr, thead, table {
    overflow: hidden;
}



/* ===================================
   MISSION STATEMENT
   =================================== */


.hero-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 100%;
    margin: 2rem 0 3rem 0;
    line-height: 1.4;
    border: none;
    padding: 0 2rem;
    font-weight: 600;
}

.mission-statement p {
    max-width: 100% !important; /* Override global 65ch limit */
    margin-bottom: 2rem;
}

p {
    font-size: 1.8rem; /* Significantly increased base paragraph size */
    line-height: 1.7;
    margin: 1.5rem 0;
    max-width: 100%;
}

/* Improved readability for mission section */
.padding-box > p {
    font-size: 2rem; /* Significantly increased introductory paragraph size */
    line-height: 1.8;
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
    font-weight: 400;
}

.padding-box > h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Box Components */
.margin-box {
    margin: 2rem auto;
    max-width: 1400px;
    width: 90%;
    padding: 3em;
    border-radius: 2em;
    font-size: 1.5em;
    display: flow-root;
}

.margin-label {
    margin: 2em auto;
    max-width: 1400px;
    width: 90%;
    padding: 1em;
    border-radius: 2em;
    font-size: 1em;
}

.padding-box {
    padding: 3em 5%; 
    margin: 2em auto; 
    max-width: 100%; 
    border-radius: 1.5em;
}

/* ===================================
   LAYOUT & GRID SYSTEM
   =================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    width: 100%;
    margin-top: 1.5rem;
}

.dashboard-card h3,
.dashboard-message h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    text-align: left;
}

.dashboard-card p,
.dashboard-message p {
    margin: 0;
    font-size: 1.1rem;
    text-align: left;
}

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

.dashboard-message {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    text-align: left;
}

.dashboard-message small {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.85;
}

.route-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    border: 2px solid #ca8a04;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fef08a;
    color: #713f12;
}

.route-status-badge[data-state="needs_amendments"] {
    background: #ffedd5;
    color: #9a3412;
    border-color: #ea580c;
}

.route-status-badge[data-state="rejected"] {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.route-status-badge[data-state="pending"] {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #0284c7;
}

.route-status-badge[data-state="approved"] {
    background: #dcfce7;
    color: #166534;
    border-color: #16a34a;
}

html.theme-dark .route-status-badge {
    background: rgba(249, 187, 1, 0.2);
    color: #ffe494;
    border-color: #f9bb01;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

html.theme-dark .route-status-badge[data-state="needs_amendments"] {
    background: rgba(245, 158, 11, 0.25);
    color: #fef08a;
    border-color: #f59e0b;
}

html.theme-dark .route-status-badge[data-state="rejected"] {
    background: rgba(220, 38, 38, 0.25);
    color: #fecaca;
    border-color: #ef4444;
}

html.theme-dark .route-status-badge[data-state="pending"] {
    background: rgba(14, 165, 233, 0.25);
    color: #bae6fd;
    border-color: #38bdf8;
}

html.theme-dark .route-status-badge[data-state="approved"] {
    background: rgba(34, 197, 94, 0.25);
    color: #bbf7d0;
    border-color: #22c55e;
}

/* Page layout: keep content centered and readable */
main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main > * {
    width: 100%;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */


nav {
    width: auto;
    margin-top: 0;
}



/* --- ACCESSIBILITY: HIGH CONTRAST FOCUS --- 
   Ensures keyboard users can always see where the cursor is positioned.
*/
:focus-visible {
    outline: 4px solid var(--primary-color) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-bg-color), 0 0 0 7px #ffffff !important;
}

/* --- ACCESSIBILITY: SKIP LINK --- 
   Bypasses navigation for screen reader/keyboard users.
*/
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: var(--primary-bg-color);
    padding: 1rem 2rem;
    z-index: 10001;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Tooltip System */
.tooltip-trigger {
    position: relative;
    cursor: help;
    text-decoration: underline dotted;
}

.tooltip-box {
    visibility: hidden;
    width: 240px;
    background-color: #001727;
    color: #ffffff;
    text-align: center;
    border: 2px solid #F9BB01;
    padding: 12px;
    border-radius: 8px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

/* Search History Chips */
.search-history {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.history-chip {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    background: var(--secondary-bg-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 2rem;
    cursor: pointer;
}

.history-chip.clear {
    border-style: dashed;
    opacity: 0.8;
}

/* A11y: Leaflet Marker Focus */
.leaflet-marker-icon:focus-visible {
    outline: 4px solid var(--primary-color) !important;
    outline-offset: 2px;
    border-radius: 50%;
    z-index: 1000 !important;
}

/* Default lists should be vertical, not flex */
ul {
    margin: 0;
    padding-left: 1.2em;
}

.other-links {
    display: flex;
    width: 100%; /* Changed from 40% to fill container for centering */
    align-items: center; 
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding-left: 0;
    margin: 3rem auto;
}

.other-links li {
    display: flex;
}

li {
    list-style-type: none;
}

#logo,
.logo {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    margin: 0;
    justify-self: start;
    padding: 0.35rem 0.5rem;
    text-decoration: none;
    color: var(--header-text-color, var(--body-text-color));
}

#logo a,
.logo a {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    text-decoration: none;
    color: var(--header-text-color, var(--body-text-color));
    transition: transform 180ms ease, color 180ms ease, text-shadow 180ms ease;
}

#logo img,
.logo img,
.logo-image,
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Scaled up prominent logo box */
    width: 5.8rem;
    height: 5.8rem;
    border-radius: 0.8rem;
    border: 2.5px solid rgba(249, 187, 1, 0.95);
    object-fit: cover; /* crop image edges so it fills the box */
    /* Move the focal area lower in the frame so the wheel sits closer to the bottom (30% vertically) */
    object-position: center 30%;
    background: rgba(255, 255, 255, 0.02);
    color: var(--primary-color);
    box-shadow: 0 0 0.8rem rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.logo-text-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* Tablet override for logo positioning and sizing */
@media (max-width: 1024px) {
    #logo img, .logo img, .logo-image, .logo-mark {
        object-position: center 30%;
        width: 5rem;
        height: 5rem;
    }
}

/* Mobile override for logo positioning and sizing */
@media (max-width: 768px) {
    #logo img, .logo img, .logo-image, .logo-mark {
        object-position: center 30%;
        width: 4.4rem;
        height: 4.4rem;
    }
}

#logo a:hover,
#logo a:focus-visible,
.logo:hover,
.logo:focus-visible {
    transform: scale(1.03);
    text-shadow: 0 0 15px var(--primary-color);
}

.logo-name {
    color: var(--header-text-color, var(--body-text-color));
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.1;
    text-decoration: none;
}

.map-container {
    position: relative;
    z-index: 0;
    margin: 2em 0;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.map-page-title {
    margin-top: 3.5rem;
    text-align: center;
}

.map-instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
    margin: 2em 0;
    padding: 0 1em;
}

.instruction-card {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 1.5em;
    background: linear-gradient(135deg, var(--secondary-bg-color), transparent);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.instruction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 187, 1, 0.15);
}

.instruction-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.instruction-text h4 {
    margin: 0 0 0.5em 0;
    color: var(--primary-color);
    font-size: 1.1em;
}

.instruction-text p {
    margin: 0;
    color: var(--primary-color);
    opacity: 0.9;
    font-size: 0.9em;
    line-height: 1.4;
}



.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(35em, 1fr));
    gap: 1.5rem;
    justify-items: center;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: rgba(0, 23, 39, 0.95);
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    max-width: 40em;
    width: 100%;
}

.legend-icon {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    flex-shrink: 0;
    font-size: 0; /* Removes symbols from the legend markers */
}

.legend-icon.for-most {
    background-color: #00897b; /* Teal - Circle */
    border-radius: 50%;
}

.legend-icon.for-many {
    background-color: #0072b2; /* Blue - Square */
    border-radius: 4px;
}

.legend-icon.for-some {
    background-color: #d97706; /* Amber Gold - Diamond */
    border-radius: 3px;
    transform: rotate(45deg);
}

.legend-icon.for-few-suggested {
    background-color: #7b1fa2; /* Purple - Hexagon */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border-radius: 0;
}

.legend-icon.for-few-required {
    background-color: #d55e00; /* Vermilion - Triangle */
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
}

.legend-icon.for-very-few {
    background-color: #991b1b; /* Crimson - Octagon */
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    border-radius: 0;
}

.legend-icon.user-location {
    background: var(--primary-color);
    border: 2px solid var(--primary-bg-color);
    color: var(--primary-bg-color);
    transform: none;
    border-radius: 50%;
}

.legend-item span:not(.legend-icon) {
    font-size: 1.6rem;
    font-weight: 700;
    display: inline-block;
    text-align: left;
    line-height: 1.2;
    color: var(--primary-color);
}

.legend-icon.unknown {
    background: var(--secondary-bg-color);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}



.error-content {
    text-align: center;
    padding: 2em;
}

.error-content h3 {
    margin-bottom: 1em;
    color: var(--red-highlight);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    padding: 2em;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary-bg-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-icon {
    margin-right: 0.5em;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5em;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    border-radius: 2px;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(-45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(45deg);
}

#main-nav {
    transition: grid-template-rows 0.3s ease-out, visibility 0.3s, border-color 0.3s;
}

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

/* Tablet Styles */
@media (max-width: 1024px) {
    .hero-images {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
    }
    
    .hero-image {
        height: 220px;
    }
    
    header {
        padding: 0.5em 1.2em;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    section {
        margin: 3em 1.5em;
    }
    
    .padding-box {
        padding: 2.5em 10%;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Header and Navigation */
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        top: 1.5em;
        right: 1em;
    }

    #main-nav {
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-bg-color);
        border: 1px solid transparent;
        border-top: none;
        z-index: 1000;
        overflow: hidden;
    }

    #main-nav.active {
        grid-template-rows: 1fr;
        visibility: visible;
        border-color: var(--primary-color);
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5em 1em;
        min-height: auto;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    header nav {
        width: 100%;
        min-width: auto;
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5em;
        align-items: stretch;
        min-height: 0;
    }

    header nav li {
        padding: 0.5em;
        text-align: center;
        border-bottom: 1px solid var(--secondary-bg-color);
    }

    header nav li:not(:last-child)::after {
        display: none;
    }

    header nav a {
        display: block;
        padding: 0.8em;
        font-size: 1.3rem;
        font-weight: 700;
        font-family: var(--font-family-primary);
    }

    #logo {
        justify-self: start;
    }

    /* Hero Images */
    .hero-images {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
    
    .hero-image {
        height: 200px;
        border-radius: var(--border-radius-base);
    }
    
    .hero-image-left,
    .hero-image-right,
    .hero-image-center {
        border-radius: var(--border-radius-base);
    }
    
    /* Typography */
    h1 {
        font-size: 2.5rem;
        margin: 1em 0;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }
    
    /* Sections */
    section {
        margin: 2em 1em;
    }

    .padding-box {
        padding: 2em 1em;
        margin: 1em 0;
    }
    
    /* Footer */
    footer {
        padding: 2em 1em;
        margin-top: 2em;
    }

    footer h2 {
        font-size: 1.3em;
        margin-bottom: 1em;
    }

    footer nav p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8em;
        font-size: 0.9em;
    }
    
    /* Buttons */
    .highlight-link,
    .border-link {
        width: 100%;
        max-width: 300px;
        margin: 0.5em auto;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    header {
        padding: 0.35rem 0.6rem;
    }
    
    .hero-image {
        height: 180px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    section {
        margin: 1.5em 0.8em;
    }

    .padding-box {
        padding: 1.5em 0.8em;
    }

    footer {
        padding: 1.5em 0.8em;
    }
}

.map-element {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 23, 39, 0.3);
}

.location-error {
    background-color: var(--red-tint);
    border: 2px solid var(--red-highlight);
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    margin: 1em 0;
}

.location-error h3 {
    color: var(--red-highlight);
    margin-bottom: 1em;
}

.location-error p {
    color: var(--primary-color);
    margin-bottom: 1em;
}

.loading-indicator {
    background-color: var(--secondary-bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    margin: 1em 0;
}

.loading-indicator p {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.map-controls {
    display: flex;
    gap: 1em;
    margin-top: 1.5em;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    box-sizing: border-box;
    padding: 0 1.2em;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background-color: var(--primary-bg-color);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    line-height: 44px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.search-input::placeholder {
    color: var(--primary-color);
    opacity: 0.7;
}

.search-btn, .location-btn {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 1.5em;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background-color: var(--primary-bg-color);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.search-btn:hover, .location-btn:hover {
    background-color: var(--primary-color);
    color: var(--primary-bg-color);
    transform: translateY(-2px);
}

.search-btn.icon-only,
#combined-search-btn {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.search-btn.icon-only .btn-icon,
#combined-search-btn span,
#combined-search-btn .btn-icon {
    font-size: 1.4rem !important;
    line-height: 1 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-container button {
    flex-shrink: 0;
}

/* ── Search Input Group & Autocomplete Suggestions Dropdown ── */
.search-input-group {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 240px !important;
    min-width: 200px !important;
}

.search-suggestions {
    display: none;
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 138px !important; /* Exactly 3 items @ 46px */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    border: 1.5px solid rgba(0, 23, 39, 0.2) !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(0, 23, 39, 0.18) !important;
    z-index: 1050 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: #F9BB01 rgba(0, 23, 39, 0.08) !important;
}

.search-suggestions.visible {
    display: flex !important;
    flex-direction: column !important;
}

.search-container button.search-suggestion,
.search-suggestion {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 0 0.85rem !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 23, 39, 0.08) !important;
    text-align: left !important;
    cursor: pointer !important;
    color: #001727 !important;
    font-size: 0.9rem !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.search-container button.search-suggestion:last-child,
.search-suggestion:last-child {
    border-bottom: none !important;
}

.search-container button.search-suggestion:hover,
.search-container button.search-suggestion:focus,
.search-container button.search-suggestion.active,
.search-suggestion:hover,
.search-suggestion:focus,
.search-suggestion.active {
    background: rgba(249, 187, 1, 0.2) !important;
    color: #001727 !important;
    outline: none !important;
}

.search-suggestion .suggestion-label {
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto !important;
    text-align: left !important;
    color: inherit !important;
}

.search-suggestion .suggestion-label strong {
    color: #b45309 !important;
    text-decoration: underline !important;
}

.search-suggestion .suggestion-subtitle {
    font-size: 0.75rem !important;
    color: #64748b !important;
    margin-left: 0.5rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Dark Mode & High Contrast Autocomplete Dropdown */
html.theme-dark .search-suggestions,
body.a11y-high-contrast .search-suggestions {
    background: var(--panel-bg-color, #012136) !important;
    border-color: #F9BB01 !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6) !important;
    scrollbar-color: #F9BB01 rgba(0, 23, 39, 0.5) !important;
}

html.theme-dark .search-container button.search-suggestion,
html.theme-dark .search-suggestion,
body.a11y-high-contrast .search-container button.search-suggestion,
body.a11y-high-contrast .search-suggestion {
    color: #fff7d6 !important;
    border-bottom-color: rgba(249, 187, 1, 0.15) !important;
}

html.theme-dark .search-container button.search-suggestion:hover,
html.theme-dark .search-container button.search-suggestion:focus,
html.theme-dark .search-container button.search-suggestion.active,
html.theme-dark .search-suggestion:hover,
html.theme-dark .search-suggestion:focus,
html.theme-dark .search-suggestion.active,
body.a11y-high-contrast .search-container button.search-suggestion:hover,
body.a11y-high-contrast .search-container button.search-suggestion.active,
body.a11y-high-contrast .search-suggestion:hover,
body.a11y-high-contrast .search-suggestion.active {
    background: rgba(249, 187, 1, 0.25) !important;
    color: #F9BB01 !important;
}

html.theme-dark .search-suggestion .suggestion-label strong,
body.a11y-high-contrast .search-suggestion .suggestion-label strong {
    color: #F9BB01 !important;
}

html.theme-dark .search-suggestion .suggestion-subtitle,
body.a11y-high-contrast .search-suggestion .suggestion-subtitle {
    color: #94a3b8 !important;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7em 1em;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background-color: var(--primary-bg-color);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.filter-checkbox input {
    accent-color: var(--primary-color);
    width: 1rem;
    height: 1rem;
}

.search-btn:focus, .location-btn:focus {
    outline: none;
    box-shadow: 0 0 10px var(--primary-color);
}

.map-error {
    background-color: var(--red-tint);
    border: 2px solid var(--red-highlight);
    border-radius: 8px;
    padding: 2em;
    text-align: center;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-error h3 {
    color: var(--red-highlight);
    margin-bottom: 1em;
}

.map-error p {
    color: var(--primary-color);
    margin-bottom: 1em;
}

.route-info {
    padding: 1em;
    background-color: var(--primary-bg-color);
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    max-width: 250px;
}

.route-info h4 {
    color: var(--primary-color);
    margin: 0 0 0.5em 0;
    font-size: 1.1rem;
}

.route-info p {
    color: var(--primary-color);
    margin: 0.5em 0;
    font-size: 0.9rem;
}

.route-info a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: underline;
    font-size: 0.9rem;
}

.route-info a:hover {
    text-shadow: 0 0 10px var(--primary-color);
}

.map-placeholder {
    background-color: var(--secondary-bg-color);
    padding: 4em 2em;
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.map-placeholder h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1em;
}

.map-placeholder p {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1em;
    max-width: 600px;
}

.map-placeholder a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: underline;
}

.map-placeholder a:hover {
    text-shadow: 0 0 10px var(--primary-color);
}

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

#logo {
    font-size: 3em;
    font-weight: bold;
}

/* Shared site-wide layout and footer rules. */

.top-link {
    display: inline-block;
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    background: transparent;
    color: transparent;
    opacity: 0;
    pointer-events: none;
}

.top-link:focus {
    background: var(--primary-color);
    color: var(--primary-bg-color);
    opacity: 1;
    pointer-events: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--header-bg-color, var(--primary-bg-color));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border-color, rgba(0, 0, 0, 0.08));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 6.2rem;
    padding: 0.5rem 2rem;
}

nav ul {
    display: flex;
    margin: 0;
    align-items: center;
}

nav li {
    list-style-type: none;
    color: var(--primary-color);
    margin: 2em 1em;
    font-weight: bold;
    font-size: 2em;
    transition: transform 200ms ease;
}

nav li:not(#auth-slot):hover,
.logo:hover,
footer li:hover {
    transform: translateY(-0.15em);
    text-shadow: 0 0 0.25em white;
    transition: transform 200ms ease;
}

#auth-slot,
#auth-slot:hover,
nav #auth-slot:hover {
    transform: none !important;
    text-shadow: none !important;
}

.hero {
    justify-items: center;
}

.footer-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
}

.newsletter,
.contacts,
section.contacts {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

form div {
    display: flex;
    gap: 1em;
}

footer ul,
ul.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style-type: none;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: solid var(--primary-color) 2.5px;
    border-radius: 50%;
    background: rgba(249, 187, 1, 0.08);
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    width: 4.25rem;
    height: 4.25rem;
    min-width: 4.25rem;
    min-height: 4.25rem;
    box-sizing: border-box;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Platform-Specific Brand Themes */

/* 1. Email - Black */
.social-link.social-link-email,
#open-contact-modal.social-link {
    border-color: #111827;
    background: rgba(17, 24, 39, 0.08);
}
.social-link.social-link-email:hover,
.social-link.social-link-email:focus-visible,
#open-contact-modal.social-link:hover,
#open-contact-modal.social-link:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #111827;
    background-color: rgba(17, 24, 39, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

html.theme-dark .social-link.social-link-email,
html.theme-dark #open-contact-modal.social-link {
    border-color: #f3f4f6;
    background: rgba(255, 255, 255, 0.1);
}
html.theme-dark .social-link.social-link-email:hover,
html.theme-dark .social-link.social-link-email:focus-visible,
html.theme-dark #open-contact-modal.social-link:hover,
html.theme-dark #open-contact-modal.social-link:focus-visible {
    border-color: #f3f4f6;
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

html.theme-dark .social-link.social-link-email .social-icon {
    filter: invert(1);
}

/* 2. Facebook - Dark Blue */
.social-link.social-link-facebook {
    border-color: #1877F2;
    background: rgba(24, 119, 242, 0.1);
}
.social-link.social-link-facebook:hover,
.social-link.social-link-facebook:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #1877F2;
    background-color: rgba(24, 119, 242, 0.24);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4);
}
.social-link.social-link-facebook .social-icon {
    width: 2.75rem;
    height: 2.75rem;
    transform: scale(1.1);
}

/* 3. Instagram - Pink */
.social-link.social-link-instagram {
    border-color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}
.social-link.social-link-instagram:hover,
.social-link.social-link-instagram:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #E1306C;
    background-color: rgba(225, 48, 108, 0.24);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
}

/* 4. Reddit - Orange */
.social-link.social-link-reddit {
    border-color: #FF4500;
    background: rgba(255, 69, 0, 0.1);
}
.social-link.social-link-reddit:hover,
.social-link.social-link-reddit:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #FF4500;
    background-color: rgba(255, 69, 0, 0.24);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

/* 5. TikTok - Gold */
.social-link.social-link-tiktok {
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
}
.social-link.social-link-tiktok:hover,
.social-link.social-link-tiktok:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #F59E0B;
    background-color: rgba(245, 158, 11, 0.24);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* 6. YouTube - Red */
.social-link.social-link-youtube {
    border-color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
}
.social-link.social-link-youtube:hover,
.social-link.social-link-youtube:focus-visible {
    transform: translateY(-3px) scale(1.08);
    border-color: #FF0000;
    background-color: rgba(255, 0, 0, 0.24);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.social-icon {
    height: 2.35rem;
    width: 2.35rem;
    display: block;
    object-fit: contain;
}

.contact-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
}

.contact-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.contact-modal-content {
    width: 100%;
    max-width: 34rem;
    background-color: var(--primary-bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    box-sizing: border-box;
}

.contact-form-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.contact-form-body label {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    margin-top: 0.25rem;
}

.contact-form-body input,
.contact-form-body textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.close-modal {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

fieldset {
    border: solid var(--primary-color) 2px;
    border-radius: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding: 1em 2.5em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea {
    padding: 0.5em;
    border: 2px solid rgba(0, 23, 39, 0.4);
    background-color: #ffffff;
    color: #001727;
    border-radius: 0.75em;
    font-family: inherit;
}

select {
    border-radius: 0.75em;
    padding: 0.5em;
    border: 2px solid rgba(0, 23, 39, 0.4);
    background-color: #ffffff;
    color: #001727;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #556270;
    opacity: 1;
}

html.theme-dark input[type="text"],
html.theme-dark input[type="email"],
html.theme-dark input[type="password"],
html.theme-dark input[type="number"],
html.theme-dark input[type="search"],
html.theme-dark input[type="url"],
html.theme-dark input[type="tel"],
html.theme-dark textarea,
html.theme-dark select {
    background-color: #012136;
    color: #ffffff;
    border: 2px solid #F9BB01;
}

html.theme-dark select option {
    background-color: #012136;
    color: #ffffff;
}

html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder {
    color: rgba(255, 247, 214, 0.7);
    opacity: 1;
}

#user-badge:empty,
.user-badge:empty,
#user-badge.tier-free,
.user-badge.tier-free,
#user-badge.tier-standard,
.user-badge.tier-standard {
    display: none !important;
}

/* Visible user badges base layout */
#user-badge.tier-basic,
#user-badge.tier-advanced,
#user-badge.tier-ultimate,
#user-badge.tier-pro,
#user-badge.tier-business,
#user-badge.tier-admin,
.user-badge.tier-basic,
.user-badge.tier-advanced,
.user-badge.tier-ultimate,
.user-badge.tier-pro,
.user-badge.tier-business,
.user-badge.tier-admin {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-width: 75px;
    width: auto !important;
    max-width: max-content !important;
    height: auto;
    padding: 0.25rem 1.15rem !important;
    margin: 0 !important;
    align-self: center !important;
    vertical-align: middle !important;
    border-radius: 9999px !important;
    font-size: 1.1rem !important;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-family: var(--font-family-primary);
    box-sizing: border-box;
    line-height: 1.2;
    white-space: nowrap;
    text-shadow: none !important;
}

/* Level 1: Free (Teal) */
#user-badge.tier-free,
#user-badge.tier-standard,
.user-badge.tier-free,
.user-badge.tier-standard {
    display: none !important;
    background-color: #0f766e !important;
    color: #ffffff !important;
    border: 2.5px solid #2dd4bf !important;
}

/* Level 2: Basic (Royal Blue) */
#user-badge.tier-basic,
#user-badge.tier-advanced,
.user-badge.tier-basic,
.user-badge.tier-advanced {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border: 2.5px solid #60a5fa !important;
}

/* Level 3: Ultimate (Royal Purple) */
#user-badge.tier-ultimate,
#user-badge.tier-pro,
.user-badge.tier-ultimate,
.user-badge.tier-pro {
    background-color: #6b21a8 !important;
    color: #ffffff !important;
    border: 2.5px solid #c084fc !important;
}

/* Level 4: Business (Warm Amber Gold) */
#user-badge.tier-business,
.user-badge.tier-business {
    background-color: #78350f !important;
    color: #fef3c7 !important;
    border: 2.5px solid #fbbf24 !important;
}

/* Level 5: Admin (Ruby Crimson) */
#user-badge.tier-admin,
.user-badge.tier-admin {
    background-color: #881337 !important;
    color: #ffe4e6 !important;
    border: 2.5px solid #fb7185 !important;
}

#user-badge.tier-admin,
.user-badge.tier-admin {
    cursor: default !important;
    text-decoration: none !important;
    pointer-events: none !important;
}

#user-badge:not(.tier-admin),
.user-badge:not(.tier-admin) {
    cursor: default !important;
    pointer-events: none !important;
}

html.theme-dark #user-badge:empty,
html.theme-dark .user-badge:empty,
html.theme-dark #user-badge.tier-free,
html.theme-dark .user-badge.tier-free,
html.theme-dark .user-badge.tier-standard,
.theme-dark #user-badge:empty,
.theme-dark .user-badge:empty,
.theme-dark #user-badge.tier-free,
.theme-dark .user-badge.tier-free,
.theme-dark .user-badge.tier-standard {
    display: none !important;
}

html.theme-dark #user-badge.tier-basic,
html.theme-dark #user-badge.tier-advanced,
html.theme-dark .user-badge.tier-basic,
html.theme-dark .user-badge.tier-advanced {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
}

html.theme-dark #user-badge.tier-ultimate,
html.theme-dark #user-badge.tier-pro,
html.theme-dark .user-badge.tier-ultimate,
html.theme-dark .user-badge.tier-pro {
    background-color: #6b21a8 !important;
    color: #ffffff !important;
    border-color: #c084fc !important;
}

html.theme-dark #user-badge.tier-business,
html.theme-dark .user-badge.tier-business {
    background-color: #78350f !important;
    color: #fef3c7 !important;
    border-color: #fbbf24 !important;
}

html.theme-dark #user-badge.tier-admin,
html.theme-dark .user-badge.tier-admin {
    background-color: #881337 !important;
    color: #ffe4e6 !important;
    border-color: #fb7185 !important;
}

/* ===================================
   ADMIN ACCESS LEVEL SWITCHER
   =================================== */
.admin-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
    width: 100%;
}

.admin-level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family-primary);
    text-decoration: none;
    min-height: 70px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-level-num {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    margin-bottom: 3px;
}

.admin-level-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* Level 1: Free (Teal) */
.admin-level-btn[data-level="1"] {
    border: 2px solid #0d9488;
    background: #f0fdfa;
    color: #115e59;
}
.admin-level-btn[data-level="1"]:hover {
    border-color: #0f766e;
    background: #ccfbf1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}
.admin-level-btn[data-level="1"].active {
    background: #0f766e !important;
    border-color: #2dd4bf !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.55) !important;
    transform: scale(1.02);
}
.admin-level-btn[data-level="1"].active .admin-level-num,
.admin-level-btn[data-level="1"].active .admin-level-name {
    color: #ffffff !important;
}

/* Level 2: Basic (Blue) */
.admin-level-btn[data-level="2"] {
    border: 2px solid #2563eb;
    background: #eff6ff;
    color: #1e40af;
}
.admin-level-btn[data-level="2"]:hover {
    border-color: #1d4ed8;
    background: #dbeafe;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
.admin-level-btn[data-level="2"].active {
    background: #1e40af !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.55) !important;
    transform: scale(1.02);
}
.admin-level-btn[data-level="2"].active .admin-level-num,
.admin-level-btn[data-level="2"].active .admin-level-name {
    color: #ffffff !important;
}

/* Level 3: Ultimate (Purple) */
.admin-level-btn[data-level="3"] {
    border: 2px solid #9333ea;
    background: #faf5ff;
    color: #6b21a8;
}
.admin-level-btn[data-level="3"]:hover {
    border-color: #7e22ce;
    background: #f3e8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.2);
}
.admin-level-btn[data-level="3"].active {
    background: #6b21a8 !important;
    border-color: #c084fc !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.55) !important;
    transform: scale(1.02);
}
.admin-level-btn[data-level="3"].active .admin-level-num,
.admin-level-btn[data-level="3"].active .admin-level-name {
    color: #ffffff !important;
}

/* Level 4: Business (Amber Gold) */
.admin-level-btn[data-level="4"] {
    border: 2px solid #d97706;
    background: #fffbeb;
    color: #78350f;
}
.admin-level-btn[data-level="4"]:hover {
    border-color: #b45309;
    background: #fef3c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}
.admin-level-btn[data-level="4"].active {
    background: #78350f !important;
    border-color: #fbbf24 !important;
    color: #fef3c7 !important;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.55) !important;
    transform: scale(1.02);
}
.admin-level-btn[data-level="4"].active .admin-level-num,
.admin-level-btn[data-level="4"].active .admin-level-name {
    color: #fef3c7 !important;
}

/* Level 5: Admin (Ruby Crimson) */
.admin-level-btn[data-level="5"] {
    border: 2px solid #e11d48;
    background: #fff1f2;
    color: #881337;
}
.admin-level-btn[data-level="5"]:hover {
    border-color: #be123c;
    background: #ffe4e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2);
}
.admin-level-btn[data-level="5"].active {
    background: #881337 !important;
    border-color: #fb7185 !important;
    color: #ffe4e6 !important;
    box-shadow: 0 0 14px rgba(251, 113, 133, 0.55) !important;
    transform: scale(1.02);
}
.admin-level-btn[data-level="5"].active .admin-level-num,
.admin-level-btn[data-level="5"].active .admin-level-name {
    color: #ffe4e6 !important;
}

.admin-level-status {
    font-weight: 600;
    min-height: 1.5rem;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Dark Mode Admin Level Buttons */
html.theme-dark .admin-level-btn[data-level="1"] {
    background: #042f2e;
    border-color: #0d9488;
    color: #ccfbf1;
}
html.theme-dark .admin-level-btn[data-level="1"]:hover {
    background: #115e59;
    border-color: #2dd4bf;
}
html.theme-dark .admin-level-btn[data-level="1"].active {
    background: #0f766e !important;
    border-color: #2dd4bf !important;
    color: #ffffff !important;
}

html.theme-dark .admin-level-btn[data-level="2"] {
    background: #172554;
    border-color: #3b82f6;
    color: #dbeafe;
}
html.theme-dark .admin-level-btn[data-level="2"]:hover {
    background: #1e40af;
    border-color: #60a5fa;
}
html.theme-dark .admin-level-btn[data-level="2"].active {
    background: #1e40af !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
}

html.theme-dark .admin-level-btn[data-level="3"] {
    background: #3b0764;
    border-color: #a855f7;
    color: #f3e8ff;
}
html.theme-dark .admin-level-btn[data-level="3"]:hover {
    background: #581c87;
    border-color: #c084fc;
}
html.theme-dark .admin-level-btn[data-level="3"].active {
    background: #6b21a8 !important;
    border-color: #c084fc !important;
    color: #ffffff !important;
}

html.theme-dark .admin-level-btn[data-level="4"] {
    background: #451a03;
    border-color: #f59e0b;
    color: #fef3c7;
}
html.theme-dark .admin-level-btn[data-level="4"]:hover {
    background: #78350f;
    border-color: #fbbf24;
}
html.theme-dark .admin-level-btn[data-level="4"].active {
    background: #78350f !important;
    border-color: #fbbf24 !important;
    color: #fef3c7 !important;
}

html.theme-dark .admin-level-btn[data-level="5"] {
    background: #4c0519;
    border-color: #f43f5e;
    color: #ffe4e6;
}
html.theme-dark .admin-level-btn[data-level="5"]:hover {
    background: #881337;
    border-color: #fb7185;
}
html.theme-dark .admin-level-btn[data-level="5"].active {
    background: #881337 !important;
    border-color: #fb7185 !important;
    color: #ffe4e6 !important;
}

/* Prefs Cog Sidebar Admin Access Level Dropdown */
.prefs-admin-dropdown-wrap {
    margin: 10px 0;
    width: 100%;
}

.prefs-admin-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #57754b;
    background-color: var(--primary-bg-color, #ffffff);
    color: var(--body-text-color, #001727);
    font-family: var(--font-family-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.prefs-admin-select:hover,
.prefs-admin-select:focus {
    border-color: #f9bb01;
    box-shadow: 0 0 8px rgba(249, 187, 1, 0.4);
}

html.theme-dark .prefs-admin-select {
    background-color: #1a2530;
    border-color: #57754b;
    color: #f5f6f7;
}

html.theme-dark .prefs-admin-select:hover,
html.theme-dark .prefs-admin-select:focus {
    border-color: #f9bb01;
}

.prefs-admin-status {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 0;
    min-height: 1.2rem;
    text-align: left;
}

:root:not(.theme-dark) #prefs-drawer,
:root:not(.theme-dark) #prefs-drawer h2,
:root:not(.theme-dark) #prefs-drawer h3,
:root:not(.theme-dark) #prefs-drawer p,
:root:not(.theme-dark) #prefs-drawer label,
:root:not(.theme-dark) .prefs-toggle-label,
:root:not(.theme-dark) .prefs-desc,
:root:not(.theme-dark) .prefs-lang-name {
    color: #000000 !important;
}

:root:not(.theme-dark) .prefs-drawer-header h2 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #000000 !important;
}

main {
    /* overridden above (kept for backwards compatibility) */
    justify-items: center;
}

article {
    display: block;
    margin: auto;
}

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5em;
    width: min(70em, 94vw);
}

.team-grid figure {
    margin: 0;
    flex: 0 1 calc((100% - 3em) / 3);
}

.team-grid figure > img {
    width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .team-grid figure {
        flex-basis: calc((100% - 1.5em) / 2);
    }
}

@media (max-width: 560px) {
    .team-grid figure {
        flex-basis: 100%;
    }
}

figure {
    text-align: center;
}

figcaption {
    font-size: 1.5em;
}

figure > img {
    border: var(--secondary-bg-color) solid;
    border-radius: 2em;
}

/* Global Utilities */

svg {
    fill: var(--primary-color);
}

section {
    margin: 4em auto;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    margin: 1.5rem auto 0;
    border-top: none;
    max-width: 1600px;
    width: 100%;
    box-sizing: border-box;
}

footer h2,
footer h2.centered {
    width: auto;
    margin: 0 0 0.35rem 0 !important;
    text-align: center;
    line-height: 1.2;
}

footer p,
footer .contact-subtitle {
    margin: 0 0 1.25rem 0 !important;
    text-align: center;
    line-height: 1.4;
    max-width: 600px;
}

footer nav {
    width: fit-content;
    margin-bottom: 0.5em;
}

footer nav p {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45em;
}

footer nav svg {
    display: block;
}

table {
    border-collapse: collapse;
    border-radius: 1em;
    border-style: hidden;
    box-shadow: 0 0 0 2px var(--table-border-color);
    margin: 2em auto;
}


table tr:first-child th:first-child {
    border-top-left-radius: 1em;
}

table tr:first-child th:last-child {
    border-top-right-radius: 1em;
}

th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    border-bottom: var(--table-border-color) solid;
}

/* Route link styling for the Sites table */
.route-link {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: color 0.2s ease, border-bottom-style 0.2s ease;
}

.route-link:hover {
    color: #ffd64f;
    border-bottom-style: solid;
}

th, td {
    padding: 2em;
}

.for-most {
    background-color: #00897b; /* Teal - Circle */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #00695c 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.for-many {
    background-color: #0072b2; /* Blue - Square */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #005080 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.for-some {
    background-color: #d97706; /* Amber Gold - Diamond */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #b45309 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.for-few-suggested {
    background-color: #7b1fa2; /* Purple - Hexagon */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #581c87 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.for-few-required {
    background-color: #d55e00; /* Vermilion - Triangle */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #9a3412 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.for-very-few {
    background-color: #991b1b; /* Crimson - Octagon */
    padding: 0.4em 0.8em;
    color: #ffffff;
    border: solid #7f1d1d 1.5px;
    border-radius: 1em;
    font-weight: 700;
}

.background-tint {
    background-color: var(--panel-bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-base);
}

/* Light-mode high-contrast variant: keep panels solid light grey but enforce strong borders */
body.a11y-high-contrast-light .background-tint {
    background-color: var(--panel-bg-color) !important;
    border: 2px solid #000000 !important;
}

/* ===================================
   ACCESSIBILITY OVERRIDES
   =================================== */

/* High Contrast Mode */
body.a11y-high-contrast {
    --primary-bg-color: #000000;
    --primary-color: #ffffff;
    --secondary-bg-color: #000000;
    --table-header-bg: #ffffff;
    --table-header-text: #000000;
    --table-border-color: #ffffff;
}

body.a11y-high-contrast .background-tint {
    background-color: #000000;
    border: 2px solid #ffffff;
}

/* Reading Aloud Highlight */
.a11y-reading-highlight {
    background-color: rgba(249, 187, 1, 0.35);
    outline: 2px solid var(--primary-color);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

body.a11y-high-contrast .a11y-reading-highlight {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Large Text Mode — site-wide scaling via CSS custom property */
:root {
    --prefs-text-scale: 1;
}

body.a11y-large-text {
    font-size: calc(1rem * var(--prefs-text-scale, 1.15));
}

body.a11y-large-text p, 
body.a11y-large-text li,
body.a11y-large-text td,
body.a11y-large-text th,
body.a11y-large-text span,
body.a11y-large-text a,
body.a11y-large-text label,
body.a11y-large-text button,
body.a11y-large-text input,
body.a11y-large-text select,
body.a11y-large-text textarea,
body.a11y-large-text figcaption,
body.a11y-large-text blockquote,
body.a11y-large-text dt,
body.a11y-large-text dd {
    font-size: calc(1em * var(--prefs-text-scale, 1.15));
}

body.a11y-large-text h1 { font-size: calc(2.5rem * var(--prefs-text-scale, 1.15)); }
body.a11y-large-text h2 { font-size: calc(2.2rem * var(--prefs-text-scale, 1.15)); }
body.a11y-large-text h3 { font-size: calc(1.8rem * var(--prefs-text-scale, 1.15)); }
body.a11y-large-text h4 { font-size: calc(1.5rem * var(--prefs-text-scale, 1.15)); }
body.a11y-large-text h5 { font-size: calc(1.3rem * var(--prefs-text-scale, 1.15)); }
body.a11y-large-text h6 { font-size: calc(1.2rem * var(--prefs-text-scale, 1.15)); }

/* Text scale controls */
.prefs-text-scale-controls {
    display: none;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.prefs-text-scale-controls label {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.prefs-text-scale-controls input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

.prefs-hint {
    font-size: 0.8rem;
    color: rgba(249, 187, 1, 0.6);
    margin: 8px 0 0 0;
    text-align: left;
    font-style: italic;
}

/* Dyslexic Font Mode */
body.a11y-dyslexic-font {
    font-family: var(--a11y-font-family, 'OpenDyslexic', 'Segoe UI', sans-serif) !important;
    font-size: calc(1rem * var(--a11y-font-size-scale, 1)) !important;
    line-height: var(--a11y-line-height, 1.6) !important;
    letter-spacing: var(--a11y-letter-spacing, 0.01em) !important;
    word-spacing: var(--a11y-word-spacing, 0.04em) !important;
}

body.a11y-dyslexic-font p,
body.a11y-dyslexic-font li,
body.a11y-dyslexic-font td,
body.a11y-dyslexic-font span,
body.a11y-dyslexic-font a {
    font-family: inherit;
    letter-spacing: inherit;
    word-spacing: inherit;
}

.a11y-dyslexia-controls {
    display: none;
    margin-top: 0.8rem;
    padding: 0.8rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
}

.a11y-dyslexia-controls.is-active {
    display: block;
}

.a11y-dyslexia-controls label {
    display: block;
    margin: 0.65rem 0 0.25rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
}

.a11y-dyslexia-controls input,
.a11y-dyslexia-controls select {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.45rem;
    border-radius: 6px;
    border: 1px solid #ffffff;
}

.a11y-dyslexia-controls button {
    margin-top: 0.6rem;
    padding: 0.7rem;
    font-size: 0.95rem;
}

/* Accessibility Panel Styling */
#a11y-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

#a11y-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--primary-bg-color);
    font-size: 32px;
    border: 3px solid #ffffff;
    cursor: pointer;
    box-shadow: var(--shadow-elevated);
}

#a11y-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: #001727;
    color: #ffffff;
    border: 3px solid #F9BB01;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#a11y-menu h3 { 
    margin-top: 0; 
    font-size: 1.4rem; 
    color: #F9BB01; 
}

#a11y-menu button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 14px;
    background: rgba(249, 187, 1, 0.1);
    color: #ffffff;
    border: 2px solid #F9BB01;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#a11y-menu button:hover,
#a11y-menu button:focus-visible {
    background: rgba(249, 187, 1, 0.25);
    color: #ffd64f;
}

#a11y-menu button[aria-pressed="true"] {
    background: #F9BB01;
    color: #001727;
}



.padding-box > ul {
    font-size: 1.6rem;
    line-height: 1.8;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    list-style-type: none;
}

.padding-box > ul > li {
    text-align: left;
}

/* ===================================
   MENU BUTTONS ENHANCEMENT
   =================================== */

.highlight-link {
    background: linear-gradient(135deg, var(--primary-color), #ffd64f);
    padding: 0.875rem 1.75rem;
    color: var(--primary-bg-color);
    font-weight: 700;
    border-radius: var(--border-radius-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.2rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
    text-decoration: none;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(249, 187, 1, 0.25);
    letter-spacing: 0.01em;
}

.highlight-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.highlight-link:hover::before {
    left: 100%;
}

.border-link {
    border: 2px solid var(--primary-color);
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.2rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.border-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 187, 1, 0.1), transparent);
    transition: left 0.6s ease;
}

.border-link:hover::before {
    left: 100%;
}

.highlight-link:hover,
.highlight-link:focus-visible {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(249, 187, 1, 0.35);
    filter: brightness(1.1);
}

.border-link:hover,
.border-link:focus-visible {
    transform: translateY(-4px) scale(1.02);
    background-color: var(--secondary-bg-color);
    box-shadow: 0 12px 28px rgba(249, 187, 1, 0.25);
    border-color: #ffd64f;
    color: var(--primary-color);
}

/* Enhanced focus states */
.highlight-link:focus-visible,
.border-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* Responsive menu buttons */
@media (max-width: 768px) {
    .highlight-link,
    .border-link {
        width: 100%;
        max-width: 320px;
        margin: 0.5em auto;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 3rem;
    }
}

@media (max-width: 480px) {
    .highlight-link,
    .border-link {
        padding: 0.675rem 1.25rem;
        font-size: 0.95rem;
        min-height: 2.8rem;
    }
}

/* ===================================
   CONTACT SECTION & EMAIL BUTTON
   =================================== */

.contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
    width: 100%;
}

.contact-main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.newsletter-signup {
    margin: 1rem 0;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.newsletter-signup h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius-base);
    background: var(--primary-bg-color);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
}


.email-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), #ffd64f);
    color: var(--primary-bg-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: var(--border-radius-base);
    border: none;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
    box-shadow: 0 4px 12px rgba(249, 187, 1, 0.2);
    position: relative;
    overflow: hidden;
}

.email-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.email-button:hover::before {
    left: 100%;
}

.email-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(249, 187, 1, 0.3);
    filter: brightness(1.05);
}

.email-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.email-button svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-bg-color);
    transition: transform var(--transition-base);
}

.email-button:hover svg {
    transform: scale(1.1);
}

/* Responsive email button */
@media (max-width: 768px) {
    .contact-section {
        gap: 1.5rem;
    }
    
    .email-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .email-button {
        padding: 0.675rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ===================================
   SOCIAL MEDIA LINKS
   =================================== */

.social-media-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.social-media-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(249, 187, 1, 0.1);
    border: 2px solid var(--primary-color);
    transition: transform var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
    padding: 8px;
}

.social-media-links a:hover {
    transform: translateY(-3px) scale(1.1);
    background: var(--primary-color);
    box-shadow: 0 8px 24px rgba(249, 187, 1, 0.3);
}

.social-media-links a:hover svg {
    fill: var(--primary-bg-color);
}

.social-media-links svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    transition: fill var(--transition-base);
}

/* Responsive social media links */
@media (max-width: 768px) {
    .social-media-links {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .social-media-links a {
        width: 44px;
        height: 44px;
    }
    
    .social-media-links svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .social-media-links {
        gap: 0.8rem;
    }
    
    .social-media-links a {
        width: 40px;
        height: 40px;
    }
    
    .social-media-links svg {
        width: 18px;
        height: 18px;
    }
}


/* Override: make Sign In button a single solid color (primary) and remove gradient sheen */
.highlight-link {
    background: var(--primary-color) !important;
    color: #ffffff !important; /* ensure readable by default */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* In dark theme, prefer the panel/background color as text (dark on light-ish accent) */
.theme-dark .highlight-link {
    color: var(--primary-bg-color) !important;
}

.highlight-link::before {
    display: none !important; /* remove animated sheen */
}

.highlight-link:hover,
.highlight-link:focus-visible {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    filter: none;
}

/* Tidy auth-card: subtle border, no harsh shadow so it matches the site panels */
.auth-card {
    background-color: var(--panel-bg-color) !important;
    border: 1px solid var(--panel-border-color) !important;
    box-shadow: none !important;
    padding: 2rem !important;
    max-width: 720px;
    margin: 0 auto;
}

/* Ensure high-contrast light keeps the button readable */
body.a11y-high-contrast-light .highlight-link {
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.a11y-high-contrast-light .highlight-link::before { display: none !important; }

/* Force button text visible at the highest specificity */
button.highlight-link,
a.highlight-link,
input[type="submit"].highlight-link {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35) !important;
    font-weight: 800 !important;
    text-align: center !important;
    overflow: visible !important;
}

/* Minor responsive tweak to maintain full-width feel on small screens */
@media (max-width: 768px) {
    .auth-card { padding: 1.25rem !important; }
    .highlight-link, .border-link { width: 100%; max-width: 100%; }
}
/* Tier-based and Role-based badge colors (WCAG Compliant) */
.tier-free,
.tier-standard,
.badge-free,
.badge-standard,
.role-standard {
    background-color: #ccfbf1 !important;
    color: #115e59 !important;
    border: 1.5px solid #0d9488 !important;
}

.tier-basic,
.tier-advanced,
.badge-basic,
.badge-advanced,
.role-advanced {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 1.5px solid #3b82f6 !important;
}

.tier-ultimate,
.tier-pro,
.badge-ultimate,
.badge-pro,
.role-pro {
    background-color: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1.5px solid #a855f7 !important;
}

.tier-business,
.badge-business {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    border: 1.5px solid #f59e0b !important;
}

.tier-admin,
.badge-admin,
.role-admin {
    background-color: #ffe4e6 !important;
    color: #881337 !important;
    border: 1.5px solid #f43f5e !important;
}

/* Dark theme overrides for tier badges */
html.theme-dark .tier-free,
html.theme-dark .tier-standard,
html.theme-dark .badge-free,
html.theme-dark .badge-standard,
html.theme-dark .role-standard {
    background-color: #042f2e !important;
    color: #2dd4bf !important;
    border-color: #14b8a6 !important;
}

html.theme-dark .tier-basic,
html.theme-dark .tier-advanced,
html.theme-dark .badge-basic,
html.theme-dark .badge-advanced,
html.theme-dark .role-advanced {
    background-color: #172554 !important;
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}

html.theme-dark .tier-ultimate,
html.theme-dark .tier-pro,
html.theme-dark .badge-ultimate,
html.theme-dark .badge-pro,
html.theme-dark .role-pro {
    background-color: #3b0764 !important;
    color: #e9d5ff !important;
    border-color: #a855f7 !important;
}

html.theme-dark .tier-business,
html.theme-dark .badge-business {
    background-color: #451a03 !important;
    color: #fde68a !important;
    border-color: #d97706 !important;
}

html.theme-dark .tier-admin,
html.theme-dark .badge-admin,
html.theme-dark .role-admin {
    background-color: #4c0519 !important;
    color: #fecdd3 !important;
    border-color: #e11d48 !important;
}

.nav-auth-link {
    display: inline-block;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    font-family: inherit;
    line-height: inherit;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: transform 180ms ease, color 180ms ease, text-shadow 180ms ease;
}

.nav-auth-link:hover,
.nav-auth-link:focus-visible {
    color: #ffd64f;
    transform: translateY(-0.15em);
    text-shadow: 0 0 0.25em white;
}

#auth-slot {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-guest-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-guest-settings-icon {
    font-size: 0.9em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ===================================
   ACCOUNT DROPDOWN MENU
   =================================== */
.nav-account-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-account-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: var(--primary-color) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    font-family: inherit !important;
    transition: color 180ms ease, transform 180ms ease !important;
}

.nav-account-toggle:hover,
.nav-account-toggle:focus-visible,
.nav-account-dropdown.open .nav-account-toggle {
    color: #ffd64f !important;
    transform: translateY(-0.15em);
    text-shadow: 0 0 0.25em white;
}

.nav-account-chevron {
    font-size: 0.75em;
    transition: transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

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

.nav-account-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 175px;
    background-color: var(--panel-bg-color, #ffffff);
    color: var(--body-text-color, #001727);
    border: 1.5px solid var(--panel-border-color, rgba(0, 23, 39, 0.2));
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0;
    z-index: 10002;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transform-origin: top right;
    animation: navMenuFadeIn 0.18s ease-out;
    text-shadow: none !important;
}

.nav-account-menu * {
    text-shadow: none !important;
}

@keyframes navMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nav-account-dropdown.open .nav-account-menu {
    display: flex;
}

.nav-account-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem 1rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: var(--body-text-color, #001727) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    font-family: var(--font-family-primary) !important;
    cursor: pointer !important;
    text-align: left !important;
    text-decoration: none !important;
    text-shadow: none !important;
    filter: none !important;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

.nav-account-item:hover,
.nav-account-item:focus,
.nav-account-item:focus-visible {
    background-color: var(--secondary-bg-color, rgba(249, 187, 1, 0.15)) !important;
    color: var(--primary-color) !important;
    outline: none !important;
    text-shadow: none !important;
    filter: none !important;
}

.nav-account-item-icon {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: none !important;
    filter: none !important;
}

/* Dark mode & high contrast for Account menu */
html.theme-dark .nav-account-menu,
.theme-dark .nav-account-menu {
    background-color: #012136 !important;
    border-color: rgba(249, 187, 1, 0.4) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

html.theme-dark .nav-account-item,
.theme-dark .nav-account-item {
    color: #ffffff !important;
    text-shadow: none !important;
    filter: none !important;
}

html.theme-dark .nav-account-item:hover,
html.theme-dark .nav-account-item:focus,
html.theme-dark .nav-account-item:focus-visible,
.theme-dark .nav-account-item:hover,
.theme-dark .nav-account-item:focus,
.theme-dark .nav-account-item:focus-visible {
    background-color: rgba(249, 187, 1, 0.25) !important;
    color: #f9bb01 !important;
    text-shadow: none !important;
    filter: none !important;
}

body.a11y-high-contrast .nav-account-menu,
.theme-dark body.a11y-high-contrast .nav-account-menu {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

body.a11y-high-contrast .nav-account-item,
.theme-dark body.a11y-high-contrast .nav-account-item {
    color: #ffffff !important;
    text-shadow: none !important;
    filter: none !important;
}

body.a11y-high-contrast .nav-account-item:hover,
body.a11y-high-contrast .nav-account-item:focus-visible,
.theme-dark body.a11y-high-contrast .nav-account-item:hover,
.theme-dark body.a11y-high-contrast .nav-account-item:focus-visible {
    background: #ffffff !important;
    color: #000000 !important;
    text-shadow: none !important;
    filter: none !important;
}

/* Mobile responsive styling for Account dropdown */
@media (max-width: 768px) {
    .nav-account-dropdown {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .nav-account-toggle {
        justify-content: center !important;
        width: 100% !important;
        padding: 0.8em !important;
    }

    .nav-account-menu {
        position: static !important;
        display: flex !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0.25rem 0 !important;
        width: 100% !important;
        animation: none !important;
    }

    .nav-account-item {
        justify-content: center !important;
        padding: 0.65rem 1rem !important;
        font-size: 1.1rem !important;
        border-radius: 6px !important;
        margin: 2px 0 !important;
    }

    .nav-account-chevron {
        display: none !important;
    }

    #auth-slot {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: stretch !important;
        gap: 0.25rem !important;
    }

    .nav-guest-settings-btn {
        justify-content: center !important;
        width: 100% !important;
        padding: 0.8em !important;
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        font-family: var(--font-family-primary) !important;
    }
}

/* Auth page layout - larger card and darker outer background in light mode */
:root:not(.theme-dark) body.auth-page,
:root:not(.theme-dark) .auth-page {
    background-color: #d0d4d8 !important; /* darker grey outside the auth card in light mode */
}

/* Ensure this wins over broader selectors that used !important */
:root:not(.theme-dark) body.auth-page header,
:root:not(.theme-dark) body.auth-page footer,
:root:not(.theme-dark) .auth-page header,
:root:not(.theme-dark) .auth-page footer,
:root:not(.theme-dark) body.auth-page #main-content,
:root:not(.theme-dark) .auth-page #main-content,
:root:not(.theme-dark) body.auth-page main,
:root:not(.theme-dark) .auth-page main,
:root:not(.theme-dark) body.auth-page .padding-box,
:root:not(.theme-dark) .auth-page .padding-box {
    background-color: #d0d4d8 !important; /* match outer area in light mode */
    color: var(--body-text-color) !important;
}

/* Dark mode auth page layout */
.theme-dark body.auth-page,
.theme-dark .auth-page,
.theme-dark body.auth-page header,
.theme-dark body.auth-page footer,
.theme-dark .auth-page header,
.theme-dark .auth-page footer,
.theme-dark body.auth-page #main-content,
.theme-dark .auth-page #main-content,
.theme-dark body.auth-page main,
.theme-dark .auth-page main,
.theme-dark body.auth-page .padding-box,
.theme-dark .auth-page .padding-box {
    background-color: var(--primary-bg-color) !important;
    color: var(--body-text-color) !important;
}

.theme-dark .auth-page .auth-card {
    background-color: var(--panel-bg-color) !important;
    color: var(--panel-text-color) !important;
    border-color: var(--panel-border-color) !important;
}



.auth-page main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px); /* allow header/footer space */
    padding: 3rem 1rem;
}
.auth-page .auth-card {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 3rem !important;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.auth-page .auth-card h1 { font-size: 3rem; margin-top: 0; }

.auth-subtitle {
    max-width: 650px;
    margin: 0 auto 1.5em auto;
    text-align: center;
    display: block;
    line-height: 1.5;
}

.auth-form,
.admin-form {
    display: grid;
    gap: 0.8em;
    max-width: 500px;
    margin: 0 auto;
}

.auth-form input,
.admin-form input,
.admin-form select,
.admin-form textarea {
    padding: 0.8em 1em;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background-color: var(--primary-bg-color);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
}

.auth-error {
    margin: 0.5em auto 0 auto;
    max-width: 500px;
    color: var(--red-highlight);
}

.auth-hint {
    margin: 2em auto 0 auto;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-hint h2 {
    font-size: 1.4em;
}

.auth-hint ul {
    display: block;
    padding-left: 1.2em;
    line-height: 1.8;
}

.show-password-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--primary-color);
    user-select: none;
    padding: 0.4em 0;
}

.show-password-label input[type="checkbox"] {
    display: none;
}

.show-password-toggle {
    width: 44px;
    height: 24px;
    background-color: rgba(255,255,255,0.15);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.show-password-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.show-password-label input:checked + .show-password-toggle {
    background-color: rgba(249, 187, 1, 0.3);
    border-color: var(--primary-color);
}

.show-password-label input:checked + .show-password-toggle::after {
    transform: translateX(20px);
}

.auth-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.25rem 0 0.85rem;
    width: 100%;
}

.forgot-password-link {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-color, #0284c7);
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease, opacity 0.15s ease;
    padding: 0.35rem 0.25rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.forgot-password-link:hover {
    color: var(--highlight-color, #0284c7);
    text-decoration: underline;
    opacity: 0.9;
}

.forgot-password-link:focus-visible {
    outline: 2px solid var(--primary-color, #0284c7);
    outline-offset: 2px;
}

html.theme-dark .forgot-password-link {
    color: var(--highlight-color, #f9bb01);
}

html.theme-dark .forgot-password-link:hover {
    color: #fde047;
}

html.theme-dark .forgot-password-link:focus-visible {
    outline: 2px solid #f9bb01;
}

.auth-switch-btn {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    padding: 0.875rem 1.75rem !important;
    min-height: 3.2rem !important;
    margin: 0 !important;
}

/* ---------- Changing Places Toggle Switch ---------- */
.changing-places-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    user-select: none;
    padding: 0.4em 0.8em;
    border-radius: 8px;
    background: rgba(249, 187, 1, 0.08);
    border: 1px solid rgba(249, 187, 1, 0.2);
    transition: background-color 0.2s ease;
}

.changing-places-toggle:hover {
    background: rgba(249, 187, 1, 0.15);
}

.changing-places-toggle input[type="checkbox"] {
    display: none;
}

.cp-toggle-switch {
    width: 44px;
    height: 24px;
    background-color: rgba(255,255,255,0.15);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.cp-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.changing-places-toggle input:checked + .cp-toggle-switch {
    background-color: rgba(249, 187, 1, 0.3);
    border-color: var(--primary-color);
}

.changing-places-toggle input:checked + .cp-toggle-switch::after {
    transform: translateX(20px);
}

.cp-toggle-label {
    white-space: nowrap;
}

/* ---------- Sites controls / Search Bar & Table Controls ---------- */
.sites-controls,
#sites-controls {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.5rem 0 !important;
    padding: 1.15rem 1.4rem !important;
    border: 2px solid var(--primary-color, #F9BB01) !important;
    border-radius: 14px !important;
    background-color: var(--panel-bg-color, #012136) !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3) !important;
}

.sites-controls-form {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.search-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.search-container .search-input#route-search {
    flex: 2 1 260px;
    min-width: 200px;
}

.search-container select.search-input,
.search-container .search-select {
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 220px;
}

.search-container .search-btn,
.search-container .location-btn {
    flex: 0 0 auto;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 1.4em;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-container .search-btn.icon-only,
.search-container #combined-search-btn {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-container .fav-filter-label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--body-text-color, #fff7d6);
    margin-left: auto;
    user-select: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.search-container .fav-filter-label input[type="checkbox"] {
    accent-color: var(--primary-color, #F9BB01);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.search-container .fav-filter-label:hover {
    background-color: rgba(249, 187, 1, 0.12);
}

.admin-actions {
    display: flex;
    gap: 0.6em;
    justify-content: center;
    align-items: center;
}

/* ===================================
   PREFERENCES PULL-OUT DRAWER
   =================================== */
#prefs-tab {
    display: none !important;
}

/* High contrast search inputs and buttons in dark mode */
.theme-dark .search-input,
html.theme-dark .search-input,
body.theme-dark .search-input {
    background-color: #001727 !important;
    border-color: #F9BB01 !important;
    color: #ffffff !important;
}

.theme-dark .search-input::placeholder,
html.theme-dark .search-input::placeholder,
body.theme-dark .search-input::placeholder {
    color: rgba(255, 247, 214, 0.8) !important;
    opacity: 1 !important;
}

.theme-dark select.search-input option,
html.theme-dark select.search-input option,
body.theme-dark select.search-input option {
    background-color: #012136 !important;
    color: #ffffff !important;
}

.theme-dark .search-btn,
html.theme-dark .search-btn,
body.theme-dark .search-btn {
    background-color: #F9BB01 !important;
    color: #001727 !important;
    border: 2px solid #F9BB01 !important;
    font-weight: 700 !important;
}

.theme-dark .search-btn:hover,
html.theme-dark .search-btn:hover,
body.theme-dark .search-btn:hover {
    background-color: #ffd64f !important;
    border-color: #ffd64f !important;
    color: #000000 !important;
    box-shadow: 0 0 14px rgba(249, 187, 1, 0.55) !important;
}

.theme-dark .location-btn,
html.theme-dark .location-btn,
body.theme-dark .location-btn {
    background-color: rgba(249, 187, 1, 0.12) !important;
    color: #F9BB01 !important;
    border: 2px solid #F9BB01 !important;
    font-weight: 700 !important;
}

.theme-dark .location-btn:hover,
html.theme-dark .location-btn:hover,
body.theme-dark .location-btn:hover {
    background-color: #F9BB01 !important;
    color: #001727 !important;
    box-shadow: 0 0 12px rgba(249, 187, 1, 0.45) !important;
}

/* Core dark theme palette — drives the main background/text everywhere */
html.theme-dark {
    --primary-bg-color: #001727;
    --secondary-bg-color: #f9bb0122;
    --primary-color: #F9BB01;
    --accent-color: #F9BB01;
    --body-text-color: #fff7d6;
    --text-color: var(--body-text-color);
    --panel-bg-color: #012136;
    --panel-text-color: #fff7d6;
    --panel-border-color: #3d2d00;
    --header-bg-color: #001727;
    --header-text-color: #fff7d6;
    --table-border-color: #8f6a00;
    --table-header-bg: #3d2d00;
    --table-header-text: #ffe494;
    --bg-color: #001727;
}

html.theme-dark,
html.theme-dark body,
html.theme-dark main,
body.theme-dark {
    background-color: var(--primary-bg-color) !important;
    color: var(--body-text-color) !important;
}


#prefs-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: var(--panel-bg-color);
    border-left: 3px solid var(--primary-color);
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
    z-index: 10002;
    overflow-y: auto;
    transition: right 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--panel-bg-color);
}

#prefs-drawer::-webkit-scrollbar {
    width: 6px;
}

#prefs-drawer::-webkit-scrollbar-track {
    background: var(--panel-bg-color);
}

#prefs-drawer::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

#prefs-drawer.open {
    right: 0;
}

#prefs-drawer-content {
    padding: 20px;
}

.prefs-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(249, 187, 1, 0.2);
}

.prefs-drawer-header h2 {
    font-size: 1.6rem;
    margin: 0;
    text-align: left;
    background: linear-gradient(135deg, var(--primary-color), #ffd64f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prefs-close-btn {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.0.2s ease;
    line-height: 1;
    padding: 0;
}

.prefs-close-btn:hover {
    background: var(--primary-color);
    color: var(--primary-bg-color);
}

.prefs-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(249, 187, 1, 0.05);
    border: 1px solid rgba(249, 187, 1, 0.15);
    border-radius: 12px;
}

.prefs-section h3 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    text-align: left;
    color: var(--primary-color);
}

.prefs-desc {
    font-size: 0.85rem;
    margin: 0 0 15px 0;
    text-align: left;
    color: rgba(249, 187, 1, 0.7);
    line-height: 1.4;
}

/* Language Grid */
.prefs-language-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.prefs-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(249, 187, 1, 0.2);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.prefs-lang-btn:hover {
    background: rgba(249, 187, 1, 0.1);
    border-color: var(--primary-color);
}

.prefs-lang-btn.active {
    background: rgba(249, 187, 1, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(249, 187, 1, 0.3);
}

.prefs-lang-flag {
    font-size: 1.3rem;
    line-height: 1;
}

.prefs-lang-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Access Feature Toggles */
.prefs-toggle-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid var(--panel-border-color);
    border-radius: 8px;
    color: var(--panel-text-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    text-align: left;
}

.prefs-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0,0,0,0.12);
}

.prefs-toggle-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000; /* keep label readable on accent */
}

.prefs-toggle-track {
    width: 52px;
    height: 28px;
    background-color: rgba(0,0,0,0.06);
    border: 2px solid var(--panel-border-color);
    border-radius: 999px; /* pill */
    position: relative;
    flex-shrink: 0;
    padding: 2px;
    box-sizing: border-box;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.prefs-toggle-knob {
    position: absolute;
    top: 50%;
    left: 6px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--panel-text-color);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.18s cubic-bezier(.22,.9,.32,1), background-color 0.18s ease;
}

.prefs-toggle-btn.active .prefs-toggle-track {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.prefs-toggle-btn.active .prefs-toggle-knob {
    transform: translate(24px, -50%);
    background-color: #ffffff; /* knob becomes white on accent */
}

/* Decorative end-ball on active toggles: a small black circle at the far right of the track */
.prefs-toggle-btn.active .prefs-toggle-track::after {
    content: '';
    position: absolute;
    right: 6px; /* sit near the end of the pill */
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #000000;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.06) inset;
}

/* Ensure the ball is visible in light-high-contrast (white panels) by adding a thin white ring */
body.a11y-high-contrast-light .prefs-toggle-btn.active .prefs-toggle-track::after {
    box-shadow: 0 0 0 2px #ffffff; /* white ring to separate from white panel */
}

/* Ensure the ball is visible in dark high-contrast by adding subtle outline if needed */
body.a11y-high-contrast-dark .prefs-toggle-btn.active .prefs-toggle-track::after,
body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-track::after {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.06), 0 1px 2px rgba(0,0,0,0.2);
}

/* Ensure track keeps pill shape in dark mode too */
.theme-dark .prefs-toggle-track {
    border: 2px solid rgba(249,187,1,0.15);
    background-color: rgba(255,255,255,0.06);
}

.theme-dark .prefs-toggle-btn.active .prefs-toggle-knob {
    background-color: var(--primary-color);
}

.prefs-toggle-label {
    flex: 1;
}

/* High-contrast toggle — explicit light-mode styling for clarity */
:root:not(.theme-dark) .prefs-toggle-btn[data-prefs-setting="highContrast"] {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}
:root:not(.theme-dark) .prefs-toggle-btn[data-prefs-setting="highContrast"] .prefs-toggle-track {
    background: #f0f0f0;
    border-color: #000000;
}
:root:not(.theme-dark) .prefs-toggle-btn[data-prefs-setting="highContrast"].active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}
:root:not(.theme-dark) .prefs-toggle-btn[data-prefs-setting="highContrast"].active .prefs-toggle-track {
    background: #000000;
    border-color: #000000;
}
:root:not(.theme-dark) .prefs-toggle-btn[data-prefs-setting="highContrast"].active .prefs-toggle-knob {
    transform: translate(24px, -50%);
    background-color: #ffffff;
}

/* Quick bar button match */
:root:not(.theme-dark) .prefs-quick-btn[data-prefs-setting="highContrast"] {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}
:root:not(.theme-dark) .prefs-quick-btn[data-prefs-setting="highContrast"].active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Dark-mode specific tweaks: restore gold styling */
.theme-dark .prefs-toggle-btn {
    background: rgba(0,0,0,0.06);
    border: 2px solid rgba(249,187,1,0.15);
    color: var(--panel-text-color);
}

.theme-dark .prefs-toggle-btn:hover {
    background: rgba(249, 187, 1, 0.06);
}

.theme-dark .prefs-toggle-btn.active {
    background: rgba(249,187,1,0.15);
    border-color: var(--primary-color);
    color: var(--panel-text-color);
}

.theme-dark .prefs-toggle-track {
    background-color: rgba(255,255,255,0.08);
    border: 2px solid rgba(249,187,1,0.2);
}

.theme-dark .prefs-toggle-knob {
    background-color: rgba(249,187,1,0.5);
}

.theme-dark .prefs-toggle-btn.active .prefs-toggle-knob {
    background-color: var(--primary-color);
}

/* Action Button */
.prefs-action-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(249, 187, 1, 0.15), rgba(249, 187, 1, 0.05));
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin-top: 8px;
}

/* Quick-access mini bar (top-right) - removed: controls are now in the preferences drawer */
#prefs-quickbar {
    display: none !important;
}

.prefs-quick-btn {
    display: none !important;
}

.prefs-action-btn:hover {
    background: linear-gradient(135deg, rgba(249, 187, 1, 0.25), rgba(249, 187, 1, 0.1));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 187, 1, 0.2);
}

/* Google Translate — hide banner and tooltip */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-icon,
.goog-logo-link,
.goog-te-balloon-frame {
    display: none !important;
}

body {
    top: 0 !important;
}

.goog-tooltip,
.goog-tooltip:hover {
    display: none !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    #prefs-drawer {
        width: 100%;
        right: -100%;
    }

    #prefs-drawer.open {
        right: 0;
    }

    .prefs-language-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   BACK TO TOP BUTTON
   =================================== */
#back-to-top {
    position: fixed;
    bottom: 100px; /* Positioned above the accessibility toggle */
    right: 27px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--primary-bg-color);
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: var(--shadow-elevated);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: scale(1.1);
    background-color: #ffd64f;
}

.admin-small-btn {
    padding: 0.4em 0.8em;
    min-height: auto;
    border-radius: 0.8em;
}

/* ===================================
   HIGH CONTRAST MODE OVERRIDES
   Ensures a single explicit high-contrast palette that applies consistently
   across light and dark themes when the accessibility toggle is enabled.
   =================================== */
body.a11y-high-contrast {
    --primary-bg-color: #000000 !important;        /* page background */
    --panel-bg-color: #000000 !important;          /* panels/drawers */
    --body-text-color: #ffffff !important;         /* main text */
    --primary-color: #ffffff !important;           /* headings / primary */
    --accent-color: #ffff00 !important;            /* accents (high visibility yellow) */
    --panel-text-color: #ffffff !important;
    --panel-border-color: #ffffff !important;
    --header-bg-color: #000000 !important;
    --header-text-color: #ffffff !important;
}

/* Make sure body uses the high contrast background and text */
body.a11y-high-contrast,
body.a11y-high-contrast * {
    background-color: transparent !important; /* avoid accidental colored backgrounds on components */
    color: var(--body-text-color) !important;
    fill: var(--body-text-color) !important;
    border-color: var(--panel-border-color) !important;
}

/* Panels and surface elements should have an explicit panel background to separate content blocks */
body.a11y-high-contrast #prefs-drawer,
body.a11y-high-contrast .padding-box,
body.a11y-high-contrast .background-tint,
body.a11y-high-contrast .prefs-lang-btn,
body.a11y-high-contrast .margin-box,
body.a11y-high-contrast .map-placeholder,
body.a11y-high-contrast .route-info {
    background-color: var(--panel-bg-color) !important;
    color: var(--panel-text-color) !important;
    border-color: var(--panel-border-color) !important;
}

/* Links and interactive elements use high-visibility accent */
body.a11y-high-contrast a,
body.a11y-high-contrast header nav a,
body.a11y-high-contrast .highlight-link,
body.a11y-high-contrast .border-link,
body.a11y-high-contrast .email-button {
    color: var(--accent-color) !important;
}

/* Toggle and quickbar appearance in high contrast */
body.a11y-high-contrast .prefs-toggle-btn,
body.a11y-high-contrast .prefs-quick-btn {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.a11y-high-contrast .prefs-toggle-btn.active,
body.a11y-high-contrast .prefs-quick-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Ensure active toggle knob is visible */
body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-knob,
body.a11y-high-contrast .prefs-quick-btn.active {
    background-color: #000000 !important;
}

/* Reading highlight used by accessibility features */
body.a11y-high-contrast .a11y-reading-highlight {
    background: var(--accent-color) !important;
    color: #000 !important;
}

/* Ensure header background and text follow high-contrast vars */
body.a11y-high-contrast header,
body.a11y-high-contrast footer {
    background-color: var(--header-bg-color) !important;
    color: var(--header-text-color) !important;
}

/* Keep focus outlines extremely visible */
body.a11y-high-contrast :focus-visible {
    outline: 4px solid var(--accent-color) !important;
    outline-offset: 3px !important;
}

/* -------------------------------
   Ensure high-contrast appearance when dark theme is active
   This forces the same black/white/yellow palette and control styles
   whether light or dark base theme is selected.
   ------------------------------- */
.theme-dark body.a11y-high-contrast,
.theme-dark body.a11y-high-contrast * {
    /* set the canonical high-contrast variables */
    --primary-bg-color: #000000 !important;
    --panel-bg-color: #000000 !important;
    --body-text-color: #ffffff !important;
    --primary-color: #ffffff !important;
    --accent-color: #ffff00 !important;
    --panel-text-color: #ffffff !important;
    --panel-border-color: #ffffff !important;
    --header-bg-color: #000000 !important;
    --header-text-color: #ffffff !important;
    color: var(--body-text-color) !important;
    fill: var(--body-text-color) !important;
    border-color: var(--panel-border-color) !important;
}

/* Ensure the page background uses the high-contrast primary background */
body.a11y-high-contrast {
    background-color: var(--primary-bg-color) !important;
}

/* Make sure generic elements inherit readable text and borders (avoid forcing transparent backgrounds) */
body.a11y-high-contrast *,
.theme-dark body.a11y-high-contrast * {
    color: var(--body-text-color) !important;
    fill: var(--body-text-color) !important;
    border-color: var(--panel-border-color) !important;
}

/* Force headings to use solid, readable text (remove gradient fills) */
body.a11y-high-contrast h1,
body.a11y-high-contrast h2,
body.a11y-high-contrast h3,
body.a11y-high-contrast .prefs-drawer-header h2,
.theme-dark body.a11y-high-contrast h1,
.theme-dark body.a11y-high-contrast h2,
.theme-dark body.a11y-high-contrast h3,
.theme-dark body.a11y-high-contrast .prefs-drawer-header h2 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: var(--body-text-color) !important;
    color: var(--body-text-color) !important;
}

/* Controls & quickbar in dark+high-contrast */
.theme-dark body.a11y-high-contrast .prefs-toggle-btn,
.theme-dark body.a11y-high-contrast .prefs-quick-btn,
body.a11y-high-contrast .prefs-toggle-btn,
body.a11y-high-contrast .prefs-quick-btn {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.theme-dark body.a11y-high-contrast .prefs-toggle-btn.active,
.theme-dark body.a11y-high-contrast .prefs-quick-btn.active,
body.a11y-high-contrast .prefs-toggle-btn.active,
body.a11y-high-contrast .prefs-quick-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

.theme-dark body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-knob,
.theme-dark body.a11y-high-contrast .prefs-quick-btn.active .prefs-toggle-knob,
body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-knob,
body.a11y-high-contrast .prefs-quick-btn.active .prefs-toggle-knob {
    background-color: #000000 !important;
}

.theme-dark body.a11y-high-contrast header,
.theme-dark body.a11y-high-contrast footer,
body.a11y-high-contrast header,
body.a11y-high-contrast footer {
    background-color: var(--header-bg-color) !important;
    color: var(--header-text-color) !important;
}

/* Enforce pill-shaped toggle tracks and visible labels in high-contrast modes */

/* Stronger: target drawer-specific toggles to override any earlier attribute-based rules */
body.a11y-high-contrast #prefs-drawer .prefs-toggle-btn,
.theme-dark body.a11y-high-contrast #prefs-drawer .prefs-toggle-btn {
    background: #000000 !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    pointer-events: auto !important;
}

body.a11y-high-contrast #prefs-drawer .prefs-toggle-track,
.theme-dark body.a11y-high-contrast #prefs-drawer .prefs-toggle-track {
    width: 52px !important;
    height: 28px !important;
    flex: 0 0 auto !important;
    display: inline-block !important;
    padding: 2px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

body.a11y-high-contrast #prefs-drawer .prefs-toggle-track .prefs-toggle-knob,
.theme-dark body.a11y-high-contrast #prefs-drawer .prefs-toggle-track .prefs-toggle-knob,
body.a11y-high-contrast #prefs-drawer .prefs-toggle-knob,
.theme-dark body.a11y-high-contrast #prefs-drawer .prefs-toggle-knob {
    width: 20px !important;
    height: 20px !important;
    left: 6px !important;
    background-color: #000000 !important;
}

body.a11y-high-contrast #prefs-drawer .prefs-toggle-btn .prefs-toggle-label,
.theme-dark body.a11y-high-contrast #prefs-drawer .prefs-toggle-btn .prefs-toggle-label {
    color: #ffffff !important;
    margin-left: 6px !important;
}

/* Also ensure quickbar-hosted toggles match */
body.a11y-high-contrast #prefs-quickbar .prefs-quick-btn,
.theme-dark body.a11y-high-contrast #prefs-quickbar .prefs-quick-btn {
    background: #000000 !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

body.a11y-high-contrast #prefs-quickbar .prefs-quick-btn .prefs-toggle-track,
.theme-dark body.a11y-high-contrast #prefs-quickbar .prefs-quick-btn .prefs-toggle-track {
    width: 36px !important;
    height: 20px !important;
}

/* End stronger overrides */

/* Ensure toggle tracks retain fixed pill shape and size even when theme/contrast overrides are active */
body.a11y-high-contrast .prefs-toggle-track,
.theme-dark body.a11y-high-contrast .prefs-toggle-track,
body.a11y-high-contrast .prefs-quick-btn .prefs-toggle-track,
.theme-dark body.a11y-high-contrast .prefs-quick-btn .prefs-toggle-track {
    width: 52px !important;
    height: 28px !important;
    padding: 2px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    background-color: #ffffff !important; /* light track so knob is visible */
    border: 2px solid #ffffff !important;
}

/* Knob visibility and placement */
body.a11y-high-contrast .prefs-toggle-knob,
.theme-dark body.a11y-high-contrast .prefs-toggle-knob {
    width: 20px !important;
    height: 20px !important;
    left: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background-color: #000000 !important;
    box-shadow: none !important;
}

/* Active knob position */
body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-knob,
.theme-dark body.a11y-high-contrast .prefs-toggle-btn.active .prefs-toggle-knob {
    transform: translate(24px, -50%) !important;
    background-color: #000000 !important;
}

/* Make sure labels are visible and laid out next to the track */
body.a11y-high-contrast .prefs-toggle-btn,
.theme-dark body.a11y-high-contrast .prefs-toggle-btn {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
}

body.a11y-high-contrast .prefs-toggle-label,
.theme-dark body.a11y-high-contrast .prefs-toggle-label {
    color: var(--panel-text-color) !important;
    font-weight: 600 !important;
}

/* Ensure quickbar buttons keep a consistent small track look */
body.a11y-high-contrast .prefs-quick-btn,
.theme-dark body.a11y-high-contrast .prefs-quick-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
}

/* LIGHT-MODE HIGH CONTRAST VARIANT */
/* A readable, light-background high-contrast palette tied to the light theme.
   Keeps the pleasant light grey page feel but enforces strong text and borders. */
body.a11y-high-contrast-light {
    --primary-bg-color: #f5f6f7 !important; /* page background: light grey */
    --panel-bg-color: #ffffff !important;   /* panels: white */
    --body-text-color: #000000 !important;  /* main text: black */
    --primary-color: #000000 !important;    /* headings / primary */
    --accent-color: #ffd64f !important;     /* high-visibility yellow accent */
    --panel-text-color: #000000 !important;
    --panel-border-color: #000000 !important;
    --header-bg-color: #f5f6f7 !important;
    --header-text-color: #000000 !important;
}

/* Controls for light high-contrast */
body.a11y-high-contrast-light .prefs-toggle-btn,
body.a11y-high-contrast-light .prefs-quick-btn {
    background: #ffffff !important;
    border-color: #000000 !important;
    color: #000000 !important;
}

body.a11y-high-contrast-light .prefs-toggle-btn.active,
body.a11y-high-contrast-light .prefs-quick-btn.active {
    background: var(--accent-color) !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.a11y-high-contrast-light .prefs-toggle-track {
    background: #ffffff !important;
    border-color: #000000 !important;
}

body.a11y-high-contrast-light .prefs-toggle-btn .prefs-toggle-knob {
    background-color: #000000 !important;
}

body.a11y-high-contrast-light header,
body.a11y-high-contrast-light footer {
    background-color: var(--header-bg-color) !important;
    color: var(--header-text-color) !important;
}

/* Ensure headings are solid in the light high-contrast variant */
body.a11y-high-contrast-light h1,
body.a11y-high-contrast-light h2,
body.a11y-high-contrast-light h3,
body.a11y-high-contrast-light .prefs-drawer-header h2 {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: var(--body-text-color) !important;
    color: var(--body-text-color) !important;
}

/* Keep the existing dark high-contrast rules as-is (they apply when 'a11y-high-contrast-dark' or generic 'a11y-high-contrast' is present) */

/* Favorites Button Styling */
.fav-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}
.fav-btn:hover {
    transform: scale(1.2);
}

.route-name-link {
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.route-name-link:hover,
.route-name-link:focus-visible {
    color: #ffd64f;
}

.pro-locked-link {
    cursor: not-allowed;
}

.pro-locked-route {
    opacity: 0.82;
}

.routes-load-more {
    display: flex;
    width: 100%;
    align-items: center;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem auto 0;
}

.routes-load-more[hidden] {
    display: none;
}

.routes-load-more-button {
    min-width: 14rem;
}

.pro-route-note {
    margin: 0;
    color: var(--body-text-color);
    font-size: 1rem;
}

html.theme-dark .pro-route-note {
    color: #ffe494;
}

.routes-total-note {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 800;
}

.submitted-routes-section {
    margin-top: 2rem;
}

.submitted-routes-section > p {
    margin-top: -0.5rem;
    font-size: 1.15rem;
}

.routes-table-scroll {
    width: 100%;
    overflow-x: auto;
    padding: 1em;
}

#submitted-routes-table {
    width: 100%;
    min-width: 1000px;
    margin-top: 1rem;
}
/* ===================================
   ABOUT PAGE ENHANCEMENTS
   =================================== */
.about-intro-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    margin: 4rem auto;
    max-width: 1100px;
    width: 100%;
}

.intro-text-content {
    flex: 1.2;
}

.intro-text-content p {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

.intro-image-wrapper {
    flex: 1;
    width: 100%;
    max-width: 600px;
}

.about-hero-image {
    width: 100%;
    height: auto;
    border-radius: 2rem;
    box-shadow: var(--shadow-elevated);
    border: 3px solid var(--primary-color);
}

.stats-row {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem;
    border-radius: 1.5rem;
    margin: 3.5rem auto;
    max-width: 900px;
    width: min(90%, 900px);
    box-sizing: border-box;
    border: 1px solid var(--secondary-bg-color);
    background-color: var(--panel-accent, rgba(249, 187, 1, 0.03));
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 !important;
    padding: 0.5rem 0.75rem;
    flex: 1 1 0px;
    min-width: 0;
    box-sizing: border-box;
}

.stat-number {
    font-size: clamp(2.5rem, 4.5vw, 3.5rem);
    font-weight: 800;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ffd64f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.4rem;
    display: inline-block;
}

.stat-label {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    text-align: center;
    display: block;
}

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
        width: min(92%, 480px) !important;
        gap: 2rem;
        padding: 2rem 1.25rem;
    }

    .stat-item {
        width: 100%;
        margin: 0 !important;
    }
}

/* ===================================
   CONTACT MODAL
   =================================== */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

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

.contact-modal-content {
    background: var(--primary-bg-color);
    border: 3px solid var(--primary-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 550px;
    position: relative;
    box-shadow: var(--shadow-elevated);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

.contact-modal h2 {
    margin-top: 0;
    text-align: left;
}

.contact-modal textarea {
    resize: vertical;
}

/* ===================================
   CUSTOM MAP PINS
   =================================== */
.custom-div-icon {
    background: none !important;
    border: none !important;
}

.custom-pin-marker {
    width: 34px;
    height: 44px;
    position: relative;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease-out;
}

.custom-pin-marker:hover {
    transform: scale(1.18) translateY(-3px);
    z-index: 1000 !important;
}

.custom-map-pin-svg {
    display: block;
    width: 34px;
    height: 44px;
    overflow: visible;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

.custom-pin-marker.highlighted-filter-pin {
    animation: marker-pulse 1.8s infinite alternate ease-in-out;
}

.custom-pin-marker.highlighted-filter-pin .custom-map-pin-svg {
    filter: drop-shadow(0 0 8px #F9BB01) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

@keyframes marker-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15) translateY(-2px); }
}

.theme-dark .user-marker > div,
.theme-dark .facility-marker > div > div {
    background-color: #F9BB01 !important;
}

/* ===================================
   ROUTE DETAILS PAGE
   =================================== */
.route-details-page {
    max-width: 1400px;
    gap: 1.5rem;
    padding-bottom: 4rem;
}

/* Route submission form */
.route-submission-form {
    max-width: 1100px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
    align-items: start;
    text-align: left;
}

.route-form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.45rem;
}

.route-form-field label,
.route-image-field > label {
    margin: 0;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 750;
}

html.theme-dark .route-form-field label,
html.theme-dark .route-image-field > label {
    color: #ffe494;
}

.route-form-field input,
.route-form-field select,
.route-form-field textarea {
    width: 100%;
    margin: 0;
}

.route-form-field textarea {
    min-height: 7rem;
    resize: vertical;
}

.route-form-wide,
.route-submission-form > button[type="submit"],
.route-submission-form > .route-form-cancel,
.route-submission-form > .auth-error {
    grid-column: 1 / -1;
}

.route-image-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(249, 187, 1, 0.35);
    border-radius: var(--border-radius-base);
}

.route-terms-panel {
    padding: 1.5rem;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-base);
    font-size: 0.95rem;
}

.route-terms-panel p {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.6;
    text-align: left;
}

.route-terms-panel label {
    margin: 0;
}

.route-location-picker {
    padding: 1.25rem;
    border: 1.5px solid rgba(0, 23, 39, 0.2);
    border-radius: var(--border-radius-base);
    background: #ffffff;
}

html.theme-dark .route-location-picker {
    border-color: rgba(249, 187, 1, 0.45);
    background: rgba(0, 23, 39, 0.65);
}

.route-location-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.route-location-picker-heading h3 {
    margin: 0;
    font-size: 1.35rem;
    text-align: left;
    color: var(--primary-color);
}

.route-location-picker-heading p {
    margin: 0.25rem 0 0;
    color: var(--body-text-color);
    font-size: 1rem;
    text-align: left;
}

html.theme-dark .route-location-picker-heading p {
    color: #fff7d6;
}

#route-picker-map {
    width: 100%;
    min-height: 430px;
    border: 2px solid var(--primary-color);
    border-radius: 0.75rem;
    background: #d9e6ea;
    overflow: hidden;
}

.route-submission-form > button[type="submit"] {
    justify-self: center;
    min-width: min(100%, 16rem);
}

.route-submission-form > .route-form-cancel {
    display: none;
    justify-self: center;
}

.route-submission-form > .auth-error {
    width: 100%;
    min-height: 1.5rem;
    margin: 0;
    text-align: center;
}

@media (max-width: 760px) {
    .route-submission-form {
        grid-template-columns: 1fr;
    }

    .route-form-wide,
    .route-submission-form > button[type="submit"],
    .route-submission-form > .route-form-cancel,
    .route-submission-form > .auth-error {
        grid-column: 1;
    }

    .route-image-field {
        align-items: stretch;
        flex-direction: column;
    }

    .route-location-picker-heading {
        align-items: stretch;
        flex-direction: column;
    }

    #route-picker-map {
        min-height: 340px;
    }
}

.route-details-actions {
    width: 100%;
    margin-top: 2rem;
}

.route-back-link {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.1rem;
    border: 2px solid var(--primary-color);
    border-radius: 999px;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--transition-base), color var(--transition-base), transform var(--transition-base);
}

.route-back-link:hover,
.route-back-link:focus-visible {
    background: var(--primary-color);
    color: var(--primary-bg-color);
    transform: translateY(-2px);
}

.route-details-hero {
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
    border: 2px solid rgba(249, 187, 1, 0.45);
    border-radius: 2rem;
    background:
        radial-gradient(circle at top right, rgba(249, 187, 1, 0.18), transparent 40%),
        rgba(249, 187, 1, 0.04);
    box-shadow: var(--shadow-elevated);
    text-align: center;
}

.route-details-hero h1,
.route-hero-title {
    max-width: 1000px;
    margin: 0 auto 1.25rem;
    color: var(--primary-color);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* --- Route Image Slideshow --- */
.route-slideshow {
    position: relative;
    width: 100%;
    max-width: 960px;
    height: 440px;
    margin: 1.25rem auto 0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    border: 2px solid rgba(249, 187, 1, 0.4);
    background: var(--bg-card);
    outline: none;
}

.route-slideshow:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 187, 1, 0.5);
}

.slideshow-track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: scale(1.02);
    z-index: 1;
}

.slideshow-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

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

.slideshow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 23, 39, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(249, 187, 1, 0.65);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    padding: 0;
}

.slideshow-btn:hover,
.slideshow-btn:focus-visible {
    background: var(--primary-color);
    color: #001727;
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.slideshow-btn-prev {
    left: 14px;
}

.slideshow-btn-next {
    right: 14px;
}

.slideshow-overlay-controls {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    pointer-events: none;
}

.slideshow-dots {
    display: flex;
    gap: 8px;
    pointer-events: auto;
    background: rgba(0, 23, 39, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(249, 187, 1, 0.3);
}

.slideshow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}

.slideshow-dot:hover,
.slideshow-dot:focus-visible {
    background: rgba(255, 255, 255, 0.85);
}

.slideshow-dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 999px;
}

.slideshow-badge {
    pointer-events: auto;
    background: rgba(0, 23, 39, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(249, 187, 1, 0.4);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .route-slideshow {
        height: 260px;
        margin-top: 1rem;
        border-radius: 1rem;
    }
    .slideshow-btn {
        width: 36px;
        height: 36px;
    }
    .slideshow-btn-prev {
        left: 8px;
    }
    .slideshow-btn-next {
        right: 8px;
    }
}

.route-details-eyebrow {
    margin: 0;
    color: #8f6a00;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

html.theme-dark .route-details-eyebrow {
    color: #ffe494;
}

.route-details-location,
.route-details-description {
    max-width: 850px;
}

.route-details-location {
    margin: 0.5rem auto;
    color: var(--body-text-color);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 600;
}

html.theme-dark .route-details-location {
    color: #fff1b3;
}

.route-details-description {
    margin: 1rem auto 0;
    color: var(--body-text-color);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
}

html.theme-dark .route-details-description {
    color: #fff7d6;
}

.route-details-section {
    width: 100%;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 1.5rem;
}

.route-details-section h2 {
    margin-top: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.route-details-section-tinted {
    background: rgba(249, 187, 1, 0.07);
    border: 1px solid rgba(249, 187, 1, 0.25);
}

.route-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.route-details-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-details-grid-ratings {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.route-detail-card,
.route-access-notes article {
    min-width: 0;
    padding: 1.5rem;
    border: 1.5px solid rgba(0, 23, 39, 0.15);
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: var(--shadow-base);
}

html.theme-dark .route-detail-card,
html.theme-dark .route-access-notes article {
    border: 2px solid rgba(249, 187, 1, 0.45);
    background: rgba(0, 23, 39, 0.85);
}

.route-detail-card h3,
.route-access-notes h3 {
    margin: 0.35rem 0 0.6rem;
    color: var(--primary-color);
    font-size: 1.25rem;
    text-align: left;
}

.route-detail-card p,
.route-access-notes p {
    margin: 0;
    color: var(--body-text-color);
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: left;
}

html.theme-dark .route-detail-card p,
html.theme-dark .route-access-notes p {
    color: #fff7d6;
}

.route-detail-icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--primary-bg-color);
    font-size: 1.4rem;
    font-weight: 900;
}

.route-rating-card p {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border: 1.5px solid #8f6a00;
    border-radius: 999px;
    background: rgba(249, 187, 1, 0.18);
    color: #6b4e00;
    font-weight: 800;
}

html.theme-dark .route-rating-card p {
    border: 1px solid var(--primary-color);
    background: rgba(249, 187, 1, 0.12);
    color: #fff1b3;
}

/* --- Standalone Overall Rating --- */
.route-overall-section {
    padding: 1.25rem 1rem;
    margin: 1.5rem auto;
    text-align: center;
    border: none;
    background: transparent;
    box-shadow: none;
}

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

.route-overall-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    padding: 1.75rem 2rem;
    text-align: center;
    border: 2px solid rgba(249, 187, 1, 0.45);
    background: radial-gradient(circle at center, rgba(249, 187, 1, 0.12), transparent 70%), var(--bg-card, #ffffff);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-elevated, 0 8px 24px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.route-overall-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(249, 187, 1, 0.25);
}

.route-overall-card .route-detail-icon {
    margin-bottom: 0.5rem;
}

.route-overall-card h2 {
    margin: 0.25rem 0 0.75rem;
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
}

.overall-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border: 1.5px solid #8f6a00;
    border-radius: 999px;
    background: rgba(249, 187, 1, 0.2);
    color: #6b4e00;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0;
}

html.theme-dark .route-overall-card {
    border: 2px solid rgba(249, 187, 1, 0.5);
    background: radial-gradient(circle at center, rgba(249, 187, 1, 0.15), transparent 70%), rgba(0, 23, 39, 0.9);
}

html.theme-dark .overall-rating-badge {
    border: 1.5px solid var(--primary-color);
    background: rgba(249, 187, 1, 0.18);
    color: #fff1b3;
    box-shadow: 0 0 12px rgba(249, 187, 1, 0.2);
}

.route-access-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.consent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    color: var(--body-text-color);
}

html.theme-dark .consent-tags {
    color: #fff7d6;
}

.consent-tag {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(0, 23, 39, 0.25);
    border-radius: 999px;
    background: rgba(0, 23, 39, 0.05);
    color: #001727;
    font-weight: 700;
}

html.theme-dark .consent-tag {
    border: 1px solid var(--primary-color);
    background: rgba(249, 187, 1, 0.12);
    color: #fff1b3;
}

@media (max-width: 800px) {
    .route-details-grid,
    .route-details-grid-wide,
    .route-details-grid-ratings,
    .route-access-notes {
        grid-template-columns: 1fr;
    }

    .route-details-page {
        padding-inline: 1rem;
    }

    .route-details-hero {
        border-radius: 1.25rem;
    }
}

/* ===================================
   ACCESSIBILITY SCORE UTILITY CLASSES
   =================================== */

/* Score Color Classes for Route Assessment */
.score-green {
    background-color: var(--score-green);
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(28, 99, 0, 0.3);
}

.score-yellow {
    background-color: var(--score-yellow);
    color: #5d4300;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.score-orange {
    background-color: var(--score-orange);
    color: #5a3200;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.score-red {
    background-color: var(--score-red);
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(183, 29, 63, 0.3);
}

/* Admin Assessment Table */
.admin-assessment-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #ffffff;
    border: 1.5px solid rgba(0, 23, 39, 0.2);
    border-radius: 0.5rem;
    overflow: hidden;
}

.admin-assessment-table tbody tr {
    border-bottom: 1px solid rgba(0, 23, 39, 0.1);
}

.admin-assessment-table td {
    padding: 1rem;
    text-align: left;
    color: #001727;
}

.admin-assessment-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: #001727;
}

html.theme-dark .admin-assessment-table {
    background: rgba(0, 23, 39, 0.7);
    border: 1px solid var(--primary-color);
}

html.theme-dark .admin-assessment-table tbody tr {
    border-bottom: 1px solid rgba(249, 187, 1, 0.2);
}

html.theme-dark .admin-assessment-table td {
    color: #fff7d6;
}

html.theme-dark .admin-assessment-table td:last-child {
    color: var(--primary-color);
}

/* Tier Label Classes — WCAG AA compliant (> 5.5:1 on light, > 7.5:1 on dark) */
.tier-for-most {
    color: #00897b;
    font-weight: 700;
}

.tier-for-many {
    color: #0072b2;
    font-weight: 700;
}

.tier-for-some {
    color: #d97706;
    font-weight: 700;
}

.tier-for-few-suggested {
    color: #7b1fa2;
    font-weight: 700;
}

.tier-for-few-required {
    color: #d55e00;
    font-weight: 700;
}

.tier-for-very-few {
    color: #991b1b;
    font-weight: 700;
}

html.theme-dark .tier-for-most {
    color: #2dd4bf;
}

html.theme-dark .tier-for-many {
    color: #60a5fa;
}

html.theme-dark .tier-for-some {
    color: #fbbf24;
}

html.theme-dark .tier-for-few-suggested {
    color: #c084fc;
}

html.theme-dark .tier-for-few-required {
    color: #fb923c;
}

html.theme-dark .tier-for-very-few {
    color: #f87171;
}

.equipment-highlight {
    color: #d97706;
    font-weight: 700;
    opacity: 1 !important;
}

html.theme-dark .equipment-highlight,
body.theme-dark .equipment-highlight,
body.a11y-high-contrast .equipment-highlight {
    color: #F9BB01 !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & DEVICE COMPATIBILITY OVERRIDES
   ========================================================================== */

/* Prevent horizontal viewport overflow on all devices */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

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

/* Responsive Table Scroll Container */
.routes-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: block;
}

@media (max-width: 768px) {
    /* Base typography scaled cleanly to fit phones */
    p,
    .padding-box > p,
    .mission-statement p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin: 0.75rem 0 !important;
        max-width: 100% !important;
    }

    h1 {
        font-size: 1.65rem !important;
        line-height: 1.25 !important;
        margin: 0.75rem 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    h2,
    .padding-box > h2 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
        margin: 0.75rem 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    h3 {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
        margin: 0.5rem 0 !important;
        word-wrap: break-word !important;
    }

    .hero-text {
        font-size: 1.1rem !important;
        padding: 0 !important;
        margin: 1rem 0 !important;
        line-height: 1.45 !important;
    }

    /* Main Container & Page Padding */
    main {
        padding: 0 0.5rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    section {
        margin: 1rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .padding-box,
    .margin-box {
        padding: 1rem 0.75rem !important;
        margin: 1rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0.75rem !important;
        font-size: 1rem !important;
    }

    .margin-label {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        margin: 0.75rem 0 !important;
    }

    /* Header & Mobile Menu */
    header {
        padding: 0.4rem 0.75rem !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
    }

    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        max-width: calc(100% - 60px) !important;
        text-decoration: none !important;
    }

    .logo-image {
        width: 48px !important;
        height: 48px !important;
        flex-shrink: 0 !important;
    }

    .logo-name {
        font-size: 1.35rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #main-nav {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #001727 !important;
        border-top: 1px solid var(--primary-color) !important;
        border-bottom: 2px solid var(--primary-color) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
        z-index: 9999 !important;
    }

    #main-nav ul {
        flex-direction: column !important;
        padding: 0.5rem 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        align-items: stretch !important;
    }


    #main-nav li:last-child {
        border-bottom: none !important;
    }

    #main-nav a,
    #main-nav button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.75rem 1rem !important;
        font-size: 1.05rem !important;
        min-height: 44px !important;
    }

    /* Touch-friendly base spacing and tap targets */
    button,
    .nav-auth-link,
    .nav-link,
    .highlight-link,
    .border-link,
    .fav-btn,
    select,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
    }

    /* iOS Zoom prevention: Inputs must be at least 16px */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Hero Images stacked vertically */
    .hero-images {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
        padding: 0 !important;
    }

    .hero-image {
        width: 100% !important;
        height: 180px !important;
        max-height: 200px !important;
        object-fit: cover !important;
        border-radius: 0.75rem !important;
    }

    /* Tables in Scroll Containers */
    table {
        margin: 0 auto !important;
        font-size: 0.85rem !important;
    }

    th, td {
        padding: 0.6rem 0.45rem !important;
    }

    th {
        white-space: nowrap !important;
        font-size: 0.78rem !important;
    }

    /* Cards, Forms, Grids */
    .auth-card {
        padding: 1.25rem 0.85rem !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .credential-grid,
    .dashboard-grid,
    .legend-items,
    .map-instructions {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .legend-item,
    .instruction-card {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }

    #sites-controls {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        margin: 0.75rem 0 !important;
    }

    /* Preferences Drawer */
    #prefs-drawer {
        width: min(320px, 85vw) !important;
        max-width: 85vw !important;
    }

    /* Footer on Mobile */
    footer {
        padding: 1.25rem 0.75rem !important;
        text-align: center !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }

    footer h2 {
        margin-bottom: 0.25rem !important;
    }

    footer p,
    footer .contact-subtitle {
        margin-bottom: 0.75rem !important;
    }

    footer ul,
    ul.social-links {
        gap: 1.15rem !important;
    }

    .social-link {
        width: 3.75rem !important;
        height: 3.75rem !important;
        min-width: 3.75rem !important;
        min-height: 3.75rem !important;
        padding: 0.65rem !important;
    }

    .social-icon {
        height: 2.1rem !important;
        width: 2.1rem !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

    h2,
    .padding-box > h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.05rem !important;
    }

    .logo-name {
        font-size: 1.1rem !important;
    }

    th, td {
        padding: 0.45rem 0.3rem !important;
        font-size: 0.78rem !important;
    }

    footer ul,
    ul.social-links {
        gap: 0.85rem !important;
    }

    .social-link {
        width: 3.25rem !important;
        height: 3.25rem !important;
        min-width: 3.25rem !important;
        min-height: 3.25rem !important;
        padding: 0.5rem !important;
    }

    .social-icon {
        height: 1.8rem !important;
        width: 1.8rem !important;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Header and Navigation */
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        top: 1.5em;
        right: 1em;
    }

    #main-nav {
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-bg-color);
        border: 1px solid transparent;
        border-top: none;
        z-index: 1000;
        overflow: hidden;
    }

    #main-nav.active {
        grid-template-rows: 1fr;
        visibility: visible;
        border-color: var(--primary-color);
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 1em;
        min-height: auto;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    header nav {
        width: 100%;
        min-width: auto;
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5em;
        align-items: stretch;
        min-height: 0;
    }

    header nav li {
        padding: 0.5em;
        text-align: center;
        border-bottom: 1px solid var(--secondary-bg-color);
        width: 80%;
        margin: auto;
    }

    header nav li:not(:last-child)::after {
        display: none;
    }

    header nav a, .nav-auth-link {
        display: block;
        padding: 0.8em;
        font-size: 1.3rem;
        font-weight: 700;
        font-family: var(--font-family-primary);
        color: #f5f6f7;
        width: 50%;
        margin: auto;
    }

    #logo {
        justify-self: start;
    }

    .hero-images {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    .hero-image {
        height: 200px;
        border-radius: var(--border-radius-base);
    }

    .hero-image-left,
    .hero-image-right,
    .hero-image-center {
        border-radius: var(--border-radius-base);
    }

    h1 {
        font-size: 2.5rem;
        margin: 1em 0;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    section {
        margin: 2em 1em;
    }

    .padding-box {
        padding: 2em 1em;
        margin: 1em 0;
    }

    footer {
        padding: 2em 1em;
        margin-top: 2em;
    }

    footer h2 {
        font-size: 1.3em;
        margin-bottom: 1em;
    }

    footer nav p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8em;
        font-size: 0.9em;
    }

    .highlight-link,
    .border-link {
        width: 100%;
        max-width: 300px;
        margin: 0.5em auto;
    }

    .footer-grid {
        display: flex;
        flex-direction: column;
    }

    .social-links {
        justify-content: center;
    }

    .social-links button {
        min-height: 3.75rem;
    }

    .social-link {
        margin: 0.5em;
    }

    .newsletter {
        width: 70%;
    }

    .newsletter form div {
        display: flex;
        flex-direction: column;
    }

    .search-container {
        display: flex;
        flex-direction: column;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 0.75rem;
    }

    .search-container > legend {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .search-input-group {
        display: flex;
        flex-direction: column;
        position: relative !important;
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        height: auto;
        min-height: 0;
        gap: 0.5rem;
    }

    .search-input {
        flex: none;
        height: auto;
        min-height: 44px;
        width: 100%;
    }

    .search-container > .search-btn {
        grid-column: 2;
        grid-row: 1;
    }

    .search-container > .changing-places-toggle,
    .search-container > .location-btn,
    .search-container > #search-clear-btn {
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
    }

    .search-container > .changing-places-toggle {
        grid-row: 3;
        justify-content: flex-start;
    }

    .search-container > .location-btn {
        grid-row: 4;
    }

    .search-container > #search-clear-btn {
        grid-row: 5;
    }
}

/* ==========================================================================
   TIERED ACCESS PERMISSION FEATURES & COMPONENTS
   ========================================================================== */

/* Ads & Affiliate Notice (Guest & Free tiers) */
.rove-ad-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin: 1.5rem auto;
    max-width: 960px;
    background: linear-gradient(135deg, rgba(87, 117, 75, 0.12), rgba(249, 187, 1, 0.1));
    border: 2px dashed #57754b;
    border-radius: 12px;
    color: var(--text-color, #001727);
}

.rove-ad-banner .ad-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    background: #57754b;
    color: #f9bb01;
    border-radius: 6px;
}

.rove-ad-content {
    flex: 1;
    min-width: 240px;
}

.rove-ad-content p {
    margin: 0.25rem 0 0 0;
    font-size: 0.95rem;
}

.rove-ad-link {
    font-weight: 700;
    color: #57754b;
    text-decoration: underline;
}

html.theme-dark .rove-ad-banner {
    background: linear-gradient(135deg, rgba(87, 117, 75, 0.25), rgba(249, 187, 1, 0.12));
    border-color: #f9bb01;
    color: #f0f0f0;
}

html.theme-dark .rove-ad-link {
    color: #f9bb01;
}

/* Saved Filter Match Card (Free Tier) */
.saved-filter-match-card {
    background: linear-gradient(135deg, rgba(249, 187, 1, 0.15), rgba(87, 117, 75, 0.15));
    border: 2px solid #f9bb01;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem auto;
    max-width: 960px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.saved-filter-match-card h3 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #001727;
}

html.theme-dark .saved-filter-match-card h3 {
    color: #f9bb01;
}

/* Action Buttons & Premium Badges */
.route-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    width: 100%;
    max-width: 580px;
    margin: 1.5rem auto 0 auto;
}

.route-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 52px;
    padding: 0.75rem 1rem;
    font-size: clamp(0.9rem, 1.8vw, 0.98rem);
    font-weight: 700;
    border-radius: 12px;
    border: 1.5px solid rgba(249, 187, 1, 0.5);
    background: rgba(0, 23, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    text-align: center;
    line-height: 1.2;
}

.route-action-btn .btn-icon {
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.route-action-btn:hover,
.route-action-btn:focus-visible {
    background: var(--primary-color);
    color: #001727;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 187, 1, 0.35);
}

html:not(.theme-dark) .route-action-btn {
    background: #ffffff;
    color: #001727;
    border: 1.5px solid rgba(0, 23, 39, 0.22);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html:not(.theme-dark) .route-action-btn:hover,
html:not(.theme-dark) .route-action-btn:focus-visible {
    background: var(--primary-color);
    color: #001727;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(249, 187, 1, 0.35);
}

@media (max-width: 540px) {
    .route-actions-grid {
        gap: 0.6rem;
    }
    .route-action-btn {
        min-height: 48px;
        padding: 0.6rem 0.5rem;
        font-size: 0.82rem;
        gap: 0.35rem;
    }
    .route-action-btn .btn-icon {
        font-size: 0.95rem;
    }
}

.premium-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.action-btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 30px;
    border: 2px solid #57754b;
    background: #57754b;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.action-btn-pill:hover {
    background: #445d3a;
    border-color: #f9bb01;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.action-btn-pill.btn-outline {
    background: transparent;
    color: #57754b;
}

.action-btn-pill.btn-outline:hover {
    background: #57754b;
    color: #ffffff;
}

html.theme-dark .action-btn-pill.btn-outline {
    color: #f9bb01;
    border-color: #f9bb01;
}

html.theme-dark .action-btn-pill.btn-outline:hover {
    background: #f9bb01;
    color: #001727;
}

/* Equipment Suggestions (Basic+) */
.equipment-card {
    background: rgba(87, 117, 75, 0.08);
    border: 1px solid #57754b;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.equipment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed rgba(87, 117, 75, 0.3);
}

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

/* Contest & Issue Modal Windows */
.tier-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 23, 39, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.tier-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tier-modal-box {
    background: #ffffff;
    color: #001727;
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 2px solid #57754b;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

html.theme-dark .tier-modal-box {
    background: #1a2530;
    color: #f0f0f0;
    border-color: #f9bb01;
}

.tier-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: inherit;
}

.tier-modal-box.contest-modal-box {
    max-width: 780px;
    padding: 2rem 2.25rem;
}

.tier-modal-box .route-form-field label {
    color: #001727;
    font-weight: 700;
    font-size: 0.95rem;
}

html.theme-dark .tier-modal-box .route-form-field label {
    color: #ffe494;
}

.tier-modal-box .route-form-field input,
.tier-modal-box .route-form-field select,
.tier-modal-box .route-form-field textarea {
    border: 1px solid #57754b;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    background: #ffffff;
    color: #001727;
}

html.theme-dark .tier-modal-box .route-form-field input,
html.theme-dark .tier-modal-box .route-form-field select,
html.theme-dark .tier-modal-box .route-form-field textarea {
    background: #0c151c;
    color: #f0f0f0;
    border-color: #f9bb01;
}

/* ==========================================================================
   THEME-ADAPTIVE SYSTEM BANNERS & CARDS (WCAG AA COMPLIANT)
   ========================================================================== */

/* Accessible Recording & System Status Banners */
.recording-status-box {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #16a34a;
    border-top: 1px solid #bbf7d0;
    border-right: 1px solid #bbf7d0;
    border-bottom: 1px solid #bbf7d0;
    background-color: #f0fdf4;
    color: #14532d;
}

.recording-status-box .recording-stat-label {
    font-size: 0.85rem;
    color: #166534;
}

.recording-status-box .recording-stat-val {
    font-size: 1.5rem;
    font-weight: bold;
    color: #14532d;
}

.recording-consent-box {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #d97706;
    border-top: 1px solid #fde68a;
    border-right: 1px solid #fde68a;
    border-bottom: 1px solid #fde68a;
    background-color: #fefce8;
    color: #78350f;
}

.recording-error-box {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #dc2626;
    border-top: 1px solid #fecaca;
    border-right: 1px solid #fecaca;
    border-bottom: 1px solid #fecaca;
    background-color: #fef2f2;
    color: #991b1b;
}

html.theme-dark .recording-status-box {
    background-color: rgba(22, 163, 74, 0.16);
    border-color: rgba(74, 222, 128, 0.4);
    border-left: 5px solid #22c55e;
    color: #dcfce7;
}

html.theme-dark .recording-status-box .recording-stat-label {
    color: #86efac;
}

html.theme-dark .recording-status-box .recording-stat-val {
    color: #ffffff;
}

html.theme-dark .recording-consent-box {
    background-color: rgba(217, 119, 6, 0.18);
    border-color: rgba(251, 191, 36, 0.4);
    border-left: 5px solid #f59e0b;
    color: #fef08a;
}

html.theme-dark .recording-error-box {
    background-color: rgba(220, 38, 38, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    border-left: 5px solid #ef4444;
    color: #fecaca;
}

/* Business Portal Theme-Adaptive Cards */
.business-stat-card {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.business-stat-card .stat-label {
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 600;
}
.business-stat-card .stat-count {
    font-size: 2rem;
    font-weight: bold;
    color: #001727;
}

.business-plan-card {
    padding: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
}
.business-plan-card.featured {
    border-color: #2563eb;
    background-color: #f8faff;
}
.business-plan-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1d4ed8;
}

.business-alert-warning {
    margin: 20px 0;
    padding: 15px;
    background-color: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #d97706;
    color: #78350f;
}

html.theme-dark .business-stat-card {
    background-color: #012136;
    border-color: rgba(249, 187, 1, 0.3);
}
html.theme-dark .business-stat-card .stat-label {
    color: #cbd5e1;
}
html.theme-dark .business-stat-card .stat-count {
    color: #f9bb01;
}

html.theme-dark .business-plan-card {
    background-color: #012136;
    border-color: rgba(249, 187, 1, 0.3);
    color: #fff7d6;
}
html.theme-dark .business-plan-card.featured {
    border-color: #f9bb01;
    background-color: #012740;
}
html.theme-dark .business-plan-price {
    color: #f9bb01;
}

html.theme-dark .business-alert-warning {
    background-color: rgba(217, 119, 6, 0.2);
    border-left-color: #f9bb01;
    color: #fef08a;
}

/* Contest Diff Table Classes for Admin Dashboard */
.contest-card {
    background: #ffffff;
    border: 1.5px solid rgba(0, 23, 39, 0.15);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
html.theme-dark .contest-card {
    background: #012136;
    border-color: rgba(249, 187, 1, 0.3);
}

.contest-reason-box {
    background: #f1f5f9;
    border-left: 4px solid #001727;
    padding: 0.6rem 0.85rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    color: #1e293b;
}
html.theme-dark .contest-reason-box {
    background: rgba(0, 23, 39, 0.6);
    border-left-color: #f9bb01;
    color: #fff7d6;
}

.contest-diff-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem 0;
    font-size: 0.95rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
html.theme-dark .contest-diff-table {
    background: rgba(0, 23, 39, 0.6);
    border-color: rgba(249, 187, 1, 0.25);
}

.contest-diff-table th {
    background-color: #001727 !important;
    color: #ffffff !important;
    padding: 0.6rem !important;
    font-size: 0.9rem !important;
}
html.theme-dark .contest-diff-table th {
    background-color: #0a1926 !important;
    color: #f9bb01 !important;
}

.contest-diff-table td {
    padding: 0.6rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}
html.theme-dark .contest-diff-table td {
    border-bottom-color: rgba(249, 187, 1, 0.15) !important;
    color: #fff7d6 !important;
}

.contest-diff-orig {
    color: #475569 !important;
    font-weight: 600;
}
html.theme-dark .contest-diff-orig {
    color: #cbd5e1 !important;
}

.contest-diff-prop {
    color: #166534 !important;
    font-weight: 700;
}
html.theme-dark .contest-diff-prop {
    color: #4ade80 !important;
}

/* ===================================
   ACCOUNT SETTINGS & PROFILE INPUTS
   =================================== */
.profile-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border-radius: 6px;
    box-sizing: border-box;
    margin-top: 2px;
    font-family: inherit;
    transition: all 0.2s ease;
}
.readonly-input {
    background-color: #e2e8f0 !important;
    color: #64748b !important;
    border: 1.5px solid #cbd5e1 !important;
    cursor: not-allowed;
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
}
.readonly-input:focus {
    outline: none;
    border-color: #94a3b8 !important;
    box-shadow: none;
}
.editable-input {
    background-color: #ffffff;
    color: #001727;
    border: 1.5px solid #2563eb;
    font-weight: 500;
}
.editable-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
html.theme-dark .readonly-input {
    background-color: #001220 !important;
    color: #94a3b8 !important;
    border-color: rgba(249, 187, 1, 0.2) !important;
}
html.theme-dark .editable-input {
    background-color: #001727;
    color: #ffffff;
    border-color: #f9bb01;
}
html.theme-dark .editable-input:focus {
    border-color: #f9bb01;
    box-shadow: 0 0 0 3px rgba(249, 187, 1, 0.3);
}
