/* RideLink brand wordmark font — declared once so every page that loads styles.css
   (app.html, feedback.html, etc.) can use it. The landing page (index.html) declares
   its own inline copy because it doesn't pull in styles.css. */
@font-face {
    font-family: 'Climate Crisis';
    src: url('ClimateCrisis.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #000000;
    color: white;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(60% 50% at 50% 35%, #2a2008 0%, #0d0a04 55%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
}

.loading-content {
    max-width: 320px;
    text-align: left;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: 'Climate Crisis', 'Poppins', 'Inter', sans-serif;
    font-weight: 400;
    color: #fff;
    font-size: clamp(2rem, 7vw, 2.6rem);
    line-height: 1.1;
    margin-bottom: 14px;
    letter-spacing: 0;
}

.loading-joke {
    /* Use the same clean UI font as the "No activity nearby" banner */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-weight: 600;
    color: rgba(212, 175, 55, 0.7);
    font-size: clamp(1rem, 3.4vw, 1.15rem);
    line-height: 1.35;
    letter-spacing: 0;
}

/* Loading screen — light mode. The default declarations above are the dark
   version; these flip the background to a warm cream and darken the text so
   it reads. The early-init script at the top of app.html sets data-theme
   before render, so the loading screen comes up in the correct theme. */
:root:not([data-theme="dark"]) .loading-screen {
    background: radial-gradient(60% 50% at 50% 35%, #fff8e7 0%, #faf2dc 55%, #f3ead0 100%) !important;
}
:root:not([data-theme="dark"]) .loading-text {
    color: #8d7409 !important;
}
:root:not([data-theme="dark"]) .loading-joke {
    color: #b8960e !important;
}

/* Permission Screen — shares the loading-screen warm gradient so the two
   feel like the same intro flow. Title uses the Climate Crisis brand font. */
.permission-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(60% 50% at 50% 35%, #2a2008 0%, #0d0a04 55%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
:root:not([data-theme="dark"]) .permission-screen {
    background: radial-gradient(60% 50% at 50% 35%, #fff8e7 0%, #faf2dc 55%, #f3ead0 100%) !important;
}

.permission-content {
    text-align: center;
    padding: 0 40px;
    max-width: 400px;
}

.permission-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.permission-title {
    font-family: 'Climate Crisis', 'Poppins', 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0;
    font-size: clamp(1.6rem, 5.5vw, 2.1rem);
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.1;
}
:root:not([data-theme="dark"]) .permission-title { color: #8d7409 !important; }

.permission-subtext {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 22px;
    margin-bottom: 28px;
}
:root:not([data-theme="dark"]) .permission-subtext { color: rgba(0, 0, 0, 0.6) !important; }

.permission-button {
    background: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
    color: #3D2914;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transition: transform 0.2s, opacity 0.2s;
}

.permission-button:hover {
    transform: translateY(-2px);
}

.permission-button:active {
    transform: translateY(0);
}

.permission-button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

/* Help hint that appears AFTER a denied/failed permission request.
   Tells the user how to enable location at the OS/browser level so they
   stop tapping Allow and getting nothing. */
.permission-deny-hint {
    margin-top: 20px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
}
.permission-deny-hint strong { color: #D4AF37; font-weight: 600; }
.permission-deny-hint.hidden { display: none; }
:root:not([data-theme="dark"]) .permission-deny-hint {
    color: rgba(0, 0, 0, 0.7) !important;
    background: rgba(212, 175, 55, 0.14) !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
}
:root:not([data-theme="dark"]) .permission-deny-hint strong { color: #b8960e !important; }

/* Map Container */
#mapContainer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Leaflet Dark Theme Override */
.leaflet-container {
    background: #0e1626;
}

.leaflet-tile {
    filter: brightness(0.7) contrast(1.2) saturate(0.8);
}

/* Fix marker click hitbox */
.leaflet-marker-icon {
    cursor: pointer !important;
}

.leaflet-marker-icon.marker-icon-wrapper {
    background: transparent !important;
    border: none !important;
}

/* Leaflet Zoom Controls - Bottom Left */
.leaflet-top.leaflet-left {
    top: auto !important;
    bottom: 20px !important;
    left: 16px !important;
}

.leaflet-bottom.leaflet-left {
    bottom: 20px !important;
    left: 16px !important;
}

.leaflet-left .leaflet-control {
    margin-left: 0 !important;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 0 !important;
}

.leaflet-control-zoom a {
    background: rgba(30, 30, 30, 0.95) !important;
    color: #D4AF37 !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(40, 40, 40, 0.95) !important;
    color: #C5A028 !important;
}

.leaflet-control-zoom-in {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.leaflet-control-zoom-out {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

/* Top Banner */
.top-banner {
    position: absolute;
    top: 20px;
    left: 16px;
    right: 16px;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.2s;
}

.top-banner:hover {
    transform: translateY(-2px);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-icon {
    flex-shrink: 0;
}

.banner-text {
    flex: 1;
}

.banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.banner-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

/* "X Rideouts made near you last month" line inside the banner */
.banner-rideouts {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    min-width: 0;
}
.banner-rideouts #rideoutsNearText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-chevron {
    flex-shrink: 0;
}

/* Top Right Buttons Container */
.top-right-buttons {
    position: absolute;
    top: 122px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* Feedback Button (Top Right) */
.feedback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.95) 0%, rgba(30, 28, 20, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    color: #D4AF37;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.feedback-btn span {
    color: #D4AF37;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(30, 30, 32, 0.98) 0%, rgba(40, 36, 24, 0.98) 100%);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.feedback-btn:active {
    transform: translateY(0);
}

.feedback-btn svg {
    transition: transform 0.2s ease;
}

.feedback-btn:hover svg {
    transform: scale(1.1);
}

/* Support Me Button (Top Right) */
.support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.95) 0%, rgba(30, 28, 20, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    color: #D4AF37;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.support-btn span {
    color: #D4AF37;
}

.support-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(30, 30, 32, 0.98) 0%, rgba(40, 36, 24, 0.98) 100%);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.support-btn:active {
    transform: translateY(0);
}

.support-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.support-btn:hover svg {
    transform: scale(1.1);
}

/* My Location Button */
.my-location-btn {
    position: absolute;
    bottom: 55px;
    right: 16px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.2s;
}

.my-location-btn:hover {
    transform: translateY(-2px);
}

.my-location-btn:active {
    transform: translateY(0);
}

/* Custom Marker Styles */
.marker-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.marker-police-inner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #EF4444;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.marker-minor-inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #D4AF37;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.marker-major-inner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4CAF50;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

/* Legacy marker classes (for backwards compatibility) */
.marker-police {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #EF4444;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-minor {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #D4AF37;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.marker-major {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4CAF50;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: rgba(25, 25, 25, 0.98);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 24px;
}

/* Report Options */
.report-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
}

.report-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.report-icon {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.police-icon {
    background: #EF4444;
}

.minor-icon {
    background: #D4AF37;
}

.major-icon {
    background: #4CAF50;
}

.report-info {
    flex: 1;
}

.report-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.report-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.cancel-button {
    margin-top: 8px;
    padding: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.cancel-button:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Rider Count Grid */
.rider-count-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.rider-count-btn {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    border: 1px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.rider-count-btn:hover {
    transform: scale(1.05);
}

.rider-count-btn.minor {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
}

.rider-count-btn.major {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
}

.rider-count-number {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.rider-count-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.skip-button {
    padding: 14px;
    background: transparent;
    border: none;
    color: #D4AF37;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 8px;
}

.skip-button:hover {
    color: #C5A028;
}

/* Back-to-previous-question button (lives next to Cancel in the rideout flow) */
.back-button {
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 8px;
}
.back-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Activity Sheet */
.activity-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.activity-content {
    position: relative;
    background: rgba(25, 25, 25, 0.98);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.activity-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.close-button {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.activity-list {
    overflow-y: auto;
    flex: 1;
}

.activity-section {
    margin-bottom: 24px;
}

.activity-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.activity-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #D4AF37;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.activity-section-count {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.activity-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.activity-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-item-content {
    flex: 1;
}

.activity-item-text {
    font-size: 14px;
    color: #fff;
}

.activity-item-reporter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.activity-item-time {
    font-size: 12px;
    color: #D4AF37;
    font-weight: 600;
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
}

.activity-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.activity-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.activity-empty-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Marker Detail */
.marker-detail {
    text-align: center;
    position: relative;
}

.share-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #2a2a2a;
    border: 1.5px solid #3a3a3a;
    border-radius: 20px;
    color: #D4AF37;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn span {
    color: rgba(255, 255, 255, 0.9);
}

.share-btn:hover {
    background: #3a3a3a;
    border-color: #D4AF37;
}

.share-btn:active {
    transform: scale(0.97);
    background: #1a1a1a;
}

/* Messages pill — sits directly under the Share button in the top-right of
   the marker detail card. Same look so they read as a paired set. */
.share-btn.marker-message-pill {
    top: 42px;
    right: 0;
}
:root:not([data-theme="dark"]) .share-btn,
:root:not([data-theme="dark"]) .share-btn.marker-message-pill {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.1) !important;
    color: #b8960e !important;
}
:root:not([data-theme="dark"]) .share-btn span,
:root:not([data-theme="dark"]) .share-btn.marker-message-pill span {
    color: rgba(0,0,0,0.85) !important;
}

.marker-detail-icon {
    width: 72px;
    height: 72px;
    border-radius: 36px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-detail-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.marker-detail-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 22px;
    margin-bottom: 20px;
    padding: 0 12px;
}

.marker-detail-reporter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.marker-detail-reporter-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.marker-detail-reporter-name {
    font-size: 14px;
    font-weight: 600;
    color: #D4AF37;
}

/* Founder Badge */
.founder-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 6px;
    background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    vertical-align: middle;
}

.marker-detail-status {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(76, 175, 80, 0.15);
    padding: 10px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.marker-detail-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #4CAF50;
}

.marker-detail-status-text {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
}

.marker-detail-upload-time {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marker-detail-upload-time::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
}

.marker-detail-expires-in {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marker-detail-expires-in::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
}

.marker-detail-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.marker-detail-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.detail-button-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2a2a2a;
    border: 2px solid #D4AF37;
    border-radius: 12px;
    padding: 16px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-button-grid:active {
    transform: scale(0.95);
    background: #3a3a3a;
}

.detail-button-grid span {
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.detail-button-grid svg {
    flex-shrink: 0;
}

.detail-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 16px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.detail-button:hover {
    opacity: 0.9;
}

.detail-button-primary {
    background: #D4AF37;
    color: #3D2914;
}

.detail-button-danger {
    background: #EF4444;
    color: #fff;
}

.detail-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: min(390px, calc(100vw - 24px));
}

.toast {
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease-out;
    pointer-events: all;
    width: 100%;
    min-width: min(250px, calc(100vw - 24px));
    max-width: 390px;
    text-align: center;
    overflow-wrap: anywhere;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.info {
    border-left: 4px solid #D4AF37;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.35;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .modal-content {
        max-width: 100%;
    }

    .activity-content {
        max-width: 100%;
    }
}

/* Ad Banner Styles */
.ad-banner-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =============================================
   LEFT-SIDE CONTROLS (bottom-left, above zoom)
   ============================================= */
.policy-controls {
    position: absolute;
    bottom: 102px; /* sits just above zoom controls */
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: all;
}

.policy-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(26, 26, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 13px 14px 13px 13px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    width: 48px;
    overflow: hidden;
}

.policy-btn:hover {
    width: auto;
    background: rgba(30, 30, 30, 0.98);
    border-color: rgba(212, 175, 55, 0.4);
    color: #D4AF37;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.15);
}

.policy-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.18s;
}

.policy-btn:hover svg {
    opacity: 1;
}

.policy-btn-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, width 0.18s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.policy-btn:hover .policy-btn-label {
    opacity: 1;
    width: auto;
}

.policy-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.policy-btn-disabled:hover {
    background: rgba(26, 26, 26, 0.92);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.policy-btn-disabled:hover .policy-btn-label::after {
    content: ' — Coming Soon';
    opacity: 0.6;
    font-style: italic;
}

/* =============================================
   UPLOAD SUCCESS CARD
   ============================================= */
.upload-success-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 3000;
    width: min(400px, calc(100vw - 32px));
    background: rgba(18, 18, 18, 0.97);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 22px;
    padding: 32px 28px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.upload-success-card.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}
.upload-card-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.upload-card-close:hover { color: #fff; background: rgba(255,255,255,0.12); }

.upload-card-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 18px;
}
.upload-card-text {
    width: 100%;
    text-align: right;
    padding-right: 4px;
}
.upload-card-title {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
    margin-bottom: 10px;
}
.upload-card-sub {
    font-size: 15px;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}
.upload-card-share {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #D4AF37;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.upload-card-share:hover { background: #c9a52e; }

/* =============================================
   MAP SEARCH BAR
   ============================================= */
.map-search-bar {
    position: absolute;
    top: 116px; /* below the 3-line top banner (title + rideouts + subtitle) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16,16,16,0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 9px 13px;
    width: min(320px, calc(100vw - 220px)); /* leaves room for right buttons (~170px) */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.map-search-icon { flex-shrink: 0; }
#mapSearchInput {
    background: none;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.88);
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    flex: 1;
    min-width: 0;
}
#mapSearchInput::placeholder { color: rgba(255,255,255,0.3); }
#mapSearchClear {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    flex-shrink: 0;
}

/* =============================================
   VERSION ROW + SOCIAL BUTTONS
   ============================================= */
#versionRow {
    position: absolute;
    bottom: 153px; /* above #socialButtons (107px + 40px height + 6px gap) */
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
}
#versionLabel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    background: rgba(10,10,10,0.78);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    padding: 3px 8px;
    backdrop-filter: blur(6px);
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: border-color 0.15s, color 0.15s;
}
#versionLabel:hover {
    border-color: rgba(212,175,55,0.4);
    color: rgba(255,255,255,0.8);
}
#versionTooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(12,12,12,0.96);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #D4AF37;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s, transform 0.18s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
}
#versionTooltip.show {
    opacity: 1;
    transform: translateY(0);
}
/* patchNotesBtn removed - version label is now clickable */
/* DEV: Version label (#versionLabel) and tooltip (#versionTooltip) text
        live in index.html. Bump version +0.1 for major, +0.05 for minor.
        Keep tooltip copy to 1–5 words. No style changes needed per release. */

#socialButtons {
    position: absolute;
    bottom: 107px; /* 8px above .my-location-btn top edge (btn bottom:55px + height:44px) */
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 6px;
}
#tiktokBtn,
#youtubeBtn {
    width: 40px;
    height: 40px;
    background: rgba(12,12,12,0.88);
    border: 1.5px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.45);
    transition: background 0.18s, transform 0.15s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#tiktokBtn:hover,
#youtubeBtn:hover { background: rgba(40,40,40,0.96); transform: scale(1.07); }

/* =============================================
   GEOCODING SEARCH RESULTS DROPDOWN
   ============================================= */
.map-search-bar {
    position: relative; /* needed for results dropdown positioning */
}

.map-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(14, 14, 14, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1100;
    max-height: 280px;
    overflow-y: auto;
}

.map-search-results::-webkit-scrollbar {
    width: 4px;
}
.map-search-results::-webkit-scrollbar-track {
    background: transparent;
}
.map-search-results::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
    color: inherit;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover,
.search-result-item:focus {
    background: rgba(212, 175, 55, 0.08);
    outline: none;
}

.search-result-icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.search-result-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-primary {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-secondary {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.38);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.12s;
}
.search-result-item:hover .search-result-arrow {
    color: #D4AF37;
}

.search-result-empty {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.38);
}
.search-result-empty strong {
    color: rgba(255, 255, 255, 0.55);
}

/* =============================================
   RIDEOUTS NEAR YOU BOX (4-corner frame, beside zoom +/-)
   ============================================= */
.rideouts-near-box {
    position: fixed;
    left: 62px;          /* zoom is at left:16 + 36px width + ~10 gap */
    bottom: 20px;        /* aligned with the zoom +/- controls */
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(16,16,16,0.92);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
    pointer-events: none;
    user-select: none;
}
.rn-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.rn-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #36D86B;
    box-shadow: 0 0 0 0 rgba(54,216,107,0.55);
    animation: rnPulse 2s infinite;
    flex-shrink: 0;
}
@keyframes rnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(54,216,107,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(54,216,107,0); }
    100% { box-shadow: 0 0 0 0 rgba(54,216,107,0); }
}
/* four L-shaped corner accents */
.rn-corner {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 2px solid #D4AF37;
    pointer-events: none;
}
.rn-tl { top: -1px;    left: -1px;  border-right: none; border-bottom: none; border-top-left-radius: 9px; }
.rn-tr { top: -1px;    right: -1px; border-left: none;  border-bottom: none; border-top-right-radius: 9px; }
.rn-bl { bottom: -1px; left: -1px;  border-right: none; border-top: none;    border-bottom-left-radius: 9px; }
.rn-br { bottom: -1px; right: -1px; border-left: none;  border-top: none;    border-bottom-right-radius: 9px; }

:root:not([data-theme="dark"]) .rideouts-near-box {
    background: rgba(255,255,255,0.95);
    border-color: rgba(212,175,55,0.25);
}
:root:not([data-theme="dark"]) .rn-text { color: rgba(0,0,0,0.82); }

@media (max-width: 600px) {
    .rideouts-near-box { left: 58px; padding: 8px 11px; }
    .rn-text { font-size: 11px; }
}

.search-result-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-top-color: #D4AF37;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* =============================================
   LIGHT / DARK MODE VARIABLES
   ============================================= */

/* Default = light mode */
:root {
    --bg-map: #e8e0d8;
    --modal-bg: rgba(250, 248, 245, 0.98);
    --modal-border: rgba(0,0,0,0.1);
    --modal-title: #111;
    --modal-subtitle: rgba(0,0,0,0.5);
    --modal-handle: rgba(0,0,0,0.15);
    --btn-bg: rgba(245, 243, 240, 0.97);
    --btn-border: rgba(212,175,55,0.45);
    --btn-text: #111;
    --banner-bg: rgba(245, 243, 240, 0.97);
    --banner-text: #111;
    --banner-sub: rgba(0,0,0,0.5);
    --search-bg: rgba(245, 243, 240, 0.95);
    --search-border: rgba(0,0,0,0.12);
    --search-text: rgba(0,0,0,0.85);
    --search-placeholder: rgba(0,0,0,0.35);
    --search-results-bg: rgba(248, 246, 243, 0.99);
    --result-border: rgba(0,0,0,0.06);
    --result-primary: rgba(0,0,0,0.88);
    --result-secondary: rgba(0,0,0,0.4);
    --policy-bg: rgba(240, 238, 235, 0.93);
    --policy-border: rgba(0,0,0,0.1);
    --policy-text: rgba(0,0,0,0.6);
    --version-bg: rgba(240,238,235,0.85);
    --version-border: rgba(0,0,0,0.12);
    --version-text: rgba(0,0,0,0.5);
    --social-bg: rgba(240,238,235,0.92);
    --social-border: rgba(0,0,0,0.12);
    --social-icon: #111;
    --report-option-bg: #fff;
    --report-option-border: rgba(0,0,0,0.08);
    --report-title-c: #111;
    --report-desc-c: rgba(0,0,0,0.5);
    --activity-bg: rgba(248,246,243,0.98);
    --toast-bg: rgba(245,243,240,0.97);
    --toast-text: #111;
    --upload-card-bg: rgba(250,248,245,0.98);
    --upload-title-c: #111;
    --upload-sub-c: rgba(0,0,0,0.45);
}

[data-theme="dark"] {
    --bg-map: #1a1a1a;
    --modal-bg: rgba(20, 20, 20, 0.97);
    --modal-border: rgba(255,255,255,0.08);
    --modal-title: #fff;
    --modal-subtitle: rgba(255,255,255,0.5);
    --modal-handle: rgba(255,255,255,0.15);
    --btn-bg: rgba(30,30,30,0.95);
    --btn-border: rgba(212,175,55,0.3);
    --btn-text: #fff;
    --banner-bg: rgba(20,20,20,0.95);
    --banner-text: #fff;
    --banner-sub: rgba(255,255,255,0.5);
    --search-bg: rgba(16,16,16,0.92);
    --search-border: rgba(255,255,255,0.12);
    --search-text: rgba(255,255,255,0.88);
    --search-placeholder: rgba(255,255,255,0.3);
    --search-results-bg: rgba(14,14,14,0.98);
    --result-border: rgba(255,255,255,0.05);
    --result-primary: rgba(255,255,255,0.9);
    --result-secondary: rgba(255,255,255,0.38);
    --policy-bg: rgba(26,26,26,0.92);
    --policy-border: rgba(255,255,255,0.12);
    --policy-text: rgba(255,255,255,0.65);
    --version-bg: rgba(10,10,10,0.78);
    --version-border: rgba(255,255,255,0.12);
    --version-text: rgba(255,255,255,0.55);
    --social-bg: rgba(12,12,12,0.88);
    --social-border: rgba(255,255,255,0.14);
    --social-icon: #fff;
    --report-option-bg: rgba(20,20,20,0.97);
    --report-option-border: rgba(255,255,255,0.07);
    --report-title-c: #fff;
    --report-desc-c: rgba(255,255,255,0.5);
    --activity-bg: rgba(18,18,18,0.97);
    --toast-bg: rgba(24,24,24,0.97);
    --toast-text: #fff;
    --upload-card-bg: rgba(18,18,18,0.97);
    --upload-title-c: #fff;
    --upload-sub-c: rgba(255,255,255,0.55);
}

/* Apply variables to existing elements */
.top-banner { background: var(--banner-bg) !important; }
.banner-title { color: var(--banner-text) !important; }
.banner-subtitle { color: var(--banner-sub) !important; }

.modal-content {
    background: var(--modal-bg) !important;
    border-top: 1px solid var(--modal-border) !important;
}
.modal-handle { background: var(--modal-handle) !important; }
.modal-title { color: var(--modal-title) !important; }
.modal-subtitle { color: var(--modal-subtitle) !important; }

.report-option {
    background: var(--report-option-bg) !important;
    border-color: var(--report-option-border) !important;
}
.report-title { color: var(--report-title-c) !important; }
.report-desc { color: var(--report-desc-c) !important; }

.cancel-button, .skip-button {
    color: var(--modal-subtitle) !important;
}

.activity-content { background: var(--activity-bg) !important; }
.activity-title { color: var(--modal-title) !important; }
.activity-item-text { color: var(--modal-title) !important; }
.activity-item-reporter { color: var(--modal-subtitle) !important; }

.map-search-bar {
    background: var(--search-bg) !important;
    border-color: var(--search-border) !important;
}
#mapSearchInput { color: var(--search-text) !important; }
#mapSearchInput::placeholder { color: var(--search-placeholder) !important; }

.map-search-results {
    background: var(--search-results-bg) !important;
    border-color: var(--search-border) !important;
}
.search-result-item { border-color: var(--result-border) !important; }
.search-result-primary { color: var(--result-primary) !important; }
.search-result-secondary { color: var(--result-secondary) !important; }

.policy-btn {
    background: var(--policy-bg) !important;
    border-color: var(--policy-border) !important;
    color: var(--policy-text) !important;
}
#versionLabel {
    background: var(--version-bg) !important;
    border-color: var(--version-border) !important;
    color: var(--version-text) !important;
}
#tiktokBtn, #youtubeBtn {
    background: var(--social-bg) !important;
    border-color: var(--social-border) !important;
}
#tiktokBtn svg path, #youtubeBtn svg path {
    fill: var(--social-icon) !important;
}

.upload-success-card {
    background: var(--upload-card-bg) !important;
}
.upload-card-title { color: var(--upload-title-c) !important; }
.upload-card-sub { color: var(--upload-sub-c) !important; }

/* ── THEME TOGGLE BUTTON (now lives inside .policy-controls) ── */
.theme-toggle-policy {
    background: var(--policy-bg, rgba(26,26,26,0.92));
    border-color: var(--policy-border, rgba(255,255,255,0.12));
    color: var(--policy-text, rgba(255,255,255,0.75));
}
.policy-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
}

/* =============================================
   DESTINATION MODAL
   ============================================= */
.dest-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--modal-border, rgba(0,0,0,0.1));
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
[data-theme="dark"] .dest-search-wrap {
    background: rgba(255,255,255,0.06);
}
#destSearchInput {
    background: none;
    border: none;
    outline: none;
    color: var(--modal-title, #111);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    flex: 1;
}
#destSearchInput::placeholder { color: var(--modal-subtitle, rgba(0,0,0,0.4)); }

.dest-results {
    border: 1px solid var(--modal-border, rgba(0,0,0,0.1));
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.dest-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--modal-border, rgba(0,0,0,0.06));
    color: var(--modal-title, #111);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.dest-result-item:last-child { border-bottom: none; }
.dest-result-item:hover { background: rgba(212,175,55,0.08); }
.dest-loading, .dest-no-results {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--modal-subtitle, rgba(0,0,0,0.45));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dest-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.dest-selected-icon {
    width: 36px;
    height: 36px;
    background: rgba(212,175,55,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dest-selected-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--modal-title, #111);
}
.dest-selected-dist {
    font-size: 12px;
    color: #D4AF37;
    font-weight: 600;
    margin-top: 2px;
}

.dest-map-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--modal-subtitle, rgba(0,0,0,0.4));
    margin-bottom: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dest-confirm-btn {
    border: 1px solid rgba(212,175,55,0.4) !important;
    margin-bottom: 8px;
}

/* Destination display in marker detail card */
.marker-detail-destination {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0;
}
.dest-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dest-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(212,175,55,0.7);
}
.dest-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--modal-title, #fff);
}
.dest-dist {
    font-size: 12px;
    color: #D4AF37;
}

/* =============================================
   MOBILE FIXES (search + social buttons)
   ============================================= */
@media (max-width: 600px) {
    /* Move search bar left so it clears the Support Me / Feedback buttons */
    .map-search-bar {
        left: 10px !important;
        right: auto !important;
        transform: none !important;
        width: calc(100vw - 185px) !important; /* leave 175px for right buttons */
    }

    /* Social buttons slightly higher on mobile */
    #socialButtons {
        bottom: 117px !important;
    }

    #versionRow {
        bottom: 163px !important;
    }

    /* Policy strip on phones — one tidy single line (see the 900px block). The
       descendant selector raises specificity above the base ".footer-hide-mobile
       { display: contents }" rule (which appears later in the file), so the hide
       actually wins on phones. */
    .app-footer-strip { font-size: 9px; gap: 0 5px; padding: 5px 10px; flex-wrap: nowrap; max-width: none; }
    .app-footer-strip .footer-hide-mobile, .app-footer-strip .footer-dns { display: none; }

    /* Smaller policy buttons on mobile */
    .policy-btn {
        padding: 10px 11px 10px 11px !important;
        width: 42px !important;
        border-radius: 8px !important;
    }
    .policy-btn svg {
        width: 15px !important;
        height: 15px !important;
    }

    /* Lower search bar so it clears the "No activity nearby" / rideouts banner.
       PC keeps a ~4–8 px gap below the banner (search top 116, banner bottom ~110).
       The previous mobile value (top: 87px) put the search bar IN the banner. */
    .map-search-bar {
        left: 10px !important;
        right: auto !important;
        transform: none !important;
        width: calc(100vw - 185px) !important;
        top: 120px !important;
    }

    /* Policy controls on mobile: a touch higher for safe area */
    .policy-controls {
        bottom: 108px !important;
    }
}

/* =============================================
   LIGHT MODE OVERRIDES (non-dark theme)
   ============================================= */
:root:not([data-theme="dark"]) .support-btn,
:root:not([data-theme="dark"]) .feedback-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,252,240,0.97) 100%) !important;
    border-color: rgba(212,175,55,0.55) !important;
    color: #D4AF37 !important;
    box-shadow: 0 2px 12px rgba(212,175,55,0.15) !important;
}
:root:not([data-theme="dark"]) .support-btn span,
:root:not([data-theme="dark"]) .feedback-btn span {
    color: #D4AF37 !important;
}
:root:not([data-theme="dark"]) .my-location-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,252,240,0.97) 100%) !important;
    border-color: rgba(212,175,55,0.5) !important;
    color: #333 !important;
    box-shadow: 0 2px 12px rgba(212,175,55,0.15) !important;
}
:root:not([data-theme="dark"]) .leaflet-control-zoom a {
    background: rgba(255,255,255,0.97) !important;
    color: #D4AF37 !important;
    border: 1px solid rgba(212,175,55,0.4) !important;
}
:root:not([data-theme="dark"]) .leaflet-control-zoom a:hover {
    background: rgba(255,252,235,0.98) !important;
    color: #b8960e !important;
}
:root:not([data-theme="dark"]) .top-banner {
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,252,230,0.95) 100%) !important;
    border: 1px solid rgba(212,175,55,0.2) !important;
}
:root:not([data-theme="dark"]) .banner-rideouts {
    color: rgba(0,0,0,0.68) !important;
}
:root:not([data-theme="dark"]) .policy-btn {
    background: rgba(255,255,255,0.94) !important;
    border-color: rgba(212,175,55,0.25) !important;
    color: rgba(0,0,0,0.6) !important;
}
:root:not([data-theme="dark"]) .policy-btn:hover {
    background: rgba(255,252,235,0.98) !important;
    border-color: rgba(212,175,55,0.5) !important;
    color: #b8960e !important;
}

/* =============================================
   DESTINATION PICK-ON-MAP BUTTON
   ============================================= */
.dest-map-pick-btn {
    border: 1.5px dashed rgba(212,175,55,0.55) !important;
    margin-top: 4px;
}
.dest-pick-icon {
    background: rgba(212,175,55,0.15) !important;
    border: 1.5px dashed rgba(212,175,55,0.55);
}

/* Theme toggle policy btn icon slot */
.policy-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 17px;
    height: 17px;
}

/* ─────────────────────────────────────────
   TIME MODAL STYLES
───────────────────────────────────────── */
.time-name-section,
.time-field-section {
    margin-bottom: 18px;
}

.time-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.name-limit-note {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.rideout-name-input {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.rideout-name-input:focus {
    border-color: #D4AF37;
}

.rideout-name-input::placeholder {
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.1em;
    font-weight: 400;
}

/* Left-aligned "Initials" pill — small, clean, doesn't span the modal width.
   Sits underneath the END TIME row on the same side as the hour/minute boxes,
   so the time controls and the initials picker read as a single left column. */
.initials-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 14px 0 18px;
    padding-left: 0;
}
.initials-pill {
    width: 170px;
    max-width: 70%;
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 12px 18px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.initials-pill:focus {
    border-color: #D4AF37;
    background: rgba(0, 0, 0, 0.72);
}
.initials-pill::placeholder {
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    font-weight: 500;
    text-transform: none;
}
.initials-pill-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
}
:root:not([data-theme="dark"]) .initials-pill {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.6) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .initials-pill:focus {
    border-color: #b8960e !important;
    background: rgba(0, 0, 0, 0.1) !important;
}
:root:not([data-theme="dark"]) .initials-pill::placeholder { color: rgba(0, 0, 0, 0.45) !important; }
:root:not([data-theme="dark"]) .initials-pill-note { color: rgba(0, 0, 0, 0.5) !important; }

.time-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-num-input {
    width: 56px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 11px 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.time-num-input::-webkit-outer-spin-button,
.time-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* "What date" dropdown in the rideout time modal — matches the time inputs. */
.rideout-date-select {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 12px 36px 12px 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.rideout-date-select:focus { border-color: rgba(212,175,55,0.6); }
.rideout-date-select option { background: #1a1a1a; color: #fff; }
:root:not([data-theme="dark"]) .rideout-date-select {
    background-color: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.15);
    color: #1a1a1a;
}
:root:not([data-theme="dark"]) .rideout-date-select option { background: #fff; color: #1a1a1a; }

.time-num-input:focus {
    border-color: #D4AF37;
}

.time-num-input::placeholder {
    color: rgba(255,255,255,0.25);
    font-size: 15px;
}

.time-colon-sep {
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.ampm-toggle-group {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.12);
    margin-left: 4px;
}

.ampm-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}

.ampm-btn.active {
    background: #D4AF37;
    color: #000;
}

.ampm-btn:not(.active):hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
}

/* Marker detail time display */
.marker-detail-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 10px;
    margin: 10px 0;
    font-size: 14px;
    color: #D4AF37;
    font-weight: 600;
}

/* First-claimer name gold style (map) */
.first-claimer-name {
    color: #D4AF37 !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(212,175,55,0.35);
}

/* First-claimer popup (map) */
.first-claimer-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
}

.first-claimer-popup.hidden {
    display: none;
}

.first-claimer-inner {
    background: #111;
    border: 1.5px solid rgba(212,175,55,0.35);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.first-claimer-crown {
    font-size: 36px;
    margin-bottom: 10px;
}

.first-claimer-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
}

.first-claimer-name {
    font-size: 34px;
    font-weight: 900;
    color: #D4AF37;
    letter-spacing: 0.18em;
    margin-bottom: 10px;
    text-shadow: 0 0 16px rgba(212,175,55,0.4);
}

.first-claimer-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    margin-bottom: 22px;
}

.first-claimer-close {
    background: #D4AF37;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

/* ─────────────────────────────────────────
   BLOCKED USERNAME CARD
───────────────────────────────────────── */
.blocked-name-card {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    /* Must outrank every modal/panel so the user can actually see the
       message — friends-panel is 9600, friends-card stack is 9750, toast
       container is 10000. The blocked-name card is critical UX feedback
       (you typed a slur in the username field), so it sits on top of all
       of them at 10500. */
    z-index: 10500;
    width: calc(100% - 32px);
    max-width: 420px;
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.blocked-name-card.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.blocked-name-card.hidden {
    display: none;
}

.blocked-name-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: #1a0a0a;
    border: 1.5px solid rgba(239,68,68,0.4);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(239,68,68,0.1);
}

.blocked-name-card-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.blocked-name-card-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.blocked-name-card-text {
    flex: 1;
    min-width: 0;
}

.blocked-name-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #EF4444;
    margin-bottom: 3px;
    letter-spacing: 0.01em;
}

.blocked-name-card-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    line-height: 1.45;
}

.blocked-name-display {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.blocked-name-card-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s;
}

.blocked-name-card-close:hover {
    color: rgba(255,255,255,0.6);
}

/* Feedback board blocked name warning toast override */
.blocked-name-warning {
    border-left: 3px solid #EF4444 !important;
    background: #1a0a0a !important;
}

/* ============================================
   MULTIPLAYER
   ============================================ */
@keyframes mpPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }

/* Toggle button in the rideout question modals — black icon on white, top-right */
.mp-toggle-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform .15s, box-shadow .15s;
    z-index: 5;
}
.mp-toggle-btn:hover { transform: translateY(-1px); }
.mp-toggle-btn.active {
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.9), 0 2px 10px rgba(0, 0, 0, 0.35);
}
.mp-toggle-btn.active::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4CAF50;
    border: 2px solid #fff;
}
.mp-toggle-btn.edit-mode {
    width: auto;
    min-width: 104px;
    height: 42px;
    border-radius: 14px;
    padding: 0 13px;
    gap: 8px;
}
.mp-toggle-btn.edit-mode .mp-toggle-label {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #000;
    font-size: 12px;
}
.mp-toggle-btn.edit-mode:hover .mp-toggle-label {
    transform: none;
}
/* Hover label — a dark gold-bordered pill to the LEFT of the icon (won't overlap the title) */
.mp-toggle-label {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.97) 0%, rgba(30, 28, 20, 0.97) 100%);
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: #D4AF37;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.mp-toggle-btn:hover .mp-toggle-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Share + Join popups */
.mp-popup {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
/* Popups that can open FROM INSIDE the friends panel need to sit above it.
   friends-panel is z-index 9600; these need to outrank it. */
#confirmDialog,
#reportFriendModal,
#markerMessagesModal {
    z-index: 9750;
}
.mp-popup.hidden { display: none; }
.mp-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.mp-popup-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 26px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    animation: mpPop .2s ease-out;
}
.mp-popup-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.mp-popup-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.mp-popup-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 18px;
}
.mp-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.mp-link-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 11px 12px;
    color: #fff;
    font-size: 0.85rem;
}
.mp-link-copy {
    flex-shrink: 0;
    background: #D4AF37;
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
}
.mp-popup-primary {
    width: 100%;
    background: linear-gradient(135deg, rgba(20, 20, 22, 0.95) 0%, rgba(30, 28, 20, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #D4AF37;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    margin-bottom: 8px;
}
.mp-popup-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(30, 30, 32, 0.98) 0%, rgba(40, 36, 24, 0.98) 100%);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}
.mp-popup-secondary {
    width: 100%;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 10px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Banner "Multiplayer rideout active" badge */
.banner-mp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: #4CAF50;
    font-size: 11px;
    font-weight: 700;
}
.banner-mp-badge.hidden { display: none; }

/* Activity-list multiplayer tag */
.activity-mp-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: #4CAF50;
    font-size: 11px;
    font-weight: 600;
}

/* "Multiplayer rideout" badge inside the marker-detail popup */
.marker-detail-mp-wrap {
    text-align: center;
    margin-top: 12px;
}
.marker-detail-mp {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #D4AF37;
    font-size: 13px;
    font-weight: 700;
}

/* Flash when the multiplayer button is tapped: a yellow outline with a bright line
   tracing around it, then fading. Lives entirely on ::after so it neither replays the
   modal's slide-in animation nor gets clipped by the box's overflow. */
@property --mp-trace-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.modal-content.mp-flash::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px 24px 0 0;
    padding: 2.5px;
    background: conic-gradient(from var(--mp-trace-angle),
        rgba(244, 196, 48, 0.4) 0deg,    /* faint outline all the way around */
        rgba(244, 196, 48, 0.4) 250deg,
        #FFE08A 315deg,                   /* bright arc that travels around */
        #F4C430 345deg,
        rgba(244, 196, 48, 0.4) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: 6;
    animation: mpTraceSpin 1.2s linear 2, mpTraceFade 2.4s ease-out forwards;
}
@keyframes mpTraceSpin { to { --mp-trace-angle: 360deg; } }
@keyframes mpTraceFade { 0% { opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* 12h / 24h (military) format toggle inside the "What time?" modal */
.time-format-toggle {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    margin: 8px auto 14px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    width: fit-content;
}
.time-format-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    letter-spacing: 0.02em;
}
.time-format-btn:hover:not(.active) { color: #fff; }
.time-format-btn.active {
    background: rgba(244, 196, 48, 0.18);
    color: #F4C430;
}

/* ============================================
   FRIENDS — list, panel, popover, settings, map dot
   ============================================ */

/* The 3-letter @handle shown under a rideout marker's title */
.marker-detail-initials {
    display: inline-block;
    margin: 4px auto 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.16);
    color: #D4AF37;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.marker-detail-source {
    text-align: center;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}
:root:not([data-theme="dark"]) .marker-detail-source { color: rgba(0, 0, 0, 0.4); }

/* Wrapper that pins the Friends + Settings pair to the bottom-left of the map.
   The buttons inside flow with flexbox so the Settings cog always hugs the
   right edge of the Friends pill, regardless of badge width. */
.friends-fab-wrap {
    position: fixed;
    left: 62px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}
.friends-fab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(20,20,22,0.96) 0%, rgba(30,28,20,0.96) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #D4AF37;
    border-radius: 999px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.friends-fab > span {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
}
.friends-fab:hover {
    transform: translateY(-1px);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212,175,55,0.25);
}
/* Settings cog — flex sibling of the Friends FAB inside .friends-fab-wrap. */
.settings-fab {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20,20,22,0.96) 0%, rgba(30,28,20,0.96) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #D4AF37;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.settings-fab:hover {
    transform: translateY(-1px);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212,175,55,0.25);
}
:root:not([data-theme="dark"]) .settings-fab {
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,252,240,0.97) 100%) !important;
    border-color: rgba(212,175,55,0.55) !important;
    color: #D4AF37 !important;
    box-shadow: 0 2px 12px rgba(212,175,55,0.18) !important;
}

.friends-fab-badge {
    background: #EF4444;
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    text-align: center;
}
.friends-fab-badge.hidden { display: none; }

/* Panel (used for both the Friends list and the visibility settings) */
.friends-panel {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.friends-panel.hidden { display: none; }
.friends-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.friends-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    background: rgba(25, 25, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 18px 18px 20px;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    animation: mpPop .2s ease-out;
}
.friends-card-small { max-width: 340px; }

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.friends-title {
    color: #D4AF37;
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0;
}
.friends-header-actions { display: flex; gap: 6px; }
.friends-icon-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.friends-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.friends-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.friends-search-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
}
.friends-search-input:focus { outline: none; border-color: rgba(212,175,55,0.5); }

/* Search-as-you-type dropdown — appears below the search row when results exist */
.friends-search-dropdown {
    margin-top: 6px;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
}
.friends-search-dropdown.hidden { display: none; }
.friends-search-result {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.friends-search-result:last-child { border-bottom: none; }
.friends-search-result:hover:not(:disabled) { background: rgba(212, 175, 55, 0.1); }
.friends-search-result:disabled { opacity: 0.45; cursor: not-allowed; }
.friends-search-empty {
    padding: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
}
:root:not([data-theme="dark"]) .friends-search-dropdown {
    background: rgba(255, 255, 255, 0.99) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
:root:not([data-theme="dark"]) .friends-search-result {
    color: #111 !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}
:root:not([data-theme="dark"]) .friends-search-result:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.12) !important;
}
:root:not([data-theme="dark"]) .friends-search-empty { color: rgba(0, 0, 0, 0.5) !important; }
.friends-search-btn {
    flex-shrink: 0;
    background: #D4AF37;
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.friends-search-btn:hover { background: #F4C430; }

.friends-section { margin-top: 14px; }
.friends-section-title {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    color: #D4AF37;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-transform: none;
    margin-bottom: 8px;
    padding: 0 2px;
}
.friends-section.hidden { display: none; }
.friends-list { display: flex; flex-direction: column; gap: 8px; }
.friends-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
    padding: 14px 8px;
}
.friends-empty.hidden { display: none; }
.friends-loading {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
    padding: 14px 8px;
}

/* Each friend / request row */
.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.friend-item-req {
    border-color: rgba(212, 175, 55, 0.55);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12) inset;
}
.friend-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.friend-name {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.friend-action-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s, color .12s;
    flex-shrink: 0;
    padding: 0;
}
.friend-action-btn:hover { background: rgba(212,175,55,0.2); color: #D4AF37; }

/* Online/offline pill on each friend row. Sits between the name and the
   action buttons, color-coded green/red. */
.friend-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.friend-status-pill .friend-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
}
.friend-status-pill.online {
    border-color: rgba(54, 216, 107, 0.45);
    color: #36D86B;
    background: rgba(54, 216, 107, 0.08);
}
.friend-status-pill.online .friend-status-dot {
    background: #36D86B;
    box-shadow: 0 0 6px rgba(54, 216, 107, 0.7);
}
.friend-status-pill.offline {
    border-color: rgba(239, 68, 68, 0.4);
    color: #EF4444;
    background: rgba(239, 68, 68, 0.06);
}
.friend-status-pill.offline .friend-status-dot { background: #EF4444; }
/* On narrow screens, only show the dot to save horizontal space */
@media (max-width: 420px) {
    .friend-status-pill .friend-status-label { display: none; }
    .friend-status-pill { padding: 4px; }
}
:root:not([data-theme="dark"]) .friend-status-pill {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
:root:not([data-theme="dark"]) .friend-status-pill.online {
    background: rgba(54, 216, 107, 0.1) !important;
    border-color: rgba(54, 216, 107, 0.5) !important;
}
:root:not([data-theme="dark"]) .friend-status-pill.offline {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Offline banner — persistent thin strip at the top showing network state.
   Auto-toggles based on navigator.onLine. */
.offline-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(195, 51, 51, 0.95));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    pointer-events: none;
}
.offline-banner.hidden { display: none; }
.friend-action-accept {
    width: auto;
    height: 30px;
    padding: 0 14px;
    background: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}
.friend-action-accept:hover {
    background: linear-gradient(135deg, #F4C430 0%, #D4AF37 100%);
    color: #1a1a1a;
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
}
.friend-action-decline {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #EF4444;
    font-weight: 700;
}
.friend-action-decline:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
}

/* Kebab popover anchored above a friend's "more" button */
.friend-popover {
    position: fixed;
    z-index: 9700;
    min-width: 200px;
    background: linear-gradient(180deg, rgba(28, 28, 28, 0.99), rgba(20, 20, 20, 0.99));
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.06) inset;
    animation: mpPop .15s ease-out;
}
.friend-popover.hidden { display: none; }
.friend-popover-item {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.friend-popover-item:hover { background: rgba(255, 255, 255, 0.08); }
.friend-popover-item.danger { color: #EF4444; }
.friend-popover-item.danger:hover { background: rgba(239,68,68,0.12); }

/* Settings sheet */
.friends-settings-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    margin: 4px 0 12px;
}
.friends-settings-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.friends-settings-option {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background .12s, border-color .12s, color .12s;
}
.friends-settings-option:hover { background: rgba(255, 255, 255, 0.08); }
.friends-settings-option.active {
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.55);
    color: #D4AF37;
}
.friends-settings-status {
    margin-top: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 600;
}

/* Friend dot on the map — yellow ring with a smaller yellow dot inside */
.friend-leaflet-icon { background: none !important; border: none !important; }
.friend-ring {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid #F4C430;
    background: rgba(244, 196, 48, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 10px rgba(244,196,48,0.55);
}
.friend-ring-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #F4C430;
}

/* RideLink-skinned Leaflet tooltip — used for the friend pin label.
   Default Leaflet tooltip is a white pill with black text; we re-skin
   it to match the rest of the app (dark glass + gold accents). */
.leaflet-tooltip.friend-tooltip {
    background: rgba(85, 85, 85, 0.95);            /* solid grey fill */
    color: #fff;
    border: 2px solid #D4AF37;                     /* bold yellow outline */
    border-radius: 999px;
    padding: 5px 12px;
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.leaflet-tooltip.friend-tooltip::before { display: none; } /* hide arrow chevron */
.leaflet-tooltip.friend-tooltip .ft-name { color: inherit; }
.leaflet-tooltip.friend-tooltip .ft-sep {
    margin: 0 6px;
    color: rgba(255, 255, 255, 0.45);
}
.leaflet-tooltip.friend-tooltip .ft-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 5px;
    box-shadow: 0 0 6px currentColor;
}
.leaflet-tooltip.friend-tooltip .ft-status {
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
}
:root:not([data-theme="dark"]) .leaflet-tooltip.friend-tooltip .ft-sep {
    color: rgba(0, 0, 0, 0.45);
}
:root:not([data-theme="dark"]) .leaflet-tooltip.friend-tooltip {
    background: rgba(180, 180, 180, 0.96);          /* lighter grey on light theme */
    color: #1a1a1a;                                  /* dark text for contrast */
    border-color: #D4AF37;
}

/* FRIEND DIRECT CHAT styles removed — see app.js bottom for preserved JS
   stub. Bring this CSS back from git history when the chat is restored. */

/* Phones: Friends + Settings are big, round, icon-only FABs. Hiding the "Friends"
   text keeps the bottom-left controls narrow enough that the footer strip (now at
   most RideLink · Privacy · Do Not Sell) can't reach the settings cog. The request
   badge is an overlay so it never widens the button. */
@media (max-width: 600px) {
    .friends-fab-wrap { left: 58px; bottom: 20px; gap: 8px; }
    .friends-fab {
        width: 46px;
        height: 46px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        position: relative;
    }
    .friends-fab > span:not(.friends-fab-badge) { display: none; }
    .friends-fab svg { width: 24px; height: 24px; }
    .settings-fab { width: 46px; height: 46px; }
    .settings-fab svg { width: 24px; height: 24px; }
    .friends-fab-badge {
        position: absolute;
        top: -3px;
        right: -3px;
        min-width: 16px;
        padding: 0 4px;
        font-size: 10px;
        line-height: 16px;
    }
}

/* ============================================
   Question progress (1/3 → 3/3 on rideout modals)
   ============================================ */
.question-progress {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ============================================
   Destination — pick on map
   ============================================ */
.dest-pickmap-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(20,20,22,0.95) 0%, rgba(30,28,20,0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #D4AF37;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin: 10px 0 4px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.dest-pickmap-btn:hover {
    transform: translateY(-1px);
    border-color: #D4AF37;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.dest-pick-banner {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(20, 20, 22, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 999px;
    color: #D4AF37;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    pointer-events: auto;
}
.dest-pick-banner.hidden { display: none; }
.dest-pick-banner-cancel {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    margin-left: 6px;
}
.dest-pick-banner-cancel:hover { background: rgba(255,255,255,0.18); }

/* ============================================
   MESSAGES — inside the marker detail
   ============================================ */
.marker-message-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Messages modal (opened from the Messages button in the marker detail) */
.marker-messages-card {
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
}
.marker-messages-card .marker-message-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.marker-messages-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 14px;
}
.msg-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* compose side */
.msg-bubble-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.msg-bubble {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #F4C430;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, transform .12s;
}
.msg-bubble:hover { background: rgba(212, 175, 55, 0.22); }
.msg-bubble:active { transform: scale(0.97); }
.msg-bubble-sent {
    background: rgba(76, 175, 80, 0.18) !important;
    border-color: rgba(76, 175, 80, 0.55) !important;
    color: #4CAF50 !important;
    cursor: default;
}
.msg-composer {
    display: flex;
    gap: 8px;
}
.msg-compose-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
}
.msg-compose-input:focus { outline: none; border-color: rgba(212,175,55,0.5); }
.msg-send-btn {
    flex-shrink: 0;
    background: #D4AF37;
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.msg-send-btn:hover { background: #F4C430; }

/* receive side */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 9px 12px;
    text-align: left;
}
.msg-meta {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
}
.msg-body {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}
.msg-empty {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    text-align: center;
    padding: 10px 6px;
}

/* Threaded marker messages — host inbox groups by sender; stranger sees
   their conversation with the host. Bubbles align by ownership. */
.msg-threads {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 320px;
    overflow-y: auto;
}
.msg-thread {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msg-thread-header {
    color: #D4AF37;
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.01em;
}
.msg-thread-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.msg-row.msg-mine {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
    border-color: rgba(212, 175, 55, 0.4);
    align-self: flex-end;
    max-width: 88%;
    border-bottom-right-radius: 4px;
}
.msg-row.msg-theirs {
    background: rgba(255, 255, 255, 0.06);
    align-self: flex-start;
    max-width: 88%;
    border-bottom-left-radius: 4px;
}
.msg-thread-reply { margin-top: 4px; }
.msg-row .msg-meta { letter-spacing: 0.02em; }

/* Hide the thread container entirely when there are no messages so the
   stranger doesn't see a big empty placeholder box. */
.msg-thread.msg-thread-hidden { display: none; }

/* Small inline note below the composer when messaging a non-friend.
   Replaces the wordy subtitle banner that used to be at the top. */
.msg-filter-note {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    letter-spacing: 0.02em;
}
:root:not([data-theme="dark"]) .msg-filter-note { color: rgba(0, 0, 0, 0.5) !important; }

:root:not([data-theme="dark"]) .msg-thread {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
:root:not([data-theme="dark"]) .msg-thread-header { color: #b8960e !important; }
:root:not([data-theme="dark"]) .msg-row.msg-theirs {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* =====================================================
   LIGHT MODE — Friends panel, messages, modals, etc.
   ===================================================== */

/* Friends FAB */
:root:not([data-theme="dark"]) .friends-fab {
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,252,240,0.97) 100%) !important;
    border: 1px solid rgba(212,175,55,0.55) !important;
    color: #D4AF37 !important;
    box-shadow: 0 2px 12px rgba(212,175,55,0.18) !important;
}
:root:not([data-theme="dark"]) .friends-fab > span { color: #D4AF37 !important; }
:root:not([data-theme="dark"]) .friends-fab:hover {
    background: rgba(255,252,235,0.98) !important;
    border-color: rgba(212,175,55,0.75) !important;
}
:root:not([data-theme="dark"]) .friends-fab-badge {
    background: #D4AF37 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

/* Friends panel + card */
:root:not([data-theme="dark"]) .friends-backdrop {
    background: rgba(0,0,0,0.35) !important;
}
:root:not([data-theme="dark"]) .friends-card {
    background: rgba(255,255,255,0.99) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25) !important;
}
:root:not([data-theme="dark"]) .friends-title { color: #D4AF37 !important; }
:root:not([data-theme="dark"]) .friends-icon-btn {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: rgba(0,0,0,0.65) !important;
}
:root:not([data-theme="dark"]) .friends-icon-btn:hover {
    background: rgba(0,0,0,0.08) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .friends-search-input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .friends-search-input::placeholder { color: rgba(0,0,0,0.4) !important; }
:root:not([data-theme="dark"]) .friends-search-input:focus { border-color: rgba(212,175,55,0.6) !important; }
:root:not([data-theme="dark"]) .friends-search-btn { color: #1a1a1a !important; }
:root:not([data-theme="dark"]) .friends-section-title { color: rgba(0,0,0,0.55) !important; }
:root:not([data-theme="dark"]) .friends-empty,
:root:not([data-theme="dark"]) .friends-loading { color: rgba(0,0,0,0.5) !important; }

/* Friend rows */
:root:not([data-theme="dark"]) .friend-item {
    background: rgba(0,0,0,0.03) !important;
    border-color: rgba(0,0,0,0.08) !important;
}
:root:not([data-theme="dark"]) .friend-item-req { border-color: rgba(212,175,55,0.45) !important; }
:root:not([data-theme="dark"]) .friend-name { color: #111 !important; }
:root:not([data-theme="dark"]) .friend-action-btn {
    background: rgba(212,175,55,0.12) !important;
    border-color: rgba(212,175,55,0.4) !important;
    color: #b8960e !important;
}
:root:not([data-theme="dark"]) .friend-action-btn:hover {
    background: rgba(212,175,55,0.25) !important;
    color: #8d7409 !important;
}
:root:not([data-theme="dark"]) .friend-action-accept {
    color: #1a1a1a !important;
    border-color: rgba(212, 175, 55, 0.6) !important;
}
:root:not([data-theme="dark"]) .friend-action-decline {
    background: rgba(239,68,68,0.1) !important;
    border-color: rgba(239,68,68,0.4) !important;
    color: #c33 !important;
}

/* Friend kebab popover */
:root:not([data-theme="dark"]) .friend-popover {
    background: rgba(255,255,255,0.99) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.22) !important;
}
:root:not([data-theme="dark"]) .friend-popover-item { color: rgba(0,0,0,0.8) !important; }
:root:not([data-theme="dark"]) .friend-popover-item:hover { background: rgba(0,0,0,0.05) !important; }
:root:not([data-theme="dark"]) .friend-popover-item.danger { color: #c33 !important; }
:root:not([data-theme="dark"]) .friend-popover-item.danger:hover { background: rgba(239,68,68,0.1) !important; }

/* Friend settings options */
:root:not([data-theme="dark"]) .friends-settings-desc { color: rgba(0,0,0,0.6) !important; }
:root:not([data-theme="dark"]) .friends-settings-option {
    background: rgba(0,0,0,0.03) !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: rgba(0,0,0,0.78) !important;
}
:root:not([data-theme="dark"]) .friends-settings-option:hover { background: rgba(0,0,0,0.06) !important; }
:root:not([data-theme="dark"]) .friends-settings-option.active {
    background: rgba(212,175,55,0.15) !important;
    border-color: rgba(212,175,55,0.55) !important;
    color: #b8960e !important;
}
:root:not([data-theme="dark"]) .friends-settings-status { color: rgba(0,0,0,0.55) !important; }

/* Generic mp-popup cards (multiplayer share/join + messages modal use this) */
:root:not([data-theme="dark"]) .mp-popup-backdrop { background: rgba(0,0,0,0.35) !important; }
:root:not([data-theme="dark"]) .mp-popup-card {
    background: rgba(255,255,255,0.99) !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: #111 !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25) !important;
}
:root:not([data-theme="dark"]) .mp-popup-title { color: #111 !important; }
:root:not([data-theme="dark"]) .mp-popup-text { color: rgba(0,0,0,0.7) !important; }

/* Messages modal */
:root:not([data-theme="dark"]) .marker-messages-subtitle { color: rgba(0,0,0,0.62) !important; }
:root:not([data-theme="dark"]) .msg-section-title { color: rgba(0,0,0,0.55) !important; }
:root:not([data-theme="dark"]) .msg-bubble {
    background: rgba(212,175,55,0.14) !important;
    border-color: rgba(212,175,55,0.5) !important;
    color: #b8960e !important;
}
:root:not([data-theme="dark"]) .msg-bubble:hover { background: rgba(212,175,55,0.25) !important; }
:root:not([data-theme="dark"]) .msg-compose-input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .msg-compose-input::placeholder { color: rgba(0,0,0,0.4) !important; }
:root:not([data-theme="dark"]) .msg-send-btn { color: #1a1a1a !important; }
:root:not([data-theme="dark"]) .msg-row {
    background: rgba(0,0,0,0.03) !important;
    border-color: rgba(0,0,0,0.08) !important;
}
:root:not([data-theme="dark"]) .msg-meta { color: rgba(0,0,0,0.5) !important; }
:root:not([data-theme="dark"]) .msg-body { color: #111 !important; }
:root:not([data-theme="dark"]) .msg-empty { color: rgba(0,0,0,0.5) !important; }

/* Back buttons in question modals */
:root:not([data-theme="dark"]) .back-button {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: rgba(0,0,0,0.7) !important;
}
:root:not([data-theme="dark"]) .back-button:hover {
    background: rgba(0,0,0,0.08) !important;
    color: #111 !important;
    border-color: rgba(0,0,0,0.2) !important;
}

/* Blocked-name toast card */
:root:not([data-theme="dark"]) .blocked-name-card-inner {
    background: rgba(255,255,255,0.99) !important;
    border-color: rgba(239,68,68,0.35) !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.22) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .blocked-name-card-title { color: #111 !important; }
:root:not([data-theme="dark"]) .blocked-name-card-sub { color: rgba(0,0,0,0.65) !important; }
:root:not([data-theme="dark"]) .blocked-name-card-close { color: rgba(0,0,0,0.45) !important; }
:root:not([data-theme="dark"]) .blocked-name-card-close:hover { color: #111 !important; }
:root:not([data-theme="dark"]) .blocked-name-display { color: #c33 !important; }

/* Settings section titles (sub-headers under "Settings" card) */
.friends-settings-section-title {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    letter-spacing: 0;
    color: #D4AF37;
    font-size: 17px;
    margin: 18px 0 6px;
}
.friends-settings-section-title:first-of-type { margin-top: 4px; }
:root:not([data-theme="dark"]) .friends-settings-section-title { color: #D4AF37 !important; }

/* "Private rideout" callout in marker detail */
.marker-private-note {
    background: rgba(212, 175, 55, 0.10);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78);
    margin: 8px 0 12px;
}
.marker-private-note strong { color: #D4AF37; }
:root:not([data-theme="dark"]) .marker-private-note {
    background: rgba(212, 175, 55, 0.12) !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
    color: rgba(0,0,0,0.72) !important;
}

/* =====================================================
   LIGHT MODE — text contrast fixes across the app.
   Many components hardcode white text; on the light cream
   modal background that means the user sees nothing. These
   overrides only apply when data-theme is not "dark".
   ===================================================== */

/* Marker detail card text */
:root:not([data-theme="dark"]) .marker-detail-title { color: #111 !important; }
:root:not([data-theme="dark"]) .marker-detail-desc { color: rgba(0,0,0,0.72) !important; }
:root:not([data-theme="dark"]) .marker-detail-reporter-label { color: rgba(0,0,0,0.5) !important; }

/* Question 1/3, 2/3, 3/3 progress counter */
:root:not([data-theme="dark"]) .question-progress { color: rgba(0,0,0,0.55) !important; }

/* Modal misc text */
:root:not([data-theme="dark"]) .modal-handle { background: rgba(0,0,0,0.18) !important; }
:root:not([data-theme="dark"]) .cancel-button,
:root:not([data-theme="dark"]) .skip-button { color: rgba(0,0,0,0.6) !important; }

/* Rider count cards: tint background slightly so the text reads. The cards
   themselves are colored pastels in the screenshot so we only nudge contrast. */
:root:not([data-theme="dark"]) .rider-count-card { color: #fff !important; }

/* Destination modal — search input + hint + selected display */
:root:not([data-theme="dark"]) .dest-search-wrap input,
:root:not([data-theme="dark"]) #destSearchInput { color: #111 !important; }
:root:not([data-theme="dark"]) #destSearchInput::placeholder { color: rgba(0,0,0,0.4) !important; }
:root:not([data-theme="dark"]) .dest-search-wrap svg circle,
:root:not([data-theme="dark"]) .dest-search-wrap svg path { stroke: rgba(0,0,0,0.45) !important; }
:root:not([data-theme="dark"]) .dest-map-hint { color: rgba(0,0,0,0.55) !important; }
:root:not([data-theme="dark"]) .dest-map-hint svg circle,
:root:not([data-theme="dark"]) .dest-map-hint svg path { stroke: rgba(0,0,0,0.45) !important; }
:root:not([data-theme="dark"]) .dest-selected-name { color: #111 !important; }
:root:not([data-theme="dark"]) .dest-selected-dist { color: rgba(0,0,0,0.55) !important; }

/* Time modal inputs */
:root:not([data-theme="dark"]) .time-num-input,
:root:not([data-theme="dark"]) .rideout-name-input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .time-num-input::placeholder,
:root:not([data-theme="dark"]) .rideout-name-input::placeholder { color: rgba(0,0,0,0.35) !important; }
:root:not([data-theme="dark"]) .time-field-label { color: rgba(0,0,0,0.55) !important; }
:root:not([data-theme="dark"]) .name-limit-note { color: rgba(0,0,0,0.4) !important; }

/* Multiplayer share/join popup text inside .mp-popup-card */
:root:not([data-theme="dark"]) .mp-popup-card,
:root:not([data-theme="dark"]) .mp-popup-text,
:root:not([data-theme="dark"]) .mp-popup-title { color: #111 !important; }

/* Top-right "Pick a spot on the map" banner stays dark by design — it overlays
   the map and needs contrast against light tiles. */

/* Detail-button-grid still has dark background so its white text is fine.
   Only override if you switch to a light card style — left as-is. */

/* Marker detail "Currently Active / Uploaded at / Expires in" pill */
:root:not([data-theme="dark"]) .marker-detail-upload-time::before,
:root:not([data-theme="dark"]) .marker-detail-expires-in::before { background: rgba(0,0,0,0.35) !important; }

/* Reported-by chip */
:root:not([data-theme="dark"]) .marker-detail-reporter-name { color: #b8960e !important; }

/* Section labels under the destination/time inputs */
:root:not([data-theme="dark"]) .dest-selected { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.08) !important; }

/* =====================================================
   App footer strip — compact pill that sits directly below the
   My Location button, right-aligned. It lives inside the existing
   bottom-right column (version → social → My Location → footer)
   instead of being a full-width bar. Other bottom UI keeps its
   original position; we just slot in below My Location.
   ===================================================== */
.app-footer-strip {
    position: fixed;
    right: 11px;
    bottom: 25px;
    z-index: 1100;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    max-width: calc(100vw - 32px);
    text-align: right;
    pointer-events: auto;
}
.app-footer-strip a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}
.app-footer-strip a:hover { color: #D4AF37; }
.app-footer-strip a.footer-not-clickable {
    color: rgba(255, 255, 255, 0.32);
    cursor: not-allowed;
    pointer-events: none;
}
.app-footer-strip a.app-footer-brand { color: #D4AF37; white-space: nowrap; letter-spacing: 0.02em; }
.app-footer-dot { color: rgba(255, 255, 255, 0.35); }
/* Wrappers group a separator-dot with its link so secondary links can be dropped
   on phones without leaving a dangling "·". Transparent on desktop (display:contents
   = the dot + link flow as normal flex items). */
.footer-hide-mobile, .footer-dns { display: contents; }

:root:not([data-theme="dark"]) .app-footer-strip {
    background: rgba(248, 246, 240, 0.94) !important;
    border-color: rgba(212, 175, 55, 0.32) !important;
    color: rgba(0, 0, 0, 0.7) !important;
}
:root:not([data-theme="dark"]) .app-footer-strip a {
    color: rgba(0, 0, 0, 0.85) !important;
}
:root:not([data-theme="dark"]) .app-footer-strip a:hover { color: #b8960e !important; }
:root:not([data-theme="dark"]) .app-footer-strip a.footer-not-clickable {
    color: rgba(0, 0, 0, 0.28) !important;
}
:root:not([data-theme="dark"]) .app-footer-brand { color: #b8960e !important; }
:root:not([data-theme="dark"]) .app-footer-dot { color: rgba(0, 0, 0, 0.32) !important; }

@media (max-width: 900px) {
    /* Tablet/phone: one tidy single line like desktop (no 2-line wrap that overlapped
       the My Location button). Tablets keep all links; phones drop the secondary ones
       (see the 600px block) because the bottom band is crowded by the Friends/Settings
       FABs on the left. */
    .app-footer-strip {
        font-size: 9.5px;
        padding: 5px 11px;
        bottom: 24px;
        right: 8px;
        max-width: none;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0 5px;
    }
}

/* ============================================
   REUSABLE UI CONFIRM DIALOG (replaces window.confirm)
   ============================================ */
.confirm-dialog-card { max-width: 380px; }
.confirm-dialog-card .mp-popup-title {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    color: #D4AF37;
    font-size: 22px;
    margin-bottom: 8px;
    text-align: center;
}
.confirm-dialog-card .mp-popup-text {
    text-align: center;
    margin-bottom: 16px;
}
.confirm-dialog-danger {
    background: linear-gradient(135deg, #EF4444, #c33) !important;
    color: #fff !important;
    border: 1px solid rgba(239, 68, 68, 0.6) !important;
}
.confirm-dialog-danger:hover {
    background: linear-gradient(135deg, #f55, #d44) !important;
}

/* ============================================
   REPORT FRIEND MODAL — reason picker
   ============================================ */
.report-reason-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.4;
    margin: 8px 0 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
}
.report-reason-input:focus { border-color: rgba(212, 175, 55, 0.5); }
.report-reason-input::placeholder { color: rgba(255, 255, 255, 0.4); }
:root:not([data-theme="dark"]) .report-reason-input {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.14) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .report-reason-input::placeholder { color: rgba(0, 0, 0, 0.4) !important; }

/* ============================================
   FOUNDER REPORTS INBOX
   ============================================ */
.owner-reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}
.owner-report-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.owner-report-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.owner-report-from { color: #D4AF37; }
.owner-report-to { color: #EF4444; }
.owner-report-arrow { color: rgba(255, 255, 255, 0.5); }
.owner-report-reason {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.owner-report-actions {
    display: flex;
    gap: 8px;
}
.owner-report-ban {
    flex: 1;
    background: linear-gradient(135deg, #EF4444, #c33);
    border: 1px solid rgba(239, 68, 68, 0.55);
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.owner-report-ban:hover { background: linear-gradient(135deg, #f55, #d44); }
.owner-report-dismiss {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.owner-report-dismiss:hover { background: rgba(255, 255, 255, 0.1); }

:root:not([data-theme="dark"]) .owner-report-row {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
}
:root:not([data-theme="dark"]) .owner-report-head { color: #111 !important; }
:root:not([data-theme="dark"]) .owner-report-reason {
    background: rgba(0, 0, 0, 0.06) !important;
    color: rgba(0, 0, 0, 0.8) !important;
}

/* ── Founder analytics panel ───────────────────────────── */
.fa-range-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.fa-range-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.fa-range-chip:hover { background: rgba(212, 175, 55, 0.12); }
.fa-range-chip.active {
    background: #D4AF37;
    border-color: #D4AF37;
    color: #111;
}
.fa-body { display: flex; flex-direction: column; gap: 14px; max-height: 64vh; overflow-y: auto; }
.fa-total-line { font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.fa-total-line strong { color: #D4AF37; }
.fa-anchor-note { font-size: 11px; color: rgba(255, 255, 255, 0.45); margin-top: -8px; }
.fa-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.fa-stat-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.fa-card-mp    { border-top: 3px solid #2196F3; }
.fa-card-users { border-top: 3px solid #B07CF0; }
.fa-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
}
.fa-card-police { border-top: 3px solid #EF4444; }
.fa-card-major  { border-top: 3px solid #4CAF50; }
.fa-card-minor  { border-top: 3px solid #D4AF37; }
.fa-stat-num { font-size: 30px; font-weight: 800; color: #fff; line-height: 1.05; }
.fa-stat-label { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.fa-toplists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fa-toplist {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px;
}
.fa-toplist-title { font-size: 13px; font-weight: 700; color: #D4AF37; margin-bottom: 8px; }
.fa-toplist-empty { font-size: 12px; color: rgba(255, 255, 255, 0.4); }
.fa-toprow {
    display: grid;
    grid-template-columns: 1fr 46px 22px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.fa-toprow-name {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fa-toprow-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.fa-toprow-fill { display: block; height: 100%; background: #D4AF37; border-radius: 999px; }
.fa-toprow-count { font-size: 12px; font-weight: 700; color: #fff; text-align: right; }
.fa-foot-note { font-size: 11px; color: rgba(255, 255, 255, 0.4); line-height: 1.4; }

@media (max-width: 420px) {
    .fa-toplists { grid-template-columns: 1fr; }
}

:root:not([data-theme="dark"]) .fa-range-chip {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.14) !important;
    color: rgba(0, 0, 0, 0.7) !important;
}
:root:not([data-theme="dark"]) .fa-range-chip.active {
    background: #D4AF37 !important;
    color: #111 !important;
    border-color: #D4AF37 !important;
}
:root:not([data-theme="dark"]) .fa-total-line { color: rgba(0, 0, 0, 0.7) !important; }
:root:not([data-theme="dark"]) .fa-anchor-note { color: rgba(0, 0, 0, 0.45) !important; }
:root:not([data-theme="dark"]) .fa-stat-card { background: rgba(0, 0, 0, 0.03) !important; border-color: rgba(0, 0, 0, 0.1) !important; }
:root:not([data-theme="dark"]) .fa-stat-num { color: #111 !important; }
:root:not([data-theme="dark"]) .fa-stat-label { color: rgba(0, 0, 0, 0.5) !important; }
:root:not([data-theme="dark"]) .fa-toplist { background: rgba(0, 0, 0, 0.02) !important; border-color: rgba(0, 0, 0, 0.08) !important; }
:root:not([data-theme="dark"]) .fa-toplist-empty { color: rgba(0, 0, 0, 0.4) !important; }
:root:not([data-theme="dark"]) .fa-toprow-name { color: rgba(0, 0, 0, 0.8) !important; }
:root:not([data-theme="dark"]) .fa-toprow-bar { background: rgba(0, 0, 0, 0.08) !important; }
:root:not([data-theme="dark"]) .fa-toprow-count { color: #111 !important; }
:root:not([data-theme="dark"]) .fa-foot-note { color: rgba(0, 0, 0, 0.4) !important; }
:root:not([data-theme="dark"]) .owner-report-dismiss {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: rgba(0, 0, 0, 0.75) !important;
}

/* ============================================
   MULTIPLAYER SHARE — friends invite list
   ============================================ */
.mp-share-card {
    max-height: 88vh;
    overflow-y: auto;
}
.mp-friends-section {
    margin: 14px 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mp-friends-title {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    color: #D4AF37;
    font-size: 15px;
    margin-bottom: 8px;
    text-align: left;
}
.mp-friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.mp-friends-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    padding: 10px 0;
    text-align: center;
}
.mp-friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.mp-friend-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}
.mp-friend-online .mp-friend-dot {
    background: #36D86B;
    box-shadow: 0 0 8px rgba(54, 216, 107, 0.7);
}
.mp-friend-name {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-friend-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mp-friend-online .mp-friend-status { color: #36D86B; }
.mp-friend-invite {
    background: linear-gradient(135deg, #D4AF37, #C5A028);
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 12px;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
}
.mp-friend-invite:hover { background: linear-gradient(135deg, #F4C430, #D4AF37); }
.mp-friend-invite:disabled {
    cursor: default;
    opacity: 0.7;
}
:root:not([data-theme="dark"]) .mp-friends-section { border-top-color: rgba(0, 0, 0, 0.08) !important; }
:root:not([data-theme="dark"]) .mp-friend-row {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
:root:not([data-theme="dark"]) .mp-friend-name { color: #111 !important; }
:root:not([data-theme="dark"]) .mp-friend-status { color: rgba(0, 0, 0, 0.55) !important; }
:root:not([data-theme="dark"]) .mp-friend-invite { color: #1a1a1a !important; }

/* Fineprint under settings (smaller, low-key) */
.friends-settings-fineprint {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    line-height: 1.4;
    margin: -2px 0 14px;
    padding: 0 2px;
}
:root:not([data-theme="dark"]) .friends-settings-fineprint { color: rgba(0, 0, 0, 0.5) !important; }

/* ============================================
   Settings → Username section (current handle + 14-day rename)
   ============================================ */
.settings-username-row {
    margin: 4px 0 10px;
}
.settings-username-current {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.10);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
}
.settings-username-rename { margin-bottom: 6px; }
.settings-username-note {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    line-height: 1.4;
    margin: 0 0 14px;
    padding: 0 2px;
}
:root:not([data-theme="dark"]) .settings-username-current { color: #B8941F !important; }
:root:not([data-theme="dark"]) .settings-username-note { color: rgba(0, 0, 0, 0.55) !important; }

/* ============================================
   Pen icon next to the version label (founder only)
   ============================================ */
.version-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: rgba(10, 10, 10, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: border-color 0.15s, color 0.15s;
}
.version-edit-btn:hover {
    border-color: rgba(212, 175, 55, 0.5);
    color: #D4AF37;
}
.version-edit-btn.hidden { display: none !important; }

/* ============================================
   Version editor modal (founder only)
   ============================================ */
.version-editor-card { max-width: 360px; }
.version-editor-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    margin: 12px 0 6px;
}
.version-editor-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}
.version-editor-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.55);
}
.founder-popup-card {
    max-width: 360px;
    text-align: center;
}
.founder-popup-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.32);
    color: #D4AF37;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    overflow: hidden;
}
.founder-popup-icon svg {
    width: 58px;
    height: 58px;
    display: block;
}
.founder-popup-editor-card {
    max-width: 400px;
    max-height: 88vh;
    overflow-y: auto;
}
.founder-popup-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 700;
    margin: 14px 0 4px;
}
.founder-popup-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #D4AF37;
}
.founder-popup-textarea,
.founder-popup-svg-input {
    resize: vertical;
    min-height: 92px;
    line-height: 1.45;
}
.founder-popup-svg-input {
    min-height: 86px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}
.founder-popup-help {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    line-height: 1.4;
    margin: 8px 0 12px;
}
:root:not([data-theme="dark"]) .version-editor-label { color: rgba(0, 0, 0, 0.55) !important; }
:root:not([data-theme="dark"]) .version-editor-input {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #111 !important;
}
:root:not([data-theme="dark"]) .version-editor-input:focus {
    border-color: rgba(212, 175, 55, 0.6) !important;
}
:root:not([data-theme="dark"]) .founder-popup-toggle { color: rgba(0, 0, 0, 0.75) !important; }
:root:not([data-theme="dark"]) .founder-popup-help { color: rgba(0, 0, 0, 0.55) !important; }

/* ============================================
   "Is this marker real?" proximity popup
   ============================================ */
.marker-real-card { max-width: 340px; }
.marker-real-no {
    color: #ff8080 !important;
}
:root:not([data-theme="dark"]) .marker-real-no { color: #c2410c !important; }

/* ============================================
   App tester recruitment popup (app.html).
   Deliberately stays black in BOTH themes — it is a branded announcement
   card, so no :root:not([data-theme="dark"]) overrides here.
   z-index 9400 keeps it under the loading screen (10000), the permission
   screen (9999) and mp-popups (9500), so it surfaces only once the map
   is actually visible and founder announcements outrank it.
   ============================================ */
.tester-popup {
    position: fixed;
    inset: 0;
    z-index: 9400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tester-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.tester-popup-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: min(86vh, 680px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #0b0b0d;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    padding: 30px 26px 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.tester-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    padding: 0;
}
.tester-popup-close:hover { background: rgba(255, 255, 255, 0.15); }
.tester-popup-title {
    font-family: 'Climate Crisis', 'Poppins', sans-serif;
    font-weight: 400;
    letter-spacing: 0;
    color: #F4C430;
    font-size: clamp(1.25rem, 4.6vw, 1.65rem);
    line-height: 1.18;
    margin: 0 0 10px;
    padding-right: 36px;
}
.tester-popup-sub {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 18px;
}
.tester-popup-section { margin-bottom: 16px; }
.tester-popup-label {
    color: #F4C430;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.tester-popup-section p,
.tester-popup-section li {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13.5px;
    line-height: 1.55;
}
.tester-popup-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.tester-popup-section li { padding-left: 18px; position: relative; }
.tester-popup-section li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F4C430;
}
.tester-popup-feedback-link { color: #F4C430; text-decoration: underline; }
.tester-popup-tiktok {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 10px;
    text-decoration: none;
    transition: transform .15s;
}
.tester-popup-tiktok:hover { transform: translateY(-1px); }
.tester-popup-tiktok svg { flex-shrink: 0; }
.tester-popup-note {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12.5px;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

/* Secondary email button inside the tester popup — dark ghost variant of
   the white TikTok button (it double-classes .tester-popup-tiktok). */
.tester-popup-email {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    margin-top: 8px;
}
.tester-popup-email:hover { background: rgba(255, 255, 255, 0.12); }

/* Founder announcements share the tester-popup look. Keep their old 9500
   z-index so they still outrank the recruitment popup (9400), and keep the
   editor's icon slot working — just smaller + left-aligned to match the
   left-aligned tester card. pre-wrap keeps the editor's line breaks. */
#founderAnnouncementPopup { z-index: 9500; }
.tester-popup-body {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
}
#founderAnnouncementPopup .founder-popup-icon {
    margin: 0 0 12px;
    width: 56px;
    height: 56px;
}
#founderAnnouncementPopup .founder-popup-icon svg {
    width: 40px;
    height: 40px;
}
