:root {
	--bg: #0f1720;
	--panel: #182230;
	--text: #e8eef5;
	--muted: #9aacbf;
	--accent: #3d9eea;
	--line: #2a3b4d;
	font-family: "Pretendard", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }

.app-header {
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	border-bottom: 1px solid var(--line);
	background: #121c28;
}
.app-header h1 { font-size: 16px; font-weight: 650; margin: 0; }

.basemap-switch button {
	background: #243447;
	color: var(--text);
	border: 1px solid var(--line);
	padding: 6px 12px;
	cursor: pointer;
}
.basemap-switch button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.layout {
	display: grid;
	grid-template-columns: 280px 1fr 320px;
	height: calc(100% - 52px);
}
.sidebar, .inspector {
	overflow: auto;
	padding: 12px 14px;
	background: var(--panel);
	border-right: 1px solid var(--line);
}
.inspector { border-right: 0; border-left: 1px solid var(--line); }
.sidebar h2, .inspector h2 { font-size: 13px; margin: 0 0 8px; letter-spacing: 0.02em; }
.sidebar-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}
.sidebar-heading h2 { margin: 0; }
.table-name-toggle {
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--muted);
	font-size: 11px;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
}
.table-name-toggle input { margin: 0; }
.hint, #inspector-empty { color: var(--muted); font-size: 12px; line-height: 1.45; }

.group { margin-bottom: 12px; }
.group-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--accent);
	margin-bottom: 6px;
	font-weight: 650;
	cursor: pointer;
}
.group-title input { margin: 0; }
.layer-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin: 4px 0; padding-left: 6px; }
.layer-item input { margin-top: 3px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; margin-top: 4px; flex: 0 0 10px; }
.layer-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.layer-table {
	display: none;
	color: var(--muted);
	font-size: 11px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	word-break: break-all;
	line-height: 1.3;
}
.sidebar.show-table-names .layer-table { display: block; }

.map-wrap { position: relative; }
#map { width: 100%; height: 100%; }
.map-loading {
	display: none;
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 32, 0.38);
	z-index: 20;
	pointer-events: none;
}
.map-loading.is-visible { display: flex; }
.map-loading-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 180px;
	padding: 18px 22px 16px;
	background: rgba(18, 28, 40, 0.92);
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.map-loading-spinner {
	width: 48px;
	height: 48px;
	border: 5px solid #2a3b4d;
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: map-loading-spin 0.9s linear infinite;
}
.map-loading-title {
	margin: 6px 0 0;
	font-size: 14px;
	font-weight: 650;
}
.map-loading-sub {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
}
.map-loading-names {
	margin: 4px 0 0;
	max-width: 240px;
	font-size: 11px;
	color: var(--accent);
	text-align: center;
	line-height: 1.4;
}
@keyframes map-loading-spin {
	to { transform: rotate(360deg); }
}
.map-status {
	position: absolute;
	left: 12px;
	bottom: 12px;
	background: rgba(15, 23, 32, 0.82);
	padding: 6px 10px;
	font-size: 12px;
	border-radius: 4px;
	pointer-events: none;
}

.attr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.attr-table th, .attr-table td { border-bottom: 1px solid var(--line); padding: 6px 4px; vertical-align: top; }
.attr-table th { color: var(--muted); width: 42%; text-align: left; font-weight: 500; }
.record-block { margin-bottom: 16px; }
.record-title { font-size: 13px; margin: 0 0 6px; }

@media (max-width: 1100px) {
	.layout { grid-template-columns: 240px 1fr; }
	.inspector { display: none; }
}
