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

.drafts-list {
    display: grid;
    gap: 1rem;
}

.draft-card header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.draft-card form {
    display: grid;
    gap: 0.8rem;
}

.draft-card label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.draft-card input,
.draft-card textarea,
.draft-card select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d1117;
    color: white;
    padding: 0.6rem;
}

.draft-card .actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.draft-card .actions button {
    flex: none;
}

/* Drafts grid & tile styles */
.drafts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.draft-tile {
    background: linear-gradient(180deg, rgba(41, 50, 60, 0.98), rgba(29, 38, 45, 0.98));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(2,6,12,0.6);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.draft-tile .tile-top {
    background: linear-gradient(90deg, rgba(242,19,104,0.12), rgba(59,130,246,0.08));
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.draft-tile .tile-map {
    width: 100%;
    height: 160px;
}

.draft-tile .tile-meta {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.92);
}

.draft-tile .tile-actions {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.draft-tile .tile-actions .ghost-btn,
.draft-tile .tile-actions .cta {
    flex: 1 1 auto;
    white-space: nowrap;
}

.draft-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(2,6,12,0.7);
}

/* Use border-box globally to avoid width/padding surprises */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: #0d1117;
    color: #f5f7fb;
}

.ta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem; /* match .container horizontal gutter */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1200;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 5px auto;
    padding: 0 1rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 64px;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

@media (max-width: 480px) {
    .brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .brand-name {
        font-size: 1.1rem;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.25rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #e6edf3;
    margin: 4px 0;
    border-radius: 2px;
}

@media (max-width: 900px) {
    .ta-header {
        padding: 0.5rem 1rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: 1rem;
        right: 1rem;
        background: rgba(13, 17, 23, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        padding: 0.75rem;
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 1000;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .cta,
    .nav-links .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-links a,
    .nav-links form button {
        width: 100%;
        text-align: center;
        display: inline-flex;
        justify-content: center;
    }

    .nav-toggle i {
        color: #fff;
        font-size: 1.2rem;
    }

    /* Icon styling for nav toggle */
    .nav-toggle {
        position: fixed;
        /* Fixes the toggle position */
        top: 16px;
        /* Positions the toggle at the top */
        right: 16px;
        /* Positions the toggle to the right */
        z-index: 1100;
        /* Ensures the toggle is above other elements */
    }
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    padding: 7px;
}

.nav-links form {
    margin: 0;
}

.nav-user {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 1.0rem 1.5rem;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.cta {
    background: #f21368;
    border: none;
    color: white;
    padding: 1.0rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
}

.logo-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d4d, #f21368);
}

main {
    padding: 2rem 0; /* vertical spacing only; horizontal gutters handled by .container */
}

.ta-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.98), rgba(5, 7, 10, 0.98));
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.footer-version {
    font-size: 0.85rem;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-link {
    color: #f21368;
    text-decoration: none;
    font-weight: 600;
    transition: color 160ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: #ff4d88;
}

.footer-disclaimer {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 420px;
}

@media (max-width: 720px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-primary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.flash-container {
    /* Fixed so flashes appear below the sticky header */
    position: fixed;
    top: 7rem;
    left: 1rem;
    right: 1rem;
    padding: 0 2rem;
    z-index: 1199;
    pointer-events: none;
    /* allow clicks to pass through except on the flashes themselves */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    /* center flashes horizontally */
}

.flash {
    background: rgba(6, 10, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    pointer-events: auto;
    /* enable interacting with dismiss buttons */
    max-width: 760px;
    width: calc(100% - 2rem);
    box-shadow: 0 12px 30px rgba(2, 6, 12, 0.6);
    backdrop-filter: blur(6px);
    font-weight: 600;
}

.flash.error {
    /* Strong left accent + clear white text for readability */
    border-left: 6px solid rgba(242, 19, 104, 1);
    background: rgba(6, 10, 14, 0.95);
    color: #ffffff;
    padding-left: calc(1.1rem - 6px + 0.4rem);
}

.flash.success {
    /* Strong left accent + clear white text for readability */
    border-left: 6px solid rgba(16, 185, 129, 1);
    background: rgba(6, 10, 14, 0.95);
    color: #ffffff;
    padding-left: calc(1.1rem - 6px + 0.4rem);
}

.hero {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
    padding: 3rem 0 1rem;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.hero-centered .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-centered .hero-content h1 {
    font-size: clamp(1.8rem, 1.2rem + 2.5vw, 3rem);
    line-height: 1.1;
    margin: 0;
}

.lead {
    font-size: clamp(1rem, 0.95rem + 0.6vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    max-width: 820px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mission {
    padding: 2rem 0 1rem;
}

.mission-card {
    background: linear-gradient(145deg, rgba(29, 38, 45, 0.95), rgba(13, 17, 23, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2rem;
    display: grid;
    gap: 1rem;
    box-shadow: 0 20px 45px rgba(5, 7, 10, 0.6);
}

.mission-card h2 {
    margin: 0;
    font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
}

.mission-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
}

.features {
    padding: 1rem 0 1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-card {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: left;
}

.feature-card h3 {
    margin: 0.25rem 0 0.35rem 0;
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f21368, #3b82f6);
    box-shadow: 0 6px 20px rgba(242, 19, 104, 0.25);
}

.map-section {
    padding: 1rem 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0 0 0.35rem 0;
}

.subtle {
    color: rgba(255, 255, 255, 0.7);
}

.cta-band {
    padding: 1.5rem 0 2.25rem;
}

.cta-band-inner {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(242, 19, 104, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cta-band-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.terms-hero {
    padding: 3rem 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.09), rgba(13, 17, 23, 0));
}

.terms-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 2rem 0 3rem;
}

.terms-card {
    background: #131821;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.3rem;
    box-shadow: 0 16px 30px rgba(5, 7, 10, 0.45);
}

.terms-card h2 {
    margin-top: 0;
    margin-bottom: 0.65rem;
    font-size: 1.1rem;
}

.terms-card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
}

.terms-card li {
    margin-bottom: 0.35rem;
}

.terms-card a {
    color: #57b8ff;
    text-decoration: none;
}

.terms-card a:hover,
.terms-card a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .cta-band-inner {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    /* Ensure the outer containers for these sections also respect the same mobile gutters
       in case other global styles make them full-bleed on small screens. */
    .features .container,
    .cta-band .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Make sure feature cards include padding in their width calculation so gutters persist */
    .feature-card {
        box-sizing: border-box;
    }
}

.map-panel {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.map-panel--public {
    grid-template-columns: 1fr;
}

/* Atlas map shell - full viewport below header */
.atlas-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: unset;
    border-radius: 0;
    padding-top: 82px;
    background: #05070a;
}

.atlas-map {
    height: 100%;
    width: 100%;
}

.map-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(5, 7, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.map-btn.recenter {
    right: 1.25rem;
    bottom: 1.25rem;
}

/* Driving mode button — hidden by default, shown via media queries */
.map-btn.driving-mode {
    display: none;
}

/* Icon toggling: browse shown by default, follow/driving hidden */
.map-btn.driving-mode .dm-follow,
.map-btn.driving-mode .dm-driving {
    display: none;
}
.map-btn.driving-mode--follow .dm-browse { display: none !important; }
.map-btn.driving-mode--follow .dm-follow { display: inline-block !important; }
.map-btn.driving-mode--driving .dm-browse { display: none !important; }
.map-btn.driving-mode--driving .dm-driving { display: inline-block !important; }

.map-btn.driving-mode--follow {
    background: #2563eb;
    border-color: #1d4ed8;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.35);
}

.map-btn.driving-mode--driving {
    background: #f21368;
    border-color: #d1105a;
    box-shadow: 0 15px 30px rgba(242, 19, 104, 0.35);
}

/* Driving mode: replace user location dot with navigation arrow */
.driving-mode-active .maplibregl-user-location-dot {
    background: none !important;
    box-shadow: none !important;
    width: 24px !important;
    height: 24px !important;
    border: none !important;
    overflow: visible !important;
}

.driving-mode-active .maplibregl-user-location-dot::before {
    content: '\f124' !important;
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 28px !important;
    color: #3b82f6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotate(-45deg) !important;
    animation: none !important;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.driving-mode-active .maplibregl-user-location-dot::after {
    display: none !important;
}

/* Mobile (default): controls on right, tray toggle above geolocate */
@media (max-width: 991px) {
    .map-btn.recenter {
        right: 1.25rem;
        left: auto;
        bottom: 1.25rem;
    }

    .map-btn.tray-toggle {
        right: 1.25rem;
        left: auto;
        /* Position above geolocate: 1.25rem (geolocate bottom) + 48px (geolocate height) + 0.75rem gap */
        bottom: calc(1.25rem + 48px + 0.75rem);
    }

    .map-btn.driving-mode {
        display: flex;
        right: 1.25rem;
        left: auto;
        /* Replaces geolocate button at the bottom of the stack */
        bottom: 1.25rem;
    }

    .category-tray {
        right: 1.25rem;
        left: auto;
        bottom: 10.5rem;
    }
}

/* Desktop: controls on left, tray toggle above geolocate */
@media (min-width: 992px) {
    .map-btn.recenter {
        left: 1.5rem;
        right: auto;
        bottom: 1.5rem;
    }

    .map-btn.tray-toggle {
        left: 1.5rem;
        right: auto;
        /* Position above geolocate: 1.5rem (geolocate bottom) + 48px (geolocate height) + 0.75rem gap */
        bottom: calc(1.5rem + 48px + 0.75rem);
    }

    .map-btn.driving-mode {
        /* Hidden on desktop — MapLibre's built-in GeolocateControl used instead */
    }

    .category-tray {
        left: 1.25rem;
        right: auto;
        bottom: 4.5rem;
    }
}

/* -------------------------------------------------------------------------
   MapLibre GeolocateControl - styled to match app design
   ------------------------------------------------------------------------- */
.maplibregl-ctrl-geolocate {
    /* Match our button styling */
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
    background: rgba(5, 7, 10, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease !important;
}

/* Hide the default control group container styling */
.maplibregl-ctrl-group:has(.maplibregl-ctrl-geolocate) {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Single button in group - no borders */
.maplibregl-ctrl-group .maplibregl-ctrl-geolocate {
    border-radius: 16px !important;
}

/* Icon styling */
.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
    filter: brightness(0) invert(1); /* Make icon white */
    opacity: 0.9;
}

/* Active state (tracking) */
.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4) !important;
}

/* Waiting state */
.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting {
    animation: geolocate-pulse 1.5s ease-in-out infinite;
}

@keyframes geolocate-pulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 10px 25px rgba(0, 0, 0, 0.4); }
}

/* Background tracking state */
.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background {
    background: rgba(5, 7, 10, 0.85) !important;
    border-color: rgba(59, 130, 246, 0.65) !important;
}

.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {
    filter: brightness(0) saturate(100%) invert(44%) sepia(98%) saturate(1642%) hue-rotate(203deg) brightness(101%) contrast(96%);
}

/* Hide default top-right positioning */
/* .maplibregl-ctrl-top-right .maplibregl-ctrl-group:has(.maplibregl-ctrl-geolocate) {
    display: contents;
} */

/* -------------------------------------------------------------------------
   Bottom-left control positioning (geolocate button)
   Must align vertically with tray toggle button
   ------------------------------------------------------------------------- */

/* Mobile: bottom-left controls go to bottom-right */
@media (max-width: 991px) {
    .maplibregl-ctrl-bottom-left {
        left: auto !important;
        right: 1.25rem !important;
        bottom: 1.25rem !important;
    }

    /* Hide built-in geolocate button on mobile — driving mode button replaces it */
    .maplibregl-ctrl-group:has(.maplibregl-ctrl-geolocate) {
        display: none !important;
    }
}

/* Desktop: bottom-left controls stay on left */
@media (min-width: 992px) {
    .maplibregl-ctrl-bottom-left {
        left: 1.5rem !important;
        right: auto !important;
        bottom: 1.5rem !important;
    }
}

.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl, .maplibregl-ctrl-bottom-left .maplibregl-ctrl {
    float: left;
    margin: 0 !important;
}
/* -------------------------------------------------------------------------
   MapLibre Attribution Control - subtle bottom-center of map
   ------------------------------------------------------------------------- */
.maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.65) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    color: rgba(60, 60, 60, 0.85) !important;
    box-shadow: none !important;
    backdrop-filter: blur(2px);
}

.maplibregl-ctrl-attrib a {
    color: rgba(60, 60, 60, 0.85) !important;
    text-decoration: none !important;
}

.maplibregl-ctrl-attrib a:hover {
    color: #3b82f6 !important;
    text-decoration: underline !important;
}

/* Compact mode - minimal info button */
.maplibregl-ctrl-attrib.maplibregl-compact {
    background: rgba(255, 255, 255, 0.5) !important;
    min-height: 20px !important;
    padding: 0 !important;
    border-radius: 4px !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact-show {
    background: rgba(255, 255, 255, 0.85) !important;
    border-radius: 6px !important;
    padding: 4px 28px 4px 6px !important;
}

.maplibregl-ctrl-attrib-button {
    background-color: rgba(255, 255, 255, 0.5) !important;
    border-radius: 4px !important;
    opacity: 0.7;
    width: 20px !important;
    height: 20px !important;
    background-position: center !important;
    background-size: 14px 14px !important;
}

.maplibregl-ctrl-attrib-button:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.85) !important;
}

/* Center attribution at bottom of map */
.maplibregl-ctrl-bottom-right {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    bottom: 2px !important;
}

.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib {
    margin: 0;
}

.map-btn.tray-toggle {
    background: #f21368;
    border: none;
}

.map-btn .plus {
    font-size: 1.5rem;
    line-height: 1;
}

.location-status {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    background: rgba(5, 7, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    max-width: 200px;
    text-align: center;
}

.validation-prompt {
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1003;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.validation-prompt.hidden {
    display: none;
}

.validation-card {
    width: min(420px, 100%);
    background: rgba(5,7,10,0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
    pointer-events: auto;
}

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

.validation-flag {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

.ghost-btn.tiny {
    padding: 0.1rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 999px;
}

.validation-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.85rem;
}

.validation-category {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.validation-summary {
    margin: 0;
    font-size: 1.25rem;
}

.validation-distance {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
}

.validation-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
}

.validation-actions .ghost-btn,
.validation-actions .cta {
    padding: 1.0rem 1.5rem;
    border-radius: 999px;
    text-transform: none;
}

.category-tray {
    position: absolute;
    left: 6rem;
    right: auto;
    bottom: 1rem;
    width: 260px;
    background: rgba(5, 7, 10, 0.95);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1002;
}

.category-tray.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.category-tray header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.category-tray header button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    cursor: pointer;
}

.tray-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
}

.tray-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
}

.tray-icon span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.tray-icon .icon-glyph {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(242, 19, 104, 0.22);
    border: 1px solid rgba(242, 19, 104, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 38px;
}

.tray-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tray-icon-fallback {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
}

.gps-arrow-icon {
    background: none;
    border: none;
    width: 62px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gps-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.85rem;
    text-shadow: 0 10px 14px rgba(59, 130, 246, 0.5);
    filter: drop-shadow(0 8px 12px rgba(59, 130, 246, 0.45));
    transition: transform 260ms cubic-bezier(.2,.9,.2,1), color 200ms ease, text-shadow 200ms ease;
    transform-origin: 50% 50%;
}

.gps-arrow .heading-icon,
.gps-arrow .dot-icon {
    line-height: 1;
}

.gps-arrow .heading-icon {
    display: inline-block;
}

.gps-arrow .dot-icon {
    display: none;
    font-size: 1rem;
}

.gps-arrow.no-heading {
    filter: none;
    font-size: 1.35rem;
    text-shadow: 0 5px 9px rgba(59, 130, 246, 0.35);
}

.gps-arrow.no-heading .heading-icon {
    display: none;
}

.gps-arrow.no-heading .dot-icon {
    display: inline-block;
}

.draft-marker {
    cursor: pointer;
    transform-origin: 50% 100%;
}

.draft-marker:not(.gl-issue-marker) {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.95);
    border: 2px solid rgba(75, 85, 99, 0.9);
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.5);
}

/* ── Draft Popup ── */
.draft-popup {
    min-width: 260px;
    max-width: 320px;
    font-size: 0.875rem;
    overflow: hidden;
}

.draft-popup-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, rgba(148,163,184,0.25), rgba(148,163,184,0.1));
    color: #94a3b8;
}

.draft-popup-status-bar.status-draft {
    background: linear-gradient(90deg, rgba(148,163,184,0.25), rgba(148,163,184,0.1));
    color: #94a3b8;
}

.draft-popup-status-bar i {
    font-size: 0.7rem;
}

.draft-popup-body {
    padding: 0.875rem 1rem;
}

.draft-popup-category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.draft-popup-category i {
    font-size: 0.65rem;
    color: #64748b;
}

.draft-popup-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.draft-popup-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.draft-popup-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
}

.draft-popup-stat i {
    font-size: 0.7rem;
    color: #475569;
}

.draft-popup-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #64748b, #475569);
    text-decoration: none;
    transition: filter 150ms ease, transform 100ms ease;
    border: none;
    cursor: pointer;
}

.draft-popup-cta:hover,
.draft-popup-cta:focus {
    filter: brightness(1.15);
    text-decoration: none;
    color: #fff;
}

.draft-popup-cta:active {
    transform: scale(0.98);
}

.draft-popup-cta i {
    font-size: 0.75rem;
}

/* Legacy draft popup classes */
.draft-popup-header,
.draft-popup-badge,
.draft-popup-summary,
.draft-popup-footer,
.draft-popup-link {
    display: none;
}

/* Smooth map pane rotation */
.leaflet-map-pane {
    /* transitions are applied inline from JS; keep preserve-3d to avoid blurring */
    transform-origin: 50% 50%;
    backface-visibility: hidden;
    will-change: transform;
}

/* Issue marker (teardrop) and popup styling */
/* Modern teardrop marker with inline SVG + centered icon */
.issue-marker {
    width: 52px;
    height: 66px;
    position: relative;
    display: inline-block;
    pointer-events: auto;
    transition: transform 180ms cubic-bezier(.2,.9,.2,1), filter 180ms ease;
    will-change: transform;
    --marker-status-color: rgba(255,255,255,0.45);
}
.issue-marker:hover {
    transform: translateY(-6px) scale(1.03);
}

.gl-issue-marker {
    cursor: pointer;
    transform-origin: 50% 100%;
}
.issue-marker[data-selected="true"] {
    transform: translateY(-8px) scale(1.06);
}
.issue-marker-svg {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 46px;
    height: 58px;
    overflow: visible;
    filter: drop-shadow(0 10px 20px rgba(2,6,12,0.45));
    z-index: 1;
}
.issue-marker-svg path {
    transition: fill 220ms cubic-bezier(.2,.9,.2,1), stroke 180ms ease;
    fill: var(--marker-bg, #888);
    stroke: rgba(0,0,0,0.14);
    stroke-width: 1;
}
.issue-marker::before {
    /* subtle gloss highlight */
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 4px;
    width: 28px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0.06));
    opacity: 0.95;
    pointer-events: none;
}
.issue-marker::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--marker-status-color);
    border: 2px solid rgba(5,7,10,0.65);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    z-index: 3;
}
.issue-marker[data-status="open"] { --marker-status-color: #94a3b8; }
.issue-marker[data-status="needs_validation"] { --marker-status-color: #fbbf24; }
.issue-marker[data-status="verified"] { --marker-status-color: #60a5fa; }
.issue-marker[data-status="resolved"] { --marker-status-color: #34d399; }
.issue-marker[data-status="rejected"] { --marker-status-color: #ef4444; }
.issue-marker[data-status="draft"] { --marker-status-color: #cbd5f5; }
.issue-marker i {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
    pointer-events: none;
    z-index: 1000;
}

/* FontAwesome fallback removed: markers rely on FA glyphs only. */
.issue-marker .marker-inner-ring {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 18px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 -2px 6px rgba(0,0,0,0.22);
    pointer-events: none;
    z-index: 2;
}

.issue-marker[data-selected="true"] .issue-marker-svg path {
    stroke: rgba(0,0,0,0.22);
}

.issue-marker.marker-draft {
    --marker-bg: #6b7280;
}

.issue-marker.marker-draft::after {
    background: #cbd5f5;
    border-color: rgba(15,23,42,0.55);
}

.issue-marker.marker-draft .marker-inner-ring {
    border-color: rgba(255,255,255,0.18);
    background: rgba(15,23,42,0.45);
}

.issue-marker.marker-draft i {
    color: #f8fafc;
}

/* ── Issue Popup ── */
.issue-popup {
    min-width: 260px;
    max-width: 320px;
    font-size: 0.875rem;
    overflow: hidden;
}

.issue-popup-status-bar {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.issue-popup-status-bar.status-open {
    background: linear-gradient(90deg, rgba(148,163,184,0.25), rgba(148,163,184,0.1));
    color: #cbd5e1;
}

.issue-popup-status-bar.status-needs-validation {
    background: linear-gradient(90deg, rgba(251,191,36,0.25), rgba(251,191,36,0.1));
    color: #fbbf24;
}

.issue-popup-status-bar.status-verified {
    background: linear-gradient(90deg, rgba(96,165,250,0.25), rgba(96,165,250,0.1));
    color: #60a5fa;
}

.issue-popup-status-bar.status-resolved {
    background: linear-gradient(90deg, rgba(52,211,153,0.25), rgba(52,211,153,0.1));
    color: #34d399;
}

.issue-popup-status-bar.status-rejected {
    background: linear-gradient(90deg, rgba(239,68,68,0.25), rgba(239,68,68,0.1));
    color: #ef4444;
}

.issue-popup-body {
    padding: 0.875rem 1rem;
}

.issue-popup-category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.issue-popup-category i {
    font-size: 0.65rem;
    color: #f21368;
}

.issue-popup-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    color: #f8fafc;
    margin-bottom: 0.75rem;
}

.issue-popup-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.issue-popup-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
}

.issue-popup-stat i {
    font-size: 0.7rem;
    color: #475569;
}

.issue-popup-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f21368, #e31937);
    text-decoration: none;
    transition: filter 150ms ease, transform 100ms ease;
    border: none;
    cursor: pointer;
}

.issue-popup-cta:hover,
.issue-popup-cta:focus {
    filter: brightness(1.1);
    text-decoration: none;
    color: #fff;
}

.issue-popup-cta:active {
    transform: scale(0.98);
}

.issue-popup-cta i {
    font-size: 0.75rem;
    transition: transform 150ms ease;
}

.issue-popup-cta:hover i {
    transform: translateX(2px);
}

/* Legacy classes kept for backwards compatibility */
.issue-popup-header,
.issue-popup-meta,
.issue-popup-footer,
.issue-popup-details,
.issue-popup-link {
    display: none;
}

/* ── Issue Popup Moderation ── */
.issue-popup-staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 4px;
}

.issue-popup-staff-badge i {
    font-size: 0.7rem;
}

.issue-popup-spam-count {
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 4px;
}

.issue-popup-moderation {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.moderation-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.moderation-btn--approve {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.moderation-btn--approve:hover {
    background: rgba(52, 211, 153, 0.3);
    border-color: rgba(52, 211, 153, 0.5);
}

.moderation-btn--reject {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.moderation-btn--reject:hover {
    background: rgba(248, 113, 113, 0.3);
    border-color: rgba(248, 113, 113, 0.5);
}

.issue-popup-spam-report {
    margin-top: 0.75rem;
}

.spam-report-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.spam-report-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

.spam-report-btn i {
    font-size: 0.7rem;
}

/* Status pill (used elsewhere) */

.status-pill {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.18rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    gap: 0.25rem;
}

.status-pill i {
    font-size: 0.6rem;
}

.status-open {
    background: rgba(148,163,184,0.2);
    color: #cbd5e1;
    border-color: rgba(148,163,184,0.35);
}

.status-needs-validation {
    background: rgba(251,191,36,0.18);
    color: #fbbf24;
    border-color: rgba(251,191,36,0.35);
}

.status-verified {
    background: rgba(96,165,250,0.18);
    color: #60a5fa;
    border-color: rgba(96,165,250,0.35);
}

.status-resolved {
    background: rgba(52,211,153,0.18);
    color: #34d399;
    border-color: rgba(52,211,153,0.35);
}

.status-rejected {
    background: rgba(239,68,68,0.18);
    color: #ef4444;
    border-color: rgba(239,68,68,0.35);
}

/* ── MapLibre Popup Container ── */
/* Note: !important needed because maplibre-gl.css loads after app.css */
.maplibregl-popup-content {
    background: linear-gradient(145deg, #161b22, #0d1117) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.25) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: #161b22 !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: #161b22 !important;
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #161b22 !important;
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #161b22 !important;
}

.maplibregl-popup-close-button {
    color: #94a3b8 !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    padding: 0.35rem 0.5rem !important;
    border-radius: 6px !important;
    transition: background 150ms ease, color 150ms ease !important;
}

.maplibregl-popup-close-button:hover,
.maplibregl-popup-close-button:focus {
    background: rgba(255,255,255,0.08) !important;
    color: #f3f4f6 !important;
}

/* ── Cluster Marker ── */
.cluster-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f21368, #d91058);
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 16px rgba(242,19,104,0.4), 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.cluster-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(242,19,104,0.5), 0 3px 10px rgba(0,0,0,0.35);
}

.cluster-count {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ── Selection Popup (for overlapping markers) ── */
.selection-popup {
    min-width: 240px;
    max-width: 320px;
    padding: 0;
    color: #f3f4f6;
}

.selection-popup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
}

.selection-popup-header i {
    font-size: 0.9rem;
    color: #f21368;
}

.selection-popup-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    max-height: 280px;
    overflow-y: auto;
}

.selection-item {
    margin: 0;
    padding: 0;
}

.selection-item-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    text-decoration: none;
    color: #f3f4f6;
    transition: background 150ms ease;
}

.selection-item-link:hover {
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.selection-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.selection-badge i {
    font-size: 0.6rem;
}

.selection-badge-issue {
    background: rgba(242,19,104,0.15);
    color: #f21368;
    border: 1px solid rgba(242,19,104,0.3);
}

.selection-badge-draft {
    background: rgba(148,163,184,0.15);
    color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.3);
}

.selection-item-summary {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f8fafc;
}

.selection-item-arrow {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #64748b;
    transition: color 150ms ease, transform 150ms ease;
}

.selection-item-link:hover .selection-item-arrow {
    color: #94a3b8;
    transform: translateX(2px);
}

/* Markercluster minor tweak (optional) */
.marker-cluster-small {
    background-clip: padding-box;
}

.map-wrapper {
    position: relative;
}

#map {
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

/* Atlas page fullscreen layout */
.atlas-shell .atlas-map {
    position: relative;
    width: 100%;
    height: 100%;
}

.atlas-shell #map {
    height: 100%;
    border-radius: 0;
}

/* Hide footer on atlas page */
body.atlas-mode .ta-footer {
    display: none;
}

/* Remove main padding on atlas page */
body.atlas-mode main {
    padding: 0;
}

/* Map filters (atlas) */
.map-filters {
    position: absolute;
    top: 32px;
    left: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
    background: rgba(15, 18, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    width: 280px;
    max-width: 90vw;
    height: auto;
    position: static;
}

.map-filter-panel {
    width: 280px;
    max-width: 90vw;
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 0.75rem 0.85rem;
    backdrop-filter: blur(10px);
}

.map-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.map-filter-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
}

.map-filter-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.35rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-chip input {
    accent-color: #f21368;
}

.filter-chip:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

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

.filter-actions .small {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .map-filters {
        left: 12px;
        right: 12px;
        top: 12px;
    }
    .map-filter-panel {
        width: auto;
    }
    .map-filter-toggle {
        width: auto;
    }
    .filter-actions {
        flex-direction: column;
    }
    .filter-actions .small {
        width: 100%;
        justify-content: center;
    }
}

.floating-cta {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #f21368;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(242, 19, 104, 0.35);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    pointer-events: auto;
}

.floating-cta.ghost {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.panel {
    background: #161b22;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guest-panel {
    margin-top: 1.5rem;
}

.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    background: #161b22;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.auth-card label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.auth-card input {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d1117;
    color: white;
    padding: 0.6rem;
}

.auth-card .full {
    width: 100%;
}

.turnstile-field {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.auth-footer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
/* ─────────────────────────────────────────────────────────────
   Account Page
   ───────────────────────────────────────────────────────────── */
.account-page {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.account-page h1 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.account-card {
    background: #161b22;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.account-card h2 i {
    color: var(--accent, #3b82f6);
}

.account-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-card label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.account-card input[type="text"],
.account-card input[type="email"],
.account-card input[type="password"] {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d1117;
    color: white;
    padding: 0.6rem;
}

.account-card input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.account-card .checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.account-card .checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent, #3b82f6);
}

.account-card .full {
    width: 100%;
    margin-top: 0.5rem;
}

.account-card .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    transition: all 120ms ease;
    margin-top: 0.5rem;
}

.account-card .btn-secondary:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.account-card .btn-secondary i {
    font-size: 0.85rem;
}

.account-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.account-card .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    background: #f21368;
    border: none;
    color: white;
    transition: all 120ms ease;
    margin-top: 0.5rem;
    cursor: pointer;
}

.account-card .btn-primary:hover {
    background: #d10f5a;
    transform: translateY(-1px);
}

.account-card .btn-primary i {
    font-size: 0.9rem;
}

.preference-group {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.preference-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.preference-group .checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

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

.checkbox-content strong {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
}

.checkbox-content .hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    line-height: 1.4;
}

.account-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 1rem;
}

.account-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    transition: all 120ms ease;
}

.account-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.account-actions .btn-secondary i {
    font-size: 0.85rem;
}

.page-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    margin-top: -0.5rem;
}

/* Stats card */
.stats-card .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stats-card .stat-item {
    background: #0d1117;
    border-radius: 12px;
    padding: 1rem 0.5rem;
}

.stats-card .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent, #3b82f6);
}

.stats-card .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card .stat-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   Form Errors (Django errorlist)
   ───────────────────────────────────────────────────────────── */
.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

.errorlist li {
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.errorlist li::before {
    content: "⚠";
    font-size: 0.9em;
}

/* Non-field errors (form-level) */
.auth-card > .errorlist,
.account-card > form > .errorlist {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.auth-card > .errorlist li,
.account-card > form > .errorlist li {
    justify-content: center;
}

#reportForm label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    text-align: left;
    gap: 0.3rem;
}

#reportForm input,
#reportForm textarea,
#reportForm select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d1117;
    color: white;
    padding: 0.6rem;
}

.hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
    .map-panel {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem 0; /* vertical-only on small screens so containers stay centered */
    }
}

/* Draft edit page specific styles */
.draft-edit {
    min-height: 100vh;
    padding-bottom: 2rem;
}

.draft-edit .container {
    max-width: 720px;
    padding: 1rem;
}

.draft-edit .ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.draft-edit h1 {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.draft-edit .panel {
    padding: 0;
    background: rgba(13, 17, 23, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

#draftMap {
    width: 100%;
    height: 220px;
    border-radius: 0;
    overflow: hidden;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Map container for location adjustment */
.draft-edit .map-container {
    position: relative;
}

.adjust-location-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.15s ease;
}

.adjust-location-btn:hover {
    background: rgba(13, 17, 23, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.adjust-location-btn.active {
    background: rgba(242, 19, 104, 0.2);
    border-color: rgba(242, 19, 104, 0.5);
    color: #f21368;
}

.adjust-location-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.adjust-location-hint {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 0.5rem 0.85rem;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.reset-location-link,
.done-adjusting-link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reset-location-link:hover,
.done-adjusting-link:hover {
    color: #60a5fa;
}

.done-adjusting-link {
    color: #22c55e;
}

.done-adjusting-link:hover {
    color: #4ade80;
}

/* Adjusting mode map state */
.draft-edit .map-container.adjusting #draftMap {
    cursor: grab;
}

.draft-edit .map-container.adjusting #draftMap:active {
    cursor: grabbing;
}

#draftForm {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
}

#draftForm label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

#draftForm input,
#draftForm textarea,
#draftForm select {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#draftForm input:focus,
#draftForm textarea:focus,
#draftForm select:focus {
    outline: none;
    border-color: rgba(242, 19, 104, 0.5);
    box-shadow: 0 0 0 3px rgba(242, 19, 104, 0.15);
}

#draftForm textarea {
    min-height: 100px;
    resize: vertical;
}

#draftForm select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Custom fields section */
#draftForm .custom-fields-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 0.5rem;
}

#draftForm .custom-fields-section[hidden] {
    display: none;
}

.custom-fields-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.custom-fields-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.custom-fields-header p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

#customFields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.custom-field-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.custom-field-control label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.custom-field-control input,
.custom-field-control textarea,
.custom-field-control select {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-field-control input:focus,
.custom-field-control textarea:focus,
.custom-field-control select:focus {
    outline: none;
    border-color: rgba(242, 19, 104, 0.5);
    box-shadow: 0 0 0 3px rgba(242, 19, 104, 0.15);
}

.custom-field-control textarea {
    min-height: 100px;
    resize: vertical;
}

.custom-field-control select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.custom-field-control .field-units {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.custom-field-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    align-self: flex-start;
    cursor: pointer;
    accent-color: #f21368;
}

/* Action buttons */
.draft-edit .actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    align-items: stretch;
    flex-direction: row;
}

.draft-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    min-height: 48px;
    transition: all 0.15s ease;
    flex: 1 1 0;
}

.draft-action.cta {
    background: #f21368;
    border: none;
    color: #fff;
}

.draft-action.cta:hover {
    background: #d91159;
}

.draft-action.cta.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.draft-action.cta.ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
}

.draft-action.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: rgba(255, 100, 100, 0.9);
}

.draft-action.ghost-btn:hover {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.5);
}

.ghost-btn[disabled], 
.cta[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (min-width: 641px) {
    .draft-edit .container {
        padding: 1.5rem;
    }
    
    #draftMap {
        height: 280px;
    }
    
    #draftForm {
        padding: 2rem;
    }
    
    .draft-edit .actions {
        justify-content: center;
        flex-direction: row;
    }
    .draft-action {
        width: auto;
    }
}

@media (max-width: 640px) {
    .draft-edit h1 {
        font-size: 1.3rem;
    }
    
    #draftMap {
        height: 180px;
    }
    
    #draftForm {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .draft-edit .actions {
        flex-direction: column;
    }
    
    .draft-action {
        width: auto;
    }
}

/* Utility visibility class for JS toggling (avoid inline styles) */
.hidden { display: none !important; }

/* Compass permission button placement (moved from inline styles) */
.compass-permission-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 1005;
}

/* Marker color classes map to CSS variable consumed by .issue-marker-svg path */
.marker-color-0 { --marker-bg: #ff6b6b; }
.marker-color-1 { --marker-bg: #ffb74d; }
.marker-color-2 { --marker-bg: #ffd166; }
.marker-color-3 { --marker-bg: #4acfac; }
.marker-color-4 { --marker-bg: #57b8ff; }
.marker-color-5 { --marker-bg: #7a63ff; }
.marker-color-6 { --marker-bg: #d57cff; }
.marker-color-7 { --marker-bg: #ff85bf; }

/* Draft edit map sizing previously applied inline */
.draft-edit #draftMap {
    height: 240px;
    margin-bottom: 1rem;
}

body.issue-detail-page main {
    padding: 2.5rem 0;
}

.issue-detail {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.issue-detail-back {
    align-self: flex-start;
}

.issue-detail-card {
    background: linear-gradient(145deg, rgba(24, 31, 39, 0.95), rgba(10, 14, 20, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(3, 7, 14, 0.65);
}

.issue-detail-header h1 {
    margin: 0.5rem 0 1rem;
    font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem);
}

.issue-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.issue-detail-description {
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 1.5rem;
}

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

.issue-detail-section {
    background: rgba(9, 12, 18, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.issue-detail-section h2,
.issue-detail-section h3 {
    margin: 0;
}

.issue-detail-list,
.issue-detail-location dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem 1.25rem;
}

.issue-detail-list div,
.issue-detail-location dl div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.issue-detail-list dt,
.issue-detail-location dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

.issue-detail-list dd,
.issue-detail-location dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.issue-detail-location {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.issue-detail-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    transition: all 120ms ease;
}

.issue-detail-actions a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.issue-detail-actions a i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.issue-detail-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.issue-detail-field .field-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.issue-detail-field .field-value {
    font-weight: 600;
}

.custom-field-list .field-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.custom-field-list .field-value {
    font-weight: 600;
}

.issue-detail-custom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.custom-field-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.custom-field-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.custom-fields-empty {
    margin: 0;
    padding: 0.75rem 0.25rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.issue-validations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-validations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.validation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.validation-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.validation-note {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.75);
}

.validation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.validation-outcome {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    border: 1px solid transparent;
}

.validation-outcome[data-outcome="confirmed"] {
    background: rgba(96, 165, 250, 0.18);
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, 0.4);
}

.validation-outcome[data-outcome="resolved"] {
    background: rgba(52, 211, 153, 0.2);
    color: #047857;
    border-color: rgba(52, 211, 153, 0.45);
}

.validation-outcome[data-outcome="not_seen"] {
    background: rgba(251, 191, 36, 0.2);
    color: #92400e;
    border-color: rgba(251, 191, 36, 0.45);
}

.issue-validations-empty {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Issue Detail Moderation ── */
.pill {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.18rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    gap: 0.25rem;
}

.pill--verified {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.pill--verified i {
    margin-right: 0.25rem;
}

.issue-detail-moderation-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9rem;
}

.issue-detail-moderation-alert i {
    font-size: 1.1rem;
    color: #ef4444;
}

.issue-detail-moderation-alert strong {
    color: #fff;
}

.alert-badge {
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.issue-detail-actions-bar {
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.moderation-actions h3,
.spam-report-action h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.moderation-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-moderation {
    flex: 1;
    min-width: 140px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-moderation:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-moderation--approve {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.btn-moderation--approve:hover:not(:disabled) {
    background: rgba(52, 211, 153, 0.3);
    border-color: rgba(52, 211, 153, 0.6);
}

.btn-moderation--reject {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.btn-moderation--reject:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.3);
    border-color: rgba(248, 113, 113, 0.6);
}

.moderation-info {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(251, 191, 36, 0.5);
    border-radius: 4px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.moderation-info strong {
    color: #fff;
}

.moderation-info em {
    color: rgba(255, 255, 255, 0.6);
}

.btn-spam-report {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-spam-report:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}

.btn-spam-report:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.issue-spam-reports {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.issue-spam-reports h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.spam-report-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spam-report-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 8px;
}

.spam-report-row i {
    color: #f87171;
    font-size: 0.9rem;
}

.spam-reporter {
    font-weight: 600;
    color: #fff;
}

.spam-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-left: auto;
}

@media (max-width: 540px) {
    .issue-detail-card {
        padding: 1.5rem;
    }

    .issue-detail-list,
    .issue-detail-location dl {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Weekly Reports
   ========================================================================== */

.reports-section {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 180px);
}

.reports-header {
    margin-bottom: 2rem;
    text-align: center;
}

.reports-header h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
    color: #fff;
}

.reports-intro {
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1.6;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #e31937;
}

.report-date-range {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin: 0;
}

.report-week-label {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(227, 25, 55, 0.2);
    color: #e31937;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* Report Cards */
.report-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.report-card h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: #fff;
}

.report-card-link {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.report-card-link:hover {
    transform: translateY(-2px);
    border-color: rgba(227, 25, 55, 0.4);
    box-shadow: 0 4px 20px rgba(227, 25, 55, 0.15);
}

.report-card--featured {
    border-color: rgba(227, 25, 55, 0.3);
    background: linear-gradient(135deg, rgba(227, 25, 55, 0.08), rgba(255, 255, 255, 0.03));
}

.report-card-content {
    flex: 1;
}

.report-card-arrow {
    display: flex;
    align-items: center;
    padding-left: 1rem;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s, transform 0.2s;
}

.report-card-link:hover .report-card-arrow {
    color: #e31937;
    transform: translateX(3px);
}

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

.report-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.report-latest-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #e31937, #ff4d6a);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stats Grid */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.report-stat {
    text-align: center;
    position: relative;
}

.report-stat--primary .stat-value {
    color: #e31937;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-trend {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.5);
}

.stat-trend--up {
    color: #f59e0b;
}

.stat-trend--down {
    color: #22c55e;
}

/* Categories Preview */
.report-categories-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.categories-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.category-badge {
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.category-more {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Summary Cards */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.summary-icon {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.summary-content {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.summary-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trend-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-indicator.trend-up {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.trend-indicator.trend-down {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    min-height: 300px;
}

.chart-container {
    position: relative;
    height: 250px;
}

.trend-chart-card .chart-container {
    height: 300px;
}

/* Locations Grid */
.card-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.locations-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.location-rank {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e31937;
    min-width: 2rem;
}

.location-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.location-coords {
    font-family: monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.location-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.location-view-btn {
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.location-view-btn:hover {
    color: #e31937;
}

/* Export Section */
.export-card {
    text-align: center;
}

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

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(227, 25, 55, 0.15);
    color: #e31937;
    border: 1px solid rgba(227, 25, 55, 0.3);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.export-btn:hover {
    background: rgba(227, 25, 55, 0.25);
    transform: translateY(-1px);
}

.login-prompt-card {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.login-prompt-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.login-prompt-card a {
    color: #e31937;
}

/* Report Meta */
.report-meta {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Share Bar */
.report-share-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 0.25rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.share-btn--x:hover {
    background: #000;
    border-color: #000;
}

.share-btn--facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-btn--linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
}

.share-btn--reddit:hover {
    background: #ff4500;
    border-color: #ff4500;
}

.share-btn--copy:hover {
    background: rgba(227, 25, 55, 0.2);
    border-color: #e31937;
    color: #e31937;
}

.share-copied-msg {
    font-size: 0.8rem;
    color: #22c55e;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
}

.share-copied-msg.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Primary Summary Card */
.summary-card--primary {
    background: linear-gradient(135deg, rgba(227, 25, 55, 0.15), rgba(227, 25, 55, 0.05));
    border-color: rgba(227, 25, 55, 0.3);
}

.summary-card--primary .summary-icon {
    color: #e31937;
}

/* Trend Indicator - Flat */
.trend-indicator.trend-flat {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Insights Row */
.report-insights-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.insight-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}

.insight-content {
    display: flex;
    flex-direction: column;
}

.insight-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.insight-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.insight-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* Report Map Section */
.report-map-card {
    overflow: hidden;
}

.report-map-card .report-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.report-map-card .report-card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.report-map {
    width: 100%;
    height: 400px;
}

.report-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
}

.legend-dot {
    width: 8px;
    height: 8px;
    background: #e31937;
    border-radius: 50%;
    border: 1px solid #fff;
}

.legend-dot--md {
    width: 12px;
    height: 12px;
}

.legend-dot--lg {
    width: 18px;
    height: 18px;
}

/* Report Locations List */
.report-locations-list h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

.hotspot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hotspot-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.hotspot-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(227, 25, 55, 0.3);
}

.hotspot-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e31937;
    min-width: 1.5rem;
}

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

.hotspot-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.hotspot-fly-btn,
.hotspot-open-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem;
}

.hotspot-fly-btn:hover,
.hotspot-open-btn:hover {
    background: rgba(227, 25, 55, 0.15);
    border-color: rgba(227, 25, 55, 0.3);
    color: #e31937;
}

/* Report Map Popup */
.report-map-popup {
    text-align: center;
    padding: 0.25rem;
}

.report-map-popup strong {
    display: block;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.report-map-popup p {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #475569;
}

.report-map-popup a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #e31937;
}

/* Category Cards Grid */
.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.category-card:hover {
    background: rgba(227, 25, 55, 0.1);
    border-color: rgba(227, 25, 55, 0.3);
    transform: translateY(-2px);
}

.category-card-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e31937;
    min-width: 1.5rem;
}

.category-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.category-card-name {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.category-card-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.category-card-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.category-card:hover .category-card-arrow {
    color: #e31937;
    transform: translateX(3px);
}

/* Report Card Header with Icon */
.report-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #fff;
}

.report-card h2 i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Reports List */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h2 {
    color: #fff;
    margin: 0 0 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .report-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-insights-row {
        grid-template-columns: 1fr;
    }
    
    .report-map {
        height: 300px;
    }
    
    .hotspot-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 540px) {
    .reports-section {
        padding: 1.5rem 0 3rem;
    }

    .reports-header h1 {
        font-size: 1.5rem;
    }

    .report-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-value {
        font-size: 1.4rem;
    }

    .report-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .report-card-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .report-card-arrow {
        display: none;
    }
    
    .report-share-bar {
        justify-content: flex-start;
    }
    
    .share-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .hotspot-list {
        grid-template-columns: 1fr;
    }
    
    .category-cards-grid {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Self-Driving Availability Layer
   ============================================ */

/* Layer Options (integrated into filter panel) */
.layer-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-option-chip {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.layer-option-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.layer-option-chip:has(input:checked) {
    background: rgba(227, 25, 55, 0.15);
    border-color: rgba(227, 25, 55, 0.4);
}

.layer-option-chip input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: #e31937;
    flex-shrink: 0;
}

.layer-chip-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.layer-chip-name {
    font-weight: 500;
    color: #fff;
    font-size: 0.9rem;
}

.layer-chip-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Self-Driving Tooltip */
.sd-tooltip {
    position: fixed;
    padding: 0.5rem 0.75rem;
    background: rgba(26, 26, 26, 0.95);
    color: #fff;
    font-size: 0.8rem;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    max-width: 200px;
}

.sd-tooltip strong {
    display: block;
    margin-bottom: 0.2rem;
}

/* Self-Driving Popup */
.sd-popup-container .maplibregl-popup-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.sd-popup-container .maplibregl-popup-close-button {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
    right: 0;
    top: 0;
}

.sd-popup-container .maplibregl-popup-close-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sd-popup-container .maplibregl-popup-tip {
    border-top-color: #1a1a1a;
}

.sd-popup {
    padding: 1rem 1.25rem;
    min-width: 220px;
}

.sd-popup-title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    padding-right: 1.5rem;
}

.sd-popup-status {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sd-popup-description {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.sd-popup-updated {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Self-Driving Legend */
.sd-legend {
    position: absolute;
    bottom: 40px;
    right: 10px;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.sd-legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sd-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: #fff;
}

.sd-legend-item:last-child {
    margin-bottom: 0;
}

.sd-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 540px) {
    .sd-legend {
        bottom: auto;
        top: 60px;
        right: 10px;
        left: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOOLS PAGES
   ═══════════════════════════════════════════════════════════════ */

/* ── Tools Index Page ── */
.tools-section {
    padding: 2rem 0 4rem;
}

.tools-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tools-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tools-intro {
    color: #94a3b8;
    font-size: 1.1rem;
}

.tools-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 200ms ease, transform 150ms ease;
}

.tool-card:hover {
    border-color: #f21368;
    transform: translateY(-2px);
    text-decoration: none;
}

.tool-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f21368, #e31937);
    border-radius: 12px;
    flex-shrink: 0;
}

.tool-icon i {
    font-size: 1.5rem;
    color: #fff;
}

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

.tool-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #f8fafc;
}

.tool-description {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.45;
}

.tool-arrow {
    color: #64748b;
    font-size: 1.25rem;
    transition: transform 200ms ease, color 200ms ease;
}

.tool-card:hover .tool-arrow {
    color: #f21368;
    transform: translateX(4px);
}

/* ── Dashcam Viewer Page ── */
.dashcam-section {
    padding: 2rem 0 4rem;
}

.dashcam-header {
    margin-bottom: 2rem;
}

.dashcam-header h1 {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.dashcam-intro {
    color: #94a3b8;
    margin: 0;
}

.dashcam-intro strong {
    color: #34d399;
}

/* Drop Zone */
.dashcam-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
    transition: border-color 200ms ease, background 200ms ease;
}

.dashcam-dropzone.dragover {
    border-color: #f21368;
    background: linear-gradient(145deg, rgba(242, 19, 104, 0.1), rgba(15, 23, 42, 0.5));
}

.dropzone-content i {
    font-size: 4rem;
    color: #475569;
    margin-bottom: 1.5rem;
}

.dropzone-content p {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #94a3b8;
}

.dropzone-or {
    display: block;
    color: #64748b;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.dropzone-hint {
    margin-top: 1.5rem !important;
    font-size: 0.85rem !important;
    color: #64748b !important;
}

/* Loading State */
.dashcam-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f21368;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.dashcam-error {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.1), transparent);
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.dashcam-error i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.dashcam-error h3 {
    margin: 0 0 0.5rem;
    color: #fca5a5;
}

.dashcam-error p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* Viewer Layout - Vertical stack with media row */
.dashcam-viewer {
    margin-top: 1.5rem;
}

/* Main layout - vertical flex column */
.viewer-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Video panel - full width stacked */
.viewer-video-panel {
    position: relative;
    width: 100%;
    min-width: 0;
}

/* Map panel - full width stacked below HUD */
.viewer-map-panel {
    width: 100%;
    min-width: 0;
}

/* Graphs panel - full width */
.viewer-graphs-panel {
    width: 100%;
}

/* When graphs panel is collapsed, hide it */
.viewer-graphs-panel.collapsed {
    display: none;
}

/* ── Braking Events Panel ── */
.viewer-events-panel {
    width: 100%;
}

.viewer-events-panel.collapsed {
    display: none;
}

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

.events-title {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.events-title i {
    color: #fbbf24;
}

.events-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.events-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.events-list {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem;
}

.events-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

.events-empty i {
    color: #22c55e;
    margin-right: 0.35rem;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 150ms ease;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.event-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.event-row.active {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.25);
}

.event-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.event-phantom .event-icon {
    color: #fbbf24;
}

.event-hard .event-icon {
    color: #ef4444;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.event-label {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.event-meta {
    font-size: 0.72rem;
    color: #94a3b8;
}

.event-ap-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.event-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 150ms ease;
    font-size: 0.75rem;
}

.event-report-btn:hover {
    background: rgba(242, 19, 104, 0.15);
    border-color: rgba(242, 19, 104, 0.3);
    color: #f21368;
}

/* Events badge on toggle button */
.control-btn {
    position: relative;
}

.events-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #f21368;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* Camera Composite Layout - All cameras overlaid on front view */
.camera-composite {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* GPS Track Map Panel */
.gps-track-map-wrapper {
    position: relative;
    width: 100%;
}

.gps-track-map {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    touch-action: pan-y;
}

/* CSS-only position marker, always centered on map (never jumps) */
.map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: #f21368;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
    pointer-events: none;
}

/* Draft button on GPS track map */
.map-draft-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 15;
    background: #f21368;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(242, 19, 104, 0.4);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.map-draft-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(242, 19, 104, 0.5);
}

.map-draft-btn:active {
    transform: scale(0.95);
}

/* Generic map overlay button (road detail toggle, etc.) */
.map-overlay-btn {
    position: absolute;
    top: 12px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
    z-index: 15;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.road-detail-toggle {
    left: 64px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.road-detail-toggle:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
}

.road-detail-toggle:active {
    transform: scale(0.95);
}

.road-detail-toggle.active {
    background: #05cb63;
    box-shadow: 0 4px 12px rgba(5, 203, 99, 0.4);
}

/* Main front camera fills the entire view */
.camera-main {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.camera-main .dashcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-main .camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    color: #475569;
}

.camera-main .camera-placeholder i {
    font-size: 2rem;
}

.camera-main .camera-placeholder span {
    font-size: 0.85rem;
}

/* Rearview bar at top - stretched wide like a real rearview mirror */
.camera-rearview {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 20%;
    z-index: 10;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.camera-rearview .dashcam-video {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* Flip horizontally for rearview mirror effect */
    transform: scaleX(-1);
}

.camera-rearview .camera-label {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.camera-rearview .camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    color: #475569;
    font-size: 0.65rem;
}

/* PIP cameras in bottom corners */
.camera-pip {
    position: absolute;
    bottom: 12px;
    width: 20%;
    aspect-ratio: 16 / 9;
    z-index: 10;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.camera-pip.left {
    left: 12px;
}

.camera-pip.right {
    right: 12px;
}

.camera-pip .dashcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-pip .camera-label {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.camera-pip .camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    color: #475569;
    font-size: 0.8rem;
}

.camera-placeholder.hidden {
    display: none;
}

/* Projected path tentacle overlay on front video */
.tentacle-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* Watermark */
.video-watermark {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 0.6;
    z-index: 5;
    pointer-events: none;
}

.watermark-logo {
    height: 20px;
    width: auto;
}

/* ─────────────────────────────────────────────────────────────
   Telemetry HUD - Inline strip between video and map
   ───────────────────────────────────────────────────────────── */
.telemetry-hud {
    height: 44px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Half containers: flex:1 so steering stays centred */
.hud-half {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hud-half-left {
    justify-content: flex-end;
}

.hud-half-right {
    justify-content: flex-start;
}

/* Every cell is flex-shrink:0 so nothing shifts when text changes */
.hud-cell {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Speed cluster: speed + unit + gear + AP ── */
.hud-speed-cluster {
    gap: 5px;
    align-items: baseline;
}

.hud-speed-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    min-width: 36px;
}

.hud-speed-unit {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hud-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

.hud-badge.hud-ap {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.hud-badge.hud-ap.active {
    background: rgba(59, 130, 246, 0.5);
    color: #fff;
    animation: hudApPulse 2s ease-in-out infinite;
}

@keyframes hudApPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Steering group: centred, column layout (track above, ° below) ── */
.hud-steer-group {
    flex: 0 0 auto;
    width: clamp(100px, 22vw, 240px);
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

/* ── Blinkers: direct children of HUD, flanking steering ── */
.hud-blinker {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.hud-blinker.active {
    color: #22c55e;
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.8));
    animation: hudBlink 0.5s ease-in-out infinite;
}

@keyframes hudBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hud-steering-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
}

.hud-steering-center {
    position: absolute;
    left: 50%;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.hud-steering-fill {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 0%;
    border-radius: 4px;
    transition: left 0.06s linear, width 0.06s linear;
}

.hud-steering-fill.left {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.5), rgba(245, 158, 11, 0.2));
}

.hud-steering-fill.right {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.5));
}

.hud-steering-indicator {
    position: absolute;
    left: 50%;
    top: -4px;
    bottom: -4px;
    width: 4px;
    margin-left: -2px;
    background: #fff;
    border-radius: 2px;
    transition: left 0.06s linear;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.hud-steering-indicator.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.hud-steer-val {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ── Dynamics group: fixed 105px ── */
.hud-dynamics-group {
    width: 105px;
    gap: 6px;
}

.hud-pedal-pair {
    display: flex;
    align-items: flex-end;
    gap: 3px;
}

.hud-pedal-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-pedal-bar.brake {
    width: 16px;
    height: 14px;
}

.hud-pedal-bar.accel {
    width: 10px;
    height: 24px;
}

.hud-pedal-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    transition: height 0.08s ease-out;
    border-radius: 0 0 2px 2px;
}

.hud-pedal-bar.brake .hud-pedal-fill {
    background: #ef4444;
}

.hud-pedal-bar.brake.active {
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.hud-pedal-bar.accel .hud-pedal-fill {
    background: #22c55e;
}

.hud-pedal-bar.accel.active {
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

#hudGforceCanvas {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud-g-val {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* ── Logo ── */
.hud-logo {
    height: 22px;
    width: auto;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ── Narrow screen: tighten spacing ── */
@media (max-width: 600px) {
    .telemetry-hud {
        padding: 0 0.5rem;
        gap: 0.35rem;
    }
}

/* ── Very narrow: simplify HUD ── */
@media (max-width: 500px) {
    .hud-steer-group,
    .hud-blinker,
    .hud-logo {
        display: none;
    }
}

/* Export progress overlay */
.dashcam-export-progress {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 2rem));
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    display: grid;
    gap: 0.5rem;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.dashcam-export-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
}

.dashcam-export-progress-row .meta {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 0.85rem;
}

.dashcam-export-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.dashcam-export-progress-bar > div {
    height: 100%;
    width: 0%;
    background: rgba(59, 130, 246, 0.8);
    border-radius: 999px;
    transition: width 120ms linear;
}

/* Export overlay on the viewer */
.dashcam-export-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.dashcam-export-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 600;
}

.dashcam-export-overlay-inner i {
    font-size: 2rem;
    color: rgba(59, 130, 246, 0.9);
}

/* Unified Controls */
.unified-controls {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.controls-timeline {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-seekbar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
}

.video-seekbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f21368;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.video-seekbar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f21368;
    cursor: pointer;
    border: 2px solid #fff;
}

.time-display {
    font-size: 0.85rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

.controls-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 150ms ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.control-btn.primary {
    width: 48px;
    height: 48px;
    background: #f21368;
    border-color: #f21368;
    font-size: 1.1rem;
}

.control-btn.primary:hover {
    background: #d9115c;
    border-color: #d9115c;
}

/* Recording state for export button */
.control-btn.recording {
    background: #ef4444;
    border-color: #ef4444;
    animation: recording-pulse 1s ease-in-out infinite;
}

.control-btn.recording:hover {
    background: #dc2626;
    border-color: #dc2626;
}

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Active state for charts toggle button */
.control-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
}

.controls-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.5rem;
}

.controls-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
}

/* Telemetry Strip (below video on desktop) */
.telemetry-strip {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Mobile Camera Tabs (hidden on desktop) */
.mobile-camera-tabs {
    display: none;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.camera-tab {
    flex: 1;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.camera-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.camera-tab.active {
    background: #f21368;
    border-color: #f21368;
    color: #fff;
}

.camera-tab.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.telemetry-overlay-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.telemetry-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gforce-wrapper {
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.dashcam-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-filename {
    font-weight: 600;
    color: #f8fafc;
}

.video-meta {
    color: #64748b;
    margin-left: 0.5rem;
}

/* Status Bar Overlay */
.video-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.status-item i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.status-value {
    font-weight: 600;
    color: #fff;
}

.status-item.blinker {
    opacity: 0.3;
    transition: opacity 150ms ease;
}

.status-item.blinker.active {
    opacity: 1;
    color: #fbbf24;
}

.status-item.blinker.active i {
    opacity: 1;
}

.status-item.indicator {
    opacity: 0.3;
    transition: opacity 150ms ease;
}

.status-item.indicator.active {
    opacity: 1;
    color: #ef4444;
}

#statusAutopilot.active {
    color: #60a5fa;
}

#statusAutopilot.active .status-value {
    color: #60a5fa;
}

/* G-Force Overlay */
.video-overlay-gforce {
    position: absolute;
    bottom: 60px;
    right: 12px;
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    z-index: 10;
}

#gforceCanvas {
    display: block;
}

/* Graphs Panel - Full width below video+map on desktop */
.viewer-graphs-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.viewer-graphs-panel .graphs-panel-header {
    grid-column: 1 / -1; /* Span all columns */
}

/* Collapsed state */
.viewer-graphs-panel.collapsed {
    display: none;
}

/* Medium screens - 2 columns */
@media (max-width: 1200px) {
    .viewer-graphs-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet/Mobile - single column */
@media (max-width: 1024px) {
    .viewer-graphs-panel {
        display: flex;
        flex-direction: column;
    }
}

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

.graphs-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.graphs-title i {
    color: #3b82f6;
}

.graphs-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.graphs-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.graph-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
}

.graph-card h4 {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.graph-card canvas {
    width: 100% !important;
    height: 80px !important;
}

/* Info Box */
.dashcam-info {
    margin-top: 3rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.dashcam-info h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: #94a3b8;
}

.dashcam-info h3 i {
    margin-right: 0.5rem;
    color: #60a5fa;
}

.dashcam-info p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}

.dashcam-info p:last-child {
    margin-bottom: 0;
}

.dashcam-info strong {
    color: #94a3b8;
}

/* Desktop-only elements (hidden on mobile) */
.desktop-only {
    display: block;
}

/* Mobile-only elements (hidden on desktop) */
.mobile-only {
    display: none;
}

/* Mobile Telemetry Strip - appears below video on mobile */
.mobile-telemetry-strip {
    display: none;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    gap: 0.75rem;
}

.mobile-telemetry-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mobile-telemetry-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-gforce {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-gforce canvas {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .video-overlay-top {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .status-item {
        font-size: 0.75rem;
    }
    
    /* Hide desktop overlays on mobile */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile telemetry strip */
    .mobile-only {
        display: flex !important;
    }
    
    .mobile-telemetry-strip {
        display: flex;
    }
    
    .graph-card canvas {
        height: 60px !important;
    }
    
    /* Mobile: single camera view with tabs to switch */
    .camera-composite {
        aspect-ratio: 16 / 9;
    }
    
    /* Hide overlays on mobile - show only main + active tab camera */
    .camera-rearview,
    .camera-pip {
        display: none;
    }
    
    /* Hide tentacle overlay when not viewing front camera */
    .camera-composite:not(.mobile-front) .tentacle-overlay {
        display: none;
    }
    
    /* When a camera is selected via tab, show it as main view */
    .camera-composite.mobile-back .camera-main,
    .camera-composite.mobile-left .camera-main,
    .camera-composite.mobile-right .camera-main {
        display: none;
    }
    
    .camera-composite.mobile-back .camera-rearview {
        display: block;
        position: absolute;
        inset: 0;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .camera-composite.mobile-back .camera-rearview .dashcam-video {
        transform: scaleX(1); /* Don't flip when viewing full screen */
    }
    
    .camera-composite.mobile-left .camera-pip.left,
    .camera-composite.mobile-right .camera-pip.right {
        display: block;
        position: absolute;
        inset: 0;
        bottom: 0;
        width: 100%;
        aspect-ratio: auto;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    .mobile-camera-tabs {
        display: flex !important;
    }
    
    .unified-controls {
        padding: 0.75rem;
    }
    
    .controls-buttons {
        flex-wrap: wrap;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .control-btn.primary {
        width: 44px;
        height: 44px;
    }
    
    .telemetry-strip {
        flex-wrap: wrap;
    }
    
    .gforce-wrapper {
        width: 100px;
        height: 100px;
    }
    
    #gforceCanvas {
        width: 100px;
        height: 100px;
    }
    
    /* Telemetry HUD mobile */
    .telemetry-hud {
        height: 52px;
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .hud-half {
        gap: 0.75rem;
    }

    .hud-half-left {
        justify-content: flex-start;
        overflow: visible;
        position: relative;
    }

    .hud-half-left .hud-cell {
        flex-shrink: 1;
        min-width: 0;
    }

    .hud-speed-cluster {
        flex-wrap: wrap;
        align-items: baseline;
        gap: 3px;
    }

    .hud-badge.hud-ap {
        font-size: 0.5rem;
        flex-basis: 100%;
        z-index: 5;
    }

    .hud-speed-num {
        font-size: 1.1rem;
        line-height: 1;
    }

    .hud-steer-group,
    .hud-blinker {
        display: none;
    }

    .hud-logo {
        display: none;
    }

    /* Show steering on slightly larger mobile screens */
    @media (min-width: 420px) {
        .hud-steer-group,
        .hud-blinker {
            display: flex;
        }
    }
    
    /* Graphs panel on mobile - shown below video when toggled */
    .viewer-graphs-panel {
        display: none;
        order: 10; /* Ensure it appears after video panel */
        max-height: none;
        border-radius: 12px;
    }
    
    .viewer-graphs-panel.mobile-visible {
        display: flex;
    }

    /* Events panel on mobile */
    .viewer-events-panel {
        display: none;
        order: 11;
    }

    .viewer-events-panel.mobile-visible {
        display: block;
    }
}

/* Dashcam Category Modal */
.dashcam-category-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashcam-category-modal[hidden] {
    display: none;
}

.category-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.category-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.category-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.category-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.category-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 150ms ease;
}

.category-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 150ms ease;
}

.category-grid-item:hover {
    background: rgba(242, 19, 104, 0.1);
    border-color: rgba(242, 19, 104, 0.3);
    transform: translateY(-2px);
}

.category-grid-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.category-grid-item .category-icon-fallback {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 1rem;
}

.category-grid-item span {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.3;
}

.category-modal-hint {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

.category-grid-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Dashcam notification toast */
.dashcam-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1100;
    animation: slideUp 300ms ease;
}

.dashcam-notification.success {
    border-color: rgba(52, 211, 153, 0.3);
}

.dashcam-notification.success i {
    color: #34d399;
    font-size: 1.25rem;
}

.dashcam-notification span {
    color: #f1f5f9;
    font-size: 0.9rem;
}

.dashcam-notification a {
    color: #60a5fa;
    text-decoration: underline;
}

.dashcam-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: all 300ms ease;
}

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

/* ─── Leaderboard Page ─── */
.leaderboard-section {
    padding: 2rem 0 4rem;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.leaderboard-header h1 i {
    color: #fbbf24;
}

.leaderboard-intro {
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.leaderboard-scoring {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.leaderboard-scoring h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scoring-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.scoring-points {
    font-size: 1.1rem;
    font-weight: 700;
    color: #34d399;
}

.scoring-action {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.leaderboard-table-wrap {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

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

.leaderboard-table thead {
    background: rgba(15, 23, 42, 0.6);
}

.leaderboard-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table tbody tr.current-user {
    background: rgba(59, 130, 246, 0.1);
}

.leaderboard-table tbody tr.current-user:hover {
    background: rgba(59, 130, 246, 0.15);
}

.col-rank {
    width: 80px;
    text-align: center;
}

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

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b0e;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #1e293b;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #1e1b0e;
}

.rank-number {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.user-name {
    font-weight: 500;
    color: #f1f5f9;
}

.you-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border-radius: 4px;
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border-radius: 6px;
}

.points-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #34d399;
}

.leaderboard-cta {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.leaderboard-cta p {
    margin: 0 0 1rem 0;
    color: rgba(255, 255, 255, 0.8);
}

.leaderboard-user-rank {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.leaderboard-user-rank strong {
    color: #60a5fa;
}

.level-badge sup {
    font-size: 0.65em;
    opacity: 0.7;
    margin-left: 2px;
    vertical-align: super;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .leaderboard-header h1 {
        font-size: 1.5rem;
    }
    
    .scoring-grid {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .level-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* -------------------------------------------------------------------------
   PWA Offline UI
   ------------------------------------------------------------------------- */

.offline-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 1300;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.offline-banner[hidden] {
    display: none;
}

.offline-banner i {
    color: #f59e0b;
    font-size: 1rem;
}

.pending-badge {
    background: #e31937;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    min-width: 1.5rem;
    text-align: center;
}

.pending-badge[hidden] {
    display: none;
}

/* PWA Install prompt button (optional, placed by controller.js) */
.pwa-install-btn {
    background: linear-gradient(135deg, #e31937 0%, #c41230 100%);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 25, 55, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

/* Offline indicator for draft cards */
.draft-card.pending-sync {
    position: relative;
}

.draft-card.pending-sync::after {
    content: '';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 0.625rem;
    height: 0.625rem;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
    animation: pulse-pending 2s ease-in-out infinite;
}

@keyframes pulse-pending {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* -------------------------------------------------------------------------
   PWA Install Prompts
   ------------------------------------------------------------------------- */

/* Android/Desktop install prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1400;
    pointer-events: none;
}

.pwa-install-prompt[hidden] {
    display: none;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    font-size: 0.9375rem;
    color: #fff;
    margin-bottom: 0.125rem;
}

.pwa-install-text span {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.pwa-install-action {
    background: linear-gradient(135deg, #e31937 0%, #c41230 100%);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.pwa-install-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 25, 55, 0.4);
}

.pwa-install-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.pwa-install-dismiss:hover {
    color: #fff;
}

/* iOS Install Instructions Modal */
.pwa-ios-prompt {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pwa-ios-prompt[hidden] {
    display: none;
}

.pwa-ios-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.pwa-ios-content {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.pwa-ios-dismiss {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.pwa-ios-dismiss:hover {
    color: #fff;
}

.pwa-ios-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.pwa-ios-content h3 {
    font-size: 1.25rem;
    color: #fff;
    margin: 0 0 0.5rem;
}

.pwa-ios-content > p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.5rem;
}

.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
}

.pwa-ios-steps li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.pwa-ios-steps li:last-child {
    margin-bottom: 0;
}

.pwa-ios-steps li i {
    color: #60a5fa;
    font-size: 1.125rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.pwa-ios-steps li strong {
    color: #fff;
}

.pwa-ios-got-it {
    width: 100%;
    background: linear-gradient(135deg, #e31937 0%, #c41230 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pwa-ios-got-it:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 25, 55, 0.4);
}

/* PWA Update Banner */
.pwa-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1400;
    font-size: 0.875rem;
    font-weight: 500;
}

.pwa-update-banner[hidden] {
    display: none;
}

.pwa-update-action {
    background: #fff;
    color: #1e40af;
    border: none;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.pwa-update-action:hover:not(:disabled) {
    transform: translateY(-1px);
}

.pwa-update-action:disabled {
    opacity: 0.7;
    cursor: wait;
}

.pwa-update-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: color 0.15s ease;
}

.pwa-update-dismiss:hover {
    color: #fff;
}

