/* ─── Custom Properties ─────────────────────────── */

:root {
    color-scheme: light dark;

    --accent: #7c5cfc;
    --accent-hover: #6b4ae6;
    --accent-glow: rgba(124, 92, 252, 0.25);
    --accent-subtle: rgba(124, 92, 252, 0.08);

    --cat-accident: #ef4444;
    --cat-police: #3b82f6;
    --cat-fire: #f97316;
    --cat-closure: #eab308;
    --cat-other: #94a3b8;

    --bg: #f5f5fa;
    --bg-raised: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.35);
    --text: #1a1a2e;
    --text-secondary: #64648c;
    --text-tertiary: #9898b0;
    --border: rgba(0, 0, 0, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    --header-h: 56px;
    --fab-size: 56px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur: 200ms;
    --dur-lg: 350ms;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0c14;
        --bg-raised: #161626;
        --bg-overlay: rgba(0, 0, 0, 0.55);
        --text: #e8e8f0;
        --text-secondary: #9898b0;
        --text-tertiary: #6b6b84;
        --border: rgba(255, 255, 255, 0.07);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

/* ─── Reset ──────────────────────────────────────── */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    min-height: 100dvh;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
    -webkit-appearance: none;
}

/* ─── Header ─────────────────────────────────────── */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.header-logo { flex-shrink: 0; }

.header-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Layout ─────────────────────────────────────── */

.main {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--header-h));
}

/* ─── Map ────────────────────────────────────────── */

.map-section {
    position: relative;
    z-index: 0;
    height: 55dvh;
    min-height: 300px;
}

#map { width: 100%; height: 100%; }

.leaflet-tile {
    filter: saturate(0.2) contrast(1.05) brightness(1.02);
}

@media (prefers-color-scheme: dark) {
    .leaflet-tile { filter: none; }
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-raised) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 16px !important;
    border-radius: var(--radius-xs) !important;
}

.leaflet-control-zoom-in {
    border-bottom: none !important;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 var(--radius-xs) var(--radius-xs) !important;
}

.leaflet-control-attribution {
    font-size: 10px !important;
    opacity: 0.5;
    background: transparent !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    background: var(--bg-raised) !important;
    color: var(--text) !important;
    padding: 0 !important;
}

.leaflet-popup-tip { background: var(--bg-raised) !important; }

.leaflet-popup-content {
    margin: 12px 14px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

/* ─── Map Markers ────────────────────────────────── */

.marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-raised);
    box-shadow: var(--shadow-lg);
    border: 2.5px solid var(--cat-other);
    font-size: 18px;
}

.marker--accident { border-color: var(--cat-accident); }
.marker--police   { border-color: var(--cat-police); }
.marker--fire     { border-color: var(--cat-fire); }
.marker--closure  { border-color: var(--cat-closure); }
.marker--other    { border-color: var(--cat-other); }

.marker--new {
    animation: marker-pop 350ms var(--ease-spring), marker-pulse 2s ease-out 350ms infinite;
}

@keyframes marker-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes marker-pulse {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 18px rgba(124, 92, 252, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 92, 252, 0); }
}

.marker--pin {
    width: 44px;
    height: 44px;
    border-color: var(--accent);
    border-width: 3px;
    cursor: grab;
    font-size: 20px;
    z-index: 1000 !important;
}

.marker--pin:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.user-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-raised);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Events Section ─────────────────────────────── */

.events-section {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(var(--fab-size) + 32px);
}

.events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.events-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.events-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ─── Event Card ─────────────────────────────────── */

.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    animation: card-in 400ms var(--ease-out) both;
}

.event-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
}

.event-card:nth-child(2) { animation-delay: 40ms; }
.event-card:nth-child(3) { animation-delay: 80ms; }
.event-card:nth-child(4) { animation-delay: 120ms; }
.event-card:nth-child(5) { animation-delay: 160ms; }

.card-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 20px;
}

.card-icon--accident { background: rgba(239, 68, 68, 0.1); }
.card-icon--police   { background: rgba(59, 130, 246, 0.1); }
.card-icon--fire     { background: rgba(249, 115, 22, 0.1); }
.card-icon--closure  { background: rgba(234, 179, 8, 0.1); }
.card-icon--other    { background: rgba(148, 163, 184, 0.1); }

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

.card-category {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-confirms {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.card-confirms svg { color: #22c55e; }

.card-actions { flex-shrink: 0; }

.btn-confirm {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn-confirm:hover { background: rgba(124, 92, 252, 0.15); }
.btn-confirm:active { transform: scale(0.95); }

.btn-confirm.confirmed {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    pointer-events: none;
}

/* ─── FAB ────────────────────────────────────────── */

.fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1000;
    touch-action: manipulation;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.fab:active { transform: scale(0.94); }

/* ─── Modal (Bottom Sheet) ───────────────────────── */

.modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.modal[hidden] { display: none; }

.modal-backdrop {
    display: none;
}

.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 16px 20px 24px;
    background: var(--bg-raised);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    animation: slide-up var(--dur-lg) var(--ease-out) both;
    pointer-events: auto;
}

.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--border);
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }

/* ─── Category Grid ──────────────────────────────── */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.cat-btn:hover { background: var(--accent-subtle); }
.cat-btn:active { transform: scale(0.96); }

.cat-btn.selected {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.cat-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
}

.cat-icon--accident { background: rgba(239, 68, 68, 0.1); }
.cat-icon--police   { background: rgba(59, 130, 246, 0.1); }
.cat-icon--fire     { background: rgba(249, 115, 22, 0.1); }
.cat-icon--closure  { background: rgba(234, 179, 8, 0.1); }
.cat-icon--other    { background: rgba(148, 163, 184, 0.1); }

.cat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 20px;
}

.modal-actions { display: flex; gap: 10px; }

/* ─── Buttons ────────────────────────────────────── */

.btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--primary:disabled { opacity: 0.4; cursor: default; }

.btn--ghost {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--ghost:hover { background: var(--border); }

/* ─── Toast ──────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 350ms var(--ease-spring) both;
    white-space: nowrap;
}

.toast[hidden] { display: none; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.9); }
}

/* ─── Push Banner ────────────────────────────────── */

.push-banner {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: toast-in 400ms var(--ease-spring) both;
    max-width: calc(100vw - 32px);
}

.push-banner-btn {
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.push-banner-btn--yes { background: var(--accent); color: #fff; }
.push-banner-btn--no { color: var(--text-tertiary); }

/* ─── Popup Content ──────────────────────────────── */

.popup-cat {
    font-weight: 600;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.popup-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.popup-confirm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent);
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

.popup-confirm:hover { background: rgba(124, 92, 252, 0.15); }

/* ─── Radius Circle ──────────────────────────────── */

.pin-radius {
    stroke: var(--accent);
    fill: var(--accent);
    fill-opacity: 0.06;
    stroke-width: 2;
    stroke-dasharray: 8 4;
}

/* ─── FAB SVG (ensure click reaches button) ────── */

.fab svg { pointer-events: none; }

/* ─── Pin Radius Visualization ────────────────── */

.pin-radius {
    fill: var(--accent-glow);
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 6 4;
    opacity: 0.6;
}

/* ─── Popup Confirm ──────────────────────────────── */

.popup-cat {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.popup-meta {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 8px;
}

.popup-confirm {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

.popup-confirm:hover { background: rgba(124, 92, 252, 0.15); }

/* ─── Safe area (notch/gesture bar) ──────────── */

@supports (padding: env(safe-area-inset-bottom)) {
    .fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
    .modal-sheet { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
    .header { height: calc(var(--header-h) + env(safe-area-inset-top)); }
}

/* ─── Confirm Radius Circle ──────────────────── */

.confirm-radius {
    stroke-width: 2;
    stroke-dasharray: 8 4;
    opacity: 0.4;
}

.confirm-radius--ok {
    fill: rgba(46, 213, 115, 0.08);
    stroke: #2ed573;
}

.confirm-radius--far {
    fill: rgba(255, 71, 87, 0.06);
    stroke: #ff4757;
}

/* ─── Popup extras ───────────────────────────── */

.popup-dist {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.popup-ttl {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    opacity: 0.7;
}

.popup-cat--hotspot {
    color: var(--warning, #ffa502);
}

.popup-confirm--own,
.popup-confirm--far {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
}

/* ─── Card button states ─────────────────────── */

.btn-confirm.own-event {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: default;
    font-size: 11px;
}

.btn-confirm.too-far {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: default;
    font-size: 11px;
}

.card-ttl {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-left: 4px;
}

/* ─── Hotspot Markers ────────────────────────── */

.marker--hotspot {
    opacity: 0.45;
    filter: saturate(0.5);
    position: relative;
}

.marker--hotspot span:first-child {
    font-size: 20px;
}

.hotspot-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
    line-height: 1.2;
}


/* ─── Locate Button ──────────────────────────── */

.btn-locate {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-locate:active { transform: scale(0.92); }
.btn-locate:hover { background: var(--accent-subtle); }

.btn-locate svg { pointer-events: none; }

/* ─── Install Banner ─────────────────────────── */

.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    background: var(--accent);
    color: #fff;
    animation: slide-down 0.3s var(--ease-out) both;
}

.install-banner[hidden] { display: none; }

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.install-banner-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.btn--sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-full);
    background: #fff;
    color: var(--accent);
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.install-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.install-dismiss:hover { color: #fff; }

@keyframes slide-down { from { transform: translateY(-100%); } }

@supports (padding: env(safe-area-inset-bottom)) {
    .btn-locate { bottom: calc(100px + env(safe-area-inset-bottom)); }
}


/* ─── Fix marker flicker during zoom/pan ─────── */

.leaflet-marker-icon,
.leaflet-marker-shadow {
    -webkit-transition: none !important;
    transition: none !important;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
    will-change: transform;
}

/* ─── Marker Cluster ─────────────────────────── */

.cluster-icon {
    background: none !important;
    border: none !important;
}

.cluster-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 2.5px solid var(--accent);
    box-shadow: 0 2px 12px rgba(124, 92, 252, 0.25);
    position: relative;
    flex-wrap: wrap;
}

.cluster-emojis {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1px;
}

.cluster-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.cluster-plus {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Override default markercluster styles */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: none !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: none !important;
}

/* Spiderfy lines */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out !important;
}


/* ─── User Radius Circle (persistent) ────────── */

.user-radius {
    stroke: var(--accent);
    fill: var(--accent);
    fill-opacity: 0.03;
    stroke-width: 1;
    stroke-opacity: 0.15;
    stroke-dasharray: 6 4;
}

/* ─── Confirm Radius Circle ──────────────────── */

.confirm-radius--ok {
    stroke: #22c55e;
    fill: #22c55e;
    fill-opacity: 0.05;
    stroke-width: 2;
    stroke-dasharray: 8 4;
}

.confirm-radius--far {
    stroke: #ef4444;
    fill: #ef4444;
    fill-opacity: 0.04;
    stroke-width: 2;
    stroke-dasharray: 8 4;
}

/* ─── Events Section Hint ────────────────────── */

.events-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

/* ─── Onboarding ─────────────────────────────── */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade-in 0.4s var(--ease) both;
}

.onboarding-overlay[hidden] { display: none; }

.onboarding-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.onboarding-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.onboarding-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.onboarding-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.onboarding-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--dur) var(--ease);
    margin-bottom: 8px;
}

.onboarding-input:focus {
    border-color: var(--accent);
}

.onboarding-input-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-actions .btn {
    width: 100%;
}

.onboarding-skip {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 12px;
    cursor: pointer;
    background: none;
    border: none;
}

.onboarding-skip:hover {
    color: var(--text-secondary);
}

.onboarding-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 24px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background var(--dur) var(--ease);
}

.onboarding-dot.active {
    background: var(--accent);
}

/* ─── Event Detail Modal ─────────────────────── */

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.detail-overlay[hidden] { display: none; }

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    animation: fade-in var(--dur-lg) var(--ease) both;
}

.detail-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 20px 20px 28px;
    background: var(--bg-raised);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-lg);
    animation: slide-up var(--dur-lg) var(--ease-out) both;
}

.detail-handle {
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--border);
    margin: 0 auto 16px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-emoji {
    font-size: 28px;
    flex-shrink: 0;
}

.detail-header-text {
    flex: 1;
}

.detail-category {
    font-size: 18px;
    font-weight: 700;
}

.detail-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.detail-creator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}

.retract-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 16px;
    border: 1.5px solid var(--error);
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--error);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.retract-btn:hover {
    background: var(--error);
    color: #fff;
}
.retract-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ─── Media Gallery ──────────────────────────── */

.detail-media {
    margin-bottom: 16px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.media-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg);
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
    margin-top: 8px;
}

.media-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Comments ───────────────────────────────── */

.detail-comments {
    margin-top: 16px;
}

.comments-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comment {
    display: flex;
    gap: 8px;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.comment-author {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    word-break: break-word;
}

.comment-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.comment-input-row {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--dur) var(--ease);
}

.comment-input:focus {
    border-color: var(--accent);
}

.comment-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-send:disabled {
    opacity: 0.4;
}

/* ─── Media Lightbox ─────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease;
}

.lightbox[hidden] { display: none; }

.lightbox img,
.lightbox video {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-xs);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Popup Detail Link ──────────────────────── */

.popup-detail {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: opacity var(--dur) var(--ease);
}

.popup-detail:hover {
    opacity: 0.7;
}

.popup-dist {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
}

.popup-ttl {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.popup-confirm--own {
    opacity: 0.5;
    cursor: default;
}

.popup-confirm--far {
    opacity: 0.5;
    cursor: default;
}


/* ─── Profile Button ─────────────────────────── */

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn-profile:hover { background: var(--accent-subtle); }
.btn-profile:active { transform: scale(0.92); }

/* ─── Profile Sheet ──────────────────────────── */

.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.profile-overlay[hidden] { display: none; }

.profile-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    animation: fade-in var(--dur-lg) var(--ease) both;
}

.profile-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85dvh;
    overflow-y: auto;
    padding: 20px 24px 32px;
    background: var(--bg-raised);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-lg);
    animation: slide-up var(--dur-lg) var(--ease-out) both;
    text-align: center;
}

.profile-handle {
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--border);
    margin: 0 auto 20px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.profile-tag {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.profile-section {
    text-align: left;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.profile-section-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.4;
}

.profile-btn {
    width: 100%;
}

.profile-close-btn {
    width: 100%;
    margin-top: 16px;
}

/* ─── Link Code Display ──────────────────────── */

.link-code-display {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-base);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.link-code-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 6px;
    color: var(--accent);
    margin-bottom: 8px;
}

.link-code-timer {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.link-code-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

/* ─── Redeem Row ─────────────────────────────── */

.link-redeem-row {
    display: flex;
    gap: 8px;
}

.link-redeem-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    text-align: center;
    outline: none;
    transition: border-color var(--dur) var(--ease);
}

.link-redeem-input:focus {
    border-color: var(--accent);
}

.link-redeem-input::placeholder {
    letter-spacing: 0;
    font-family: var(--font);
}

/* ─── Upload Progress Bar ────────────────────── */

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    overflow: hidden;
}

.upload-progress[hidden] { display: none; }

.upload-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: var(--accent);
    opacity: 0.2;
    transition: width 150ms ease;
}

.upload-progress-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ─── Predictions Toggle ─────────────────────── */

.btn-predictions {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn-predictions:hover { background: var(--accent-subtle); }
.btn-predictions:active { transform: scale(0.92); }

.btn-predictions.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ─── Prediction Markers ─────────────────────── */

.prediction-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
}

.prediction-icon {
    font-size: 22px;
    filter: grayscale(0.3);
    opacity: 0.7;
    animation: prediction-pulse 3s ease-in-out infinite;
}

.prediction-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 1px 4px;
    border-radius: var(--radius-full);
    line-height: 1.2;
    white-space: nowrap;
}

@keyframes prediction-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

/* ─── Prediction Popup ───────────────────────── */

.prediction-popup-wrapper .leaflet-popup-content-wrapper {
    background: var(--bg-raised);
    color: var(--text-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.prediction-popup-wrapper .leaflet-popup-tip {
    background: var(--bg-raised);
}

.prediction-popup strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.prediction-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.prediction-detail {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 0;
}

/* ─── Prevent iOS zoom on input focus ────────── */

input, textarea, select {
    font-size: 16px !important;
}

/* ─── Media items with uploader info ─────────── */

.media-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.media-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-tertiary);
    padding: 0 2px;
}

.media-uploader {
    font-weight: 600;
    color: var(--text-secondary);
}

.media-time {
    flex: 1;
}

.media-delete-btn {
    background: none;
    border: none;
    color: var(--danger, #ef4444);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.media-delete-btn:hover {
    opacity: 1;
}

/* ─── Comment delete button ──────────────────── */

.comment-delete-btn {
    background: none;
    border: none;
    color: var(--danger, #ef4444);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.comment-delete-btn:hover {
    opacity: 1;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Audit log ──────────────────────────────── */

.detail-audit {
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
}

.audit-toggle-btn {
    width: 100%;
    padding: 8px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.audit-toggle-btn:hover {
    background: var(--hover);
}

.audit-log {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
}

.audit-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    padding: 4px 8px;
    background: var(--surface-elevated);
    border-radius: 6px;
}

.audit-action {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 110px;
}

.audit-actor {
    color: var(--accent);
    flex: 1;
}

.audit-time {
    color: var(--text-tertiary);
    font-size: 10px;
    white-space: nowrap;
}

.audit-detail {
    font-size: 10px;
    color: var(--text-tertiary);
    font-style: italic;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Event expiry info ──────────────────────── */

.detail-expiry {
    font-size: 11px;
    color: var(--warning, #f59e0b);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-expiry::before {
    content: '\23F3';
    font-size: 12px;
}

/* ─── Onboarding link device button ──────────── */

.onboarding-link-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    margin-bottom: 1em;
    background: var(--surface-elevated);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
}
.onboarding-link-btn:hover {
    background: var(--hover);
    border-color: var(--accent);
}



/* ─── Blitzer Nearby Cards ─── */
.card-icon--blitzer {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}
.blitzer-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full, 20px);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.blitzer-type--fest {
    background: rgba(239, 68, 68, .15);
    color: #ef4444;
}
.blitzer-type--mobil {
    background: rgba(234, 179, 8, .15);
    color: #ca8a04;
}
.blitzer-nearby .events-header {
    border-top: 1px solid var(--border, #e5e7eb);
    padding-top: 16px;
}

/* ─── Install Guide (Onboarding) ─── */
.install-guide {
    margin: 12px 0 4px;
}
.install-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.install-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md, 10px);
    background: var(--surface-raised, var(--gray-100));
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}
.install-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.install-icon-hint {
    display: inline-block;
    font-size: 18px;
    vertical-align: middle;
    color: var(--accent);
}

/* ─── Link Approval Modal ─── */
.link-approval-modal {
    position: fixed; inset: 0;
    z-index: 9999;
    background: var(--bg-overlay);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.link-approval-modal[hidden] { display: none; }
.link-approval-card {
    background: var(--bg-raised); color: var(--text);
    border-radius: var(--radius); border: 1px solid var(--border);
    padding: 2em 1.5em; text-align: center;
    max-width: 340px; width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.link-approval-icon { font-size: 2.5em; margin-bottom: 0.3em; }
.link-approval-card h3 { margin: 0 0 0.6em; font-size: 1.2em; color: var(--text); }
.link-approval-card p { margin: 0.4em 0; font-size: 0.95em; color: var(--text-secondary); }
.link-approval-tag { color: var(--accent); font-size: 1.1em; }
.link-approval-actions {
    display: flex; gap: 0.6em; margin-top: 1.4em;
}
.link-approval-actions button {
    flex: 1; padding: 0.75em 0.5em; border: none; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; cursor: pointer; font-size: 0.9em;
    transition: opacity 0.15s;
}
.link-approval-actions button:active { opacity: 0.8; }
.link-deny-btn {
    background: var(--border); color: var(--text);
}
.link-approve-btn {
    background: var(--accent); color: #fff;
}

/* ─── Link Wait Spinner ─── */
.link-wait-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 1.2em auto;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── OTP Digit Inputs ─── */
.otp-inputs {
    display: flex; align-items: center; justify-content: center;
    gap: 0.4em; margin: 1em 0 0.6em;
}
.otp-digit {
    width: 2.6em; height: 3.2em;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: 600 1.4em/1 'Inter', sans-serif;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    caret-color: var(--accent);
}
.otp-digit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.otp-sep {
    font-size: 1.3em; color: var(--text-tertiary);
    margin: 0 0.1em; user-select: none;
}

/* ─── Logout Confirmation ─── */
.logout-section {
    margin-top: 1.2em; padding-top: 1em;
    border-top: 1px solid var(--border);
}
.logout-btn {
    background: none; border: none; color: var(--cat-accident);
    font: inherit; font-size: 0.9em; cursor: pointer;
    padding: 0.5em 0; opacity: 0.8;
    transition: opacity 0.15s;
}
.logout-btn:hover { opacity: 1; }
.logout-confirm {
    margin-top: 0.8em; text-align: center;
    animation: slideUp 0.2s ease;
}
.logout-confirm p {
    font-size: 0.85em; color: var(--text-secondary);
    margin: 0 0 0.5em;
}
.logout-confirm-word {
    font-weight: 700; color: var(--accent); font-size: 1em;
}
.logout-confirm-input {
    width: 100%; padding: 0.6em 0.8em;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); color: var(--text);
    font: inherit; font-size: 0.95em; text-align: center;
    outline: none; margin-bottom: 0.5em;
    transition: border-color 0.15s;
}
.logout-confirm-input:focus {
    border-color: var(--accent);
}
.logout-confirm-submit {
    width: 100%; padding: 0.6em;
    background: var(--cat-accident); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: 0.9em;
    cursor: pointer; opacity: 0.4; pointer-events: none;
    transition: opacity 0.15s;
}
.logout-confirm-submit.ready { opacity: 1; pointer-events: auto; }

/* ─── Admin Client Markers ─── */
.client-marker-wrap { overflow: visible !important; }
.client-marker {
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap; transition: opacity 0.3s;
    pointer-events: auto;
}
.client-dot {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
    border: 2px solid #fff;
}
.client-label {
    font: 600 0.65rem/1 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg-raised);
    padding: 2px 6px; border-radius: 6px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.client-popup .leaflet-popup-content { font-size: 0.85em; }
.btn-predictions.active {
    background: var(--accent) !important;
    color: #fff !important;
}

/* ─── Blitzer Feature ─── */
:root {
    --cat-blitzer: #f59e0b;
}
.cat-icon--blitzer { background: var(--cat-blitzer); }
.cat-btn--blitzer .cat-icon { border-color: var(--cat-blitzer); }

/* Blitzer map markers */
.blitzer-marker-wrap { overflow: visible !important; }
.blitzer-marker {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    position: relative; transition: transform 0.2s;
}
.blitzer-marker--fest {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.4);
}
.blitzer-marker--mobil {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.blitzer-icon { font-size: 18px; line-height: 1; }
.blitzer-speed {
    position: absolute; bottom: -8px; right: -8px;
    background: #0f172a; color: #fff;
    font: 700 0.6rem/1 'Inter', sans-serif;
    padding: 2px 5px; border-radius: 6px;
    border: 1.5px solid #fff;
    white-space: nowrap;
}

/* Blitzer popup detail */
.blitzer-popup .leaflet-popup-content { padding: 0; margin: 0; }
.blitzer-detail { padding: 12px; min-width: 180px; }
.blitzer-detail-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.blitzer-type-badge {
    font: 600 0.75rem/1 'Inter', sans-serif;
    padding: 3px 8px; border-radius: 6px;
}
.blitzer-type-badge--fest { background: #fecaca; color: #991b1b; }
.blitzer-type-badge--mobil { background: #fef3c7; color: #92400e; }
.blitzer-time { font-size: 0.7rem; color: var(--text-secondary); }
.blitzer-speed-display {
    font: 700 1.8rem/1 'Inter', sans-serif;
    text-align: center; margin: 8px 0 4px;
    color: var(--text);
}
.blitzer-speed-display small { font-size: 0.6em; font-weight: 500; }
.blitzer-vote-info {
    text-align: center; font-size: 0.7rem;
    color: var(--text-secondary); margin-bottom: 8px;
}
.blitzer-no-speed {
    text-align: center; font-size: 0.8rem;
    color: var(--text-secondary); margin: 8px 0;
    font-style: italic;
}

/* Vote section */
.blitzer-vote-section { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.blitzer-vote-label { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 6px; }
.blitzer-vote-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.blitzer-vote-btn {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 0;
    font: 600 0.75rem/1 'Inter', sans-serif;
    color: var(--text); cursor: pointer; transition: all 0.15s;
}
.blitzer-vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.blitzer-vote-btn.blitzer-vote--active,
.blitzer-vote-btn:active {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
}

/* Delete button */
.blitzer-delete-btn {
    display: block; width: 100%; margin-top: 10px;
    padding: 6px 0; border-radius: var(--radius-sm);
    background: none; border: 1.5px solid var(--cat-accident);
    color: var(--cat-accident); font: 500 0.75rem/1 'Inter', sans-serif;
    cursor: pointer; transition: all 0.15s;
}
.blitzer-delete-btn:hover { background: var(--cat-accident); color: #fff; }

/* Blitzer creation modal */
.blitzer-create-section { margin-bottom: 16px; }
.blitzer-section-label {
    font: 500 0.85rem/1 'Inter', sans-serif;
    color: var(--text-secondary); margin-bottom: 8px;
}
.blitzer-section-label small { font-weight: 400; opacity: 0.7; }
.blitzer-type-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.blitzer-type-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 14px 8px; border-radius: var(--radius);
    background: var(--bg); border: 2px solid var(--border);
    cursor: pointer; transition: all 0.15s;
    font: 500 0.85rem/1 'Inter', sans-serif; color: var(--text);
}
.blitzer-type-icon { font-size: 1.5rem; }
.blitzer-type-btn:hover { border-color: var(--accent); }
.blitzer-type-btn.selected {
    border-color: var(--accent); background: rgba(124,92,252,0.08);
    color: var(--accent);
}
.blitzer-speed-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.blitzer-speed-btn {
    padding: 10px 0; border-radius: var(--radius-sm);
    background: var(--bg); border: 2px solid var(--border);
    font: 600 0.9rem/1 'Inter', sans-serif;
    color: var(--text); cursor: pointer; transition: all 0.15s;
}
.blitzer-speed-btn:hover { border-color: var(--accent); }
.blitzer-speed-btn.selected {
    border-color: var(--accent); background: rgba(124,92,252,0.08);
    color: var(--accent);
}

/* Category grid: 6 items → 3 cols */
.category-grid { grid-template-columns: repeat(3, 1fr); }

/* ─── Profile Toggle Switch ─── */
.profile-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; cursor: pointer; user-select: none;
}
.profile-toggle-label {
    font: 500 0.9rem/1 'Inter', sans-serif;
    color: var(--text);
}
.profile-toggle input {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.profile-toggle-slider {
    position: relative; width: 44px; height: 24px;
    background: var(--border); border-radius: 12px;
    transition: background 0.2s; flex-shrink: 0;
}
.profile-toggle-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.profile-toggle input:checked + .profile-toggle-slider {
    background: var(--accent);
}
.profile-toggle input:checked + .profile-toggle-slider::after {
    transform: translateX(20px);
}
