/* Map specific styles shared between dashboard and maps page */
.map-shell{
	background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
	border:1px solid #dfeaf8;
	border-radius:26px;
	box-shadow:0 18px 40px rgba(17,42,76,.08);
	overflow:hidden;
}

.map-panel{
	padding:18px 18px 12px;
	border-bottom:1px solid #e6edf8;
	background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(239,247,255,.98));
}

.nearby-accident-alert{display:flex;align-items:flex-start;gap:12px;margin:14px 18px 0;padding:14px 16px;border:1px solid #fdba74;border-radius:12px;background:#fff7ed;color:#1c1917;box-shadow:0 10px 24px rgba(194,65,12,.14);transform:translateY(-8px) scale(.98);opacity:0;transition:opacity .25s ease,transform .25s ease}.nearby-accident-alert.is-visible{opacity:1;transform:none}.nearby-accident-alert[hidden]{display:none}.nearby-accident-alert strong{display:block;color:#c2410c}.nearby-accident-alert p{margin:3px 0;line-height:1.4}.nearby-accident-alert small{color:#57534e}.alert-icon{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#f97316;color:#fff;font-weight:900;animation:nearby-pulse 2s ease-in-out infinite}.dismiss-alert{margin-left:auto;flex:0 0 auto;width:28px;padding:0;background:transparent!important;color:#9a3412!important;font-size:24px;line-height:1;border-radius:50%}.dismiss-alert:hover{opacity:1!important;background:#ffedd5!important}@keyframes nearby-pulse{50%{transform:scale(1.08)}}
.nearby-alert-popup{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.42);z-index:3000;padding:20px;opacity:0;pointer-events:none;transition:opacity .22s ease}.nearby-alert-popup.is-visible{opacity:1;pointer-events:auto}.nearby-alert-popup[hidden]{display:none}.nearby-alert-popup__content{position:relative;max-width:420px;width:min(100%,420px);background:#fff;padding:24px 22px;border-radius:16px;border:1px solid #fdba74;box-shadow:0 22px 45px rgba(15,23,42,.32);animation:nearby-popup-bounce .3s ease-out}.nearby-alert-popup__header{display:flex;align-items:center;gap:12px;margin-bottom:12px;color:#c2410c}.nearby-alert-popup__badge{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#f97316;color:#fff;font-size:20px}.nearby-alert-popup__content p{margin:0 0 8px;line-height:1.55;color:#1f2937;font-weight:700}.nearby-alert-popup__content small{display:block;color:#475569;line-height:1.5}.nearby-alert-popup__close{margin-top:16px;width:100%;padding:12px;border:none;border-radius:10px;background:#f97316;color:#fff;font-weight:800;cursor:pointer} .nearby-alert-popup__close:hover{opacity:.96}@keyframes nearby-popup-bounce{0%{transform:scale(.9) translateY(12px)}100%{transform:scale(1) translateY(0)}}

.map-status-grid{
	display:grid;
	grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
	gap:10px;
	margin-bottom:16px;
}

.map-status{
	background:linear-gradient(180deg,#edf6ff,#f8fbff);
	border:1px solid #dfeaf8;
	border-radius:16px;
	padding:12px 14px;
	box-shadow:inset 0 1px 0 rgba(255,255,255,0.7);
}

.map-status:nth-child(2){background:linear-gradient(180deg,#fff4eb,#fffaf5)}
.map-status:nth-child(3){background:linear-gradient(180deg,#ebfff5,#f7fff9)}

.map-status span{
	display:block;
	color:#59708d;
	font-size:11px;
	font-weight:800;
	letter-spacing:.08em;
	text-transform:uppercase;
}

.map-status strong{
	display:block;
	margin-top:6px;
	font-size:1.05rem;
	color:#0f172a;
	letter-spacing:-.03em;
}

.route-form{
	display:grid;
	grid-template-columns:minmax(150px,1fr) auto minmax(180px,1.2fr) auto;
	gap:10px;
	align-items:end;
	margin:12px 0 10px;
}

.route-form input{
	padding:12px 14px;
	margin:0;
	border:1px solid #d9e5f4;
	border-radius:12px;
	background:#fff;
	color:#102a4c;
	font:600 0.92rem/1.4 Inter,system-ui,sans-serif;
}

.route-form input:focus{
	outline:3px solid rgba(7,82,184,.12);
	border-color:#66a5eb;
}

.map-controls{
	margin:12px 0 0;
	display:flex;
	flex-wrap:wrap;
	gap:8px;
}

.map-controls .btn,
.route-form .btn{
	width:auto;
	margin-top:0;
	padding:10px 14px;
	background:linear-gradient(180deg,#f7a928,#f08c19);
	color:#fff;
	border:none;
	border-radius:12px;
	font:800 .78rem/1 Inter,system-ui,sans-serif;
	cursor:pointer;
	box-shadow:0 10px 18px rgba(240,140,25,.18);
}

.map-controls .btn.secondary,
.route-form .btn.secondary{
	background:linear-gradient(180deg,#0a66c2,#0752b8);
	box-shadow:0 10px 18px rgba(7,82,184,.18);
}

.map-controls .btn.warning{
	background:linear-gradient(180deg,#f97316,#ea580c);
}

.route-notice,
.route-alert,
.maps-error{
	margin-top:8px;
	font-weight:700;
	color:#b71c1c;
}

#map{
	width:100%;
	height:640px;
	border:0;
	margin:0;
	background:linear-gradient(180deg,#ebf5ff,#dfefff);
	border-top:1px solid #e6edf8;
}

.map-page{
	padding-top:28px;
	padding-bottom:40px;
}

.modal-backdrop{
	display:none;
	position:fixed;
	inset:0;
	background:rgba(15,23,42,0.46);
	z-index:2000;
	align-items:center;
	justify-content:center;
	padding:18px;
}

.modal-card{
	background:#fff;
	padding:20px;
	border-radius:8px;
	max-width:560px;
	width:100%;
	box-shadow:0 20px 40px rgba(15,23,42,.22);
}

.modal-actions{
	display:flex;
	gap:8px;
	justify-content:flex-end;
	margin-top:12px;
}

.modal-actions .btn{
	width:auto;
	margin-top:0;
}

.muted{color:#666}

/* Pulse for new incidents (used as fallback decoration) */
.marker-pulse{position:relative}
.marker-pulse:after{content:'';position:absolute;left:50%;top:50%;width:18px;height:18px;margin-left:-9px;margin-top:-9px;border-radius:50%;background:rgba(255,69,0,0.18);animation:pulse 1.6s ease-out infinite}
@keyframes pulse{0%{transform:scale(0.6);opacity:1}100%{transform:scale(2.4);opacity:0}}

.streetguard-map-popup{min-width:190px;color:#102a4c;font:14px/1.45 Inter,system-ui,sans-serif}.streetguard-map-popup strong{display:block;font-size:15px}.streetguard-map-popup p{margin:8px 0;color:#475569}.streetguard-map-popup small{color:#687386}.map-popup-source{display:inline-block;margin-top:6px;padding:3px 7px;border-radius:999px;background:#eaf3ff;color:#0752b8;font-size:11px;font-weight:800}
.streetguard-leaflet-pin{background:transparent!important;border:0!important}.streetguard-leaflet-pin span{width:20px;height:20px;display:block;border:3px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 3px 8px rgba(15,23,42,.3)}
.mobile-map-intro,.mobile-map-legend{display:none}
@media(max-width:900px){
  .mobile-map-page{margin:0!important;max-width:none!important;padding:0 14px 88px!important;background:#f5f7fa!important}.mobile-map-page .page-heading{display:none}.mobile-map-intro{margin:0 -14px;padding:22px 18px 18px;background:#0752b8;color:#fff;display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.mobile-map-intro span{color:#bcd7ff;font-size:.68rem;font-weight:800;letter-spacing:.12em}.mobile-map-intro h1{margin:5px 0 7px;font:800 1.45rem/1.15 Inter,system-ui,sans-serif}.mobile-map-intro p{max-width:290px;margin:0;color:#dceaff;font: .82rem/1.45 Inter,system-ui,sans-serif}.mobile-map-intro button{width:44px;height:44px;flex:0 0 auto;border:0;border-radius:15px;background:#fff;color:#0752b8;font-size:26px;cursor:pointer;box-shadow:0 8px 18px rgba(0,0,0,.14)}.mobile-map-legend{margin:0 -2px;padding:12px 4px;display:flex;gap:12px;overflow:auto;color:#475569;font:700 .72rem Inter,system-ui,sans-serif}.mobile-map-legend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}.mobile-map-legend i{width:10px;height:10px;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px rgba(15,23,42,.15)}.pin-accident{background:#dc2626}.pin-hazard{background:#f97316}.pin-user{background:#0752b8}.map-shell{border:0;border-radius:22px;box-shadow:0 10px 24px rgba(17,42,76,.08)}.map-panel{padding:14px;border:0}.map-status-grid{grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:10px}.map-status{padding:10px;border:0;border-radius:14px;background:#eef5ff}.map-status:nth-child(2){background:#fff1e7}.map-status:nth-child(3){background:#e9f9f1}.map-status strong{font-size:16px}.map-status span{font-size:10px}.route-form{grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}.route-form input{grid-column:span 2;padding:12px;border-radius:12px;border:1px solid #dbe5f0}.route-form .btn{padding:12px 8px;border-radius:12px;font-size:.78rem}.map-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:8px}.map-controls .btn{width:100%;padding:11px 6px;border-radius:12px;font-size:.72rem}.route-notice,.route-alert{font-size:.78rem}.nearby-accident-alert{margin:10px 12px 0;padding:12px}.nearby-alert-popup__content{border-radius:22px}#map{height:48vh;min-height:340px;max-height:520px}.modal-card{border-radius:22px}.modal-actions .btn{border-radius:12px}
}

@media(max-width:800px){
	.route-form{grid-template-columns:1fr}
	.map-controls{display:grid;grid-template-columns:1fr 1fr}
	.map-controls .btn,
	.route-form .btn{width:100%}
	#map{height:520px}
}

/* StreetGuard resident map: reference-inspired mobile layout. */
.map-reference-hero,.map-safety-filter,.map-quick-actions,.map-category-filter{display:none}
@media(max-width:900px){
  .mobile-map-page{padding:0 14px 88px!important;background:#f5f7fa!important}.map-reference-hero{position:relative;min-height:174px;margin:0 -14px 0;padding:25px 18px 18px;overflow:hidden;display:block;border-radius:0 0 28px 28px;background:#fff}.map-reference-hero>div{position:relative;z-index:1;max-width:220px}.map-reference-hero span{color:#687386;font:800 .68rem/1 Inter,system-ui,sans-serif;letter-spacing:.1em}.map-reference-hero h1{margin:8px 0 10px;color:#102a4c;font:800 1.48rem/1.13 Inter,system-ui,sans-serif}.map-reference-hero p{margin:0;color:#5d6b7e;font:500 .82rem/1.48 Inter,system-ui,sans-serif}.map-reference-hero svg{position:absolute;right:-5px;bottom:0;width:52%;height:auto}.map-safety-filter{width:100%;min-height:58px;margin:14px 0;padding:0 17px;border:0;border-radius:16px;background:#f47b20;color:#fff;display:flex;align-items:center;gap:8px;text-align:left;font:800 .83rem Inter,system-ui,sans-serif;box-shadow:0 9px 17px rgba(244,123,32,.21)}.map-safety-filter span{font-size:23px}.map-safety-filter b{margin-left:auto;font-size:27px;font-weight:400}.map-shell{position:relative;overflow:hidden;border:0;border-radius:22px;background:#fff;box-shadow:0 10px 25px rgba(17,42,76,.08)}.map-panel{padding:14px 12px 0;border:0}.map-status-grid{margin-bottom:12px;gap:8px}.map-status{min-height:102px;padding:14px 9px 11px;text-align:center;border-radius:15px;display:flex;flex-direction:column;align-items:center}.map-status::before{width:30px;height:30px;margin-bottom:5px;display:grid;place-items:center;border-radius:50%;font-size:18px;font-weight:900}.map-status:nth-child(1)::before{content:'⌖';background:#dceeff;color:#0752b8}.map-status:nth-child(2)::before{content:'!';background:#ffe2cc;color:#f47b20}.map-status:nth-child(3)::before{content:'◎';background:#d9f3e7;color:#15935d}.map-status strong{margin-top:2px;color:#102a4c;font:800 1.26rem Inter,system-ui,sans-serif}.map-status::after{content:'Current';color:#687386;font:600 .67rem Inter,system-ui,sans-serif}.map-status:nth-child(2)::after{content:'Reported'}.map-status:nth-child(3)::after{content:'Status'}.route-form{display:none}.map-controls{position:absolute;z-index:500;right:14px;bottom:84px;display:grid;grid-template-columns:1fr;gap:10px;margin:0}.map-controls .btn{display:none}.map-controls #locateBtn,.map-controls #addHazardBtn{width:54px;height:54px;padding:0;border-radius:50%;background:#fff!important;color:#0752b8!important;box-shadow:0 7px 17px rgba(17,42,76,.17);font-size:0}.map-controls #locateBtn::after{content:'⌖';font-size:30px}.map-controls #addHazardBtn::after{content:'⚙';font-size:23px}.route-notice,.route-alert{position:relative;z-index:2;margin:7px 12px;font-size:.74rem}#map{height:468px;min-height:468px;background:#e8f0f5}.map-category-filter{position:absolute;z-index:450;right:12px;bottom:14px;left:12px;padding:8px;display:grid;grid-template-columns:repeat(4,1fr);gap:5px;border-radius:17px;background:#fff;box-shadow:0 8px 22px rgba(17,42,76,.16)}.map-category-filter button{min-height:43px;padding:4px 3px;border:0;border-radius:11px;background:transparent;color:#32465f;font:800 .67rem Inter,system-ui,sans-serif}.map-category-filter button.active{background:#0752b8;color:#fff}.map-category-filter button:nth-child(2){color:#e87319}.map-category-filter button:nth-child(3){color:#d8323b}.map-category-filter button:nth-child(4){color:#788594}.map-category-filter button.active{color:#fff}.map-category-filter span{display:block;margin-top:2px}.map-quick-actions{margin:14px 0 0;padding:18px 14px;display:block;border-radius:21px;background:#fff;box-shadow:0 8px 20px rgba(17,42,76,.06)}.map-quick-actions h2{margin:0 0 14px;color:#102a4c;font:800 1.1rem Inter,system-ui,sans-serif}.map-quick-actions>div{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.map-quick-actions button{min-height:64px;padding:7px 3px;border:0;border-radius:12px;color:#153252;font:800 .65rem/1.2 Inter,system-ui,sans-serif;cursor:pointer}.map-quick-actions button:nth-child(1){background:#fff0f2;color:#b63245}.map-quick-actions button:nth-child(2){background:#eaf3ff;color:#0752b8}.map-quick-actions button:nth-child(3){background:#fff3e4;color:#dd751a}.map-quick-actions button:nth-child(4){background:#fff0f2;color:#b63245}.map-quick-actions button:first-letter{font-size:21px}.map-quick-actions span{display:block;margin-top:5px}.leaflet-control-zoom{display:none}.leaflet-container{font-family:Inter,system-ui,sans-serif}
  .mobile-user-page:has(.mobile-map-page) #sidebarToggle{display:block!important;background:transparent!important}
  html[data-theme="dark"] .mobile-map-page{background:#101b2b!important}html[data-theme="dark"] .map-reference-hero,html[data-theme="dark"] .map-shell,html[data-theme="dark"] .map-quick-actions,html[data-theme="dark"] .map-category-filter{background:#17263a!important}html[data-theme="dark"] .map-reference-hero h1,html[data-theme="dark"] .map-quick-actions h2{color:#edf5ff}html[data-theme="dark"] .map-reference-hero p{color:#aabbd0}html[data-theme="dark"] .map-category-filter button{color:#c4d2e2}html[data-theme="dark"] .map-category-filter button.active{background:#2d70c4;color:#fff}
}
