.dm-map-layout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    min-height: 72vh;
    padding: 24px 0; /* top/bottom spacing for the whole block */
    margin: 0 0 24px; /* ensure bottom spacing is visible even if parent collapses */
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* prevent horizontal scroll when sidebar is off-canvas */
}

#dm-map {
	width: 100%;
	height: 72vh;
    background: linear-gradient(180deg, #fafafa 0%, #f2f2f2 100%);
	border: 1px solid #e6ebf5;
	border-right: none;
	border-radius: 14px 0 0 14px;
}

.dm-sidebar {
	border: 1px solid #e6ebf5;
	border-left: none;
	border-radius: 0 14px 14px 0;
	background: #ffffff;
	padding: 14px;
	overflow: auto;
	box-shadow: -4px 0 18px rgba(0,0,0,0.04);
    max-height: 72vh; /* keep sidebar scrollable instead of page overflow on desktop */
}

.dm-sidebar-header {
	display: grid;
	gap: 10px;
	margin-bottom: 10px;
}
.dm-sidebar-header h3 {
	margin: 0;
    font-size: 18px;
    color: #443C39;
}
#dm-search {
	border: 1px solid #d8e0ee;
	border-radius: 10px;
	padding: 10px 12px;
	width: 100%;
	outline: none;
	box-shadow: 0 1px 0 rgba(0,0,0,0.02) inset;
	background: #fafafa url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23443C39" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
	padding-left: 38px;
}
#dm-search:focus,
#dm-search:focus-visible {
    border-color: #443C39;
    box-shadow: 0 0 0 3px rgba(68,60,57,0.15);
}

#dm-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}
.dm-list-item {
	border: 1px solid #e6ebf5;
	border-radius: 12px;
	padding: 12px;
	cursor: pointer;
	transition: box-shadow .2s ease, transform .05s ease, border-color .2s ease;
	background: #fff;
}
.dm-list-item:hover {
	box-shadow: 0 6px 18px rgba(0,0,0,0.06);
	transform: translateY(-1px);
}
.dm-list-item.active {
    border-color: #443C39;
    background: linear-gradient(180deg, #fbf9f8 0%, #f4f1f0 100%);
}
.dm-list-title {
	font-weight: 600;
    color: #443C39;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.dm-list-sub {
	color: #5b6b85;
	font-size: 12px;
	margin-top: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.dm-infowindow h3 {
	margin: 0 0 6px;
    font-size: 16px;
    color: #443C39;
}
.dm-infowindow .dm-address,
.dm-infowindow .dm-desc {
	font-size: 13px;
	color: #36465d;
	margin-top: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.dm-infowindow a { word-break: break-word; overflow-wrap: anywhere; }

/* Custom scrollbar */
.dm-sidebar::-webkit-scrollbar { width: 10px; }
.dm-sidebar::-webkit-scrollbar-thumb { background: #dadfe8; border-radius: 8px; }
.dm-sidebar::-webkit-scrollbar-thumb:hover { background: #c7cfdb; }

.dm-sidebar-toggle {
	display: none;
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	border: none;
    background: #443C39;
	color: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	cursor: pointer;
    box-shadow: 0 4px 12px rgba(68,60,57,0.35);
}

/* Mobile */
@media (max-width: 900px) {
	.dm-map-layout {
        grid-template-columns: 1fr;
        padding: 16px 0; /* smaller vertical padding on mobile */
        overflow: hidden; /* ensure off-canvas sidebar doesn't trigger horizontal scroll */
	}
	#dm-map {
		height: 60vh;
		border-radius: 14px;
		border-right: 1px solid #e6ebf5;
	}
	.dm-sidebar {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		transform: translateX(-100%);
		transition: transform .2s ease;
		border-radius: 14px;
		background: rgba(255,255,255,0.98);
		backdrop-filter: blur(2px);
	}
	.dm-sidebar.open {
		transform: translateX(0);
	}
	.dm-sidebar-toggle {
		display: inline-block;
	}
}


