:root {
	--panel-width: 440px;
	--border-color: #d9d9d9;
	--soft-bg: #f7f7f7;
	--card-bg: #ffffff;
	--text-main: #222;
	--text-sub: #666;
}

html, body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	font-family: sans-serif;
	color: var(--text-main);
}

#app {
	display: flex;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

#map-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
}

#map {
	width: 100%;
	height: 100%;
}

#toolbar {
	position: absolute;
	top: 12px;
	right: 12px;
	left: auto;
	width: max-content;
	max-width: calc(100% - 24px);
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: stretch;
	justify-content: flex-end;
	pointer-events: none;
}

.toolbar-card {
	pointer-events: auto;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border-radius: 6px;

	border: 0px solid var(--border-color);
	padding: 0px 0px;

	display: flex;
	flex-direction: column;
}

.control-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

label {
	font-size: 14px;
	font-weight: 600;
}

select, button {
	font-size: 14px;
	padding: 6px 10px;
}

#year-filter-card {
	;
}

.menu-select-wrap {
	position: relative;
}

.menu-select-btn {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-width: 135px;
	height: 34px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #bbb;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	padding: 6px 10px;
}

.menu-select-label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

#year-select-label,
#basemap-select-label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.menu-select-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 20;
	display: none;
	min-width: 150px;
	max-height: 260px;
	overflow: auto;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.menu-select-menu.is-open {
	display: block;
}

.menu-option {
	display: flex;
	align-items: center;
	gap: 7px;
	width: 100%;
	box-sizing: border-box;
	border: none;
	background: transparent;
	padding: 7px 8px;
	text-align: left;
	border-radius: 6px;
	cursor: pointer;
}

.menu-option:hover,
.menu-option.is-selected {
	background: #eef2f7;
}

.year-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
	flex: 0 0 auto;
}

.year-swatch.is-empty {
	background: #fff;
}

#side {
	width: var(--panel-width);
	max-width: 48vw;
	border-left: 1px solid var(--border-color);
	box-sizing: border-box;
	padding: 16px;
	overflow: auto;
	background: var(--soft-bg);
}

#side h2 {
	margin: 0 0 12px 0;
	font-size: 20px;
}

#detail {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.card {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 6px;
	padding: 12px;
}

.card h3 {
	margin: 0 0 10px 0;
	font-size: 16px;
}

.card #year {
	font-size: 1.1em;
}

.meta-grid {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 8px 10px;
	font-size: 14px;
}

.meta-grid dt {
	margin: 0;
	color: var(--text-sub);
	font-weight: 700;
}

.meta-grid dd {
	margin: 0;
	word-break: break-word;
}

.section-title {
	margin: 0 0 8px 0;
	font-size: 15px;
	font-weight: 700;
}

.table-wrap {
	overflow: auto;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	background: #fff;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

th, td {
	border-bottom: 1px solid #e9e9e9;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

th {
	position: sticky;
	top: 0;
	background: #f2f4f7;
	z-index: 1;
	font-weight: 700;
}

tr:last-child td {
	border-bottom: none;
}

.note {
	font-size: 13px;
	color: var(--text-sub);
}

.empty {
	color: var(--text-sub);
	line-height: 1.7;
}

.error {
	color: #b00020;
	white-space: pre-wrap;
}


@media (max-width: 900px) {
	#app {
		flex-direction: column;
	}

	#map-wrap {
		height: 58vh;
		min-height: 320px;
	}

	#side {
		width: 100%;
		max-width: none;
		height: 42vh;
		border-left: none;
		border-top: 1px solid var(--border-color);
	}
	#toolbar {
		right: 12px;
		left: auto;
		width: max-content;
		max-width: calc(100% - 24px);
	}
}

@media (max-width: 560px) {
	#toolbar {
		left: auto;
		right: 10px;
		top: 10px;
		width: max-content;
		max-width: calc(100% - 20px);
		gap: 8px;
	}

	.toolbar-card {
		;

		padding: 8px 10px;

	}

	.meta-grid {
		grid-template-columns: 92px 1fr;
		font-size: 13px;
	}

	table {
		font-size: 13px;
	}

	th, td {
		padding: 7px 8px;
	}
}

#splitter {
	flex: 0 0 6px;
	width: 6px;
	background: rgba(0,0,0,0.12);
	cursor: col-resize;
}

#splitter:hover {
	background: rgba(0,0,0,0.22);
}

@media (max-width: 900px) {
	#splitter {
		width: 100%;
		height: 6px;
		flex: 0 0 6px;
		cursor: row-resize;
	}

	#map-wrap {
		height: 58vh;
	}

	#side {
		height: calc(42vh - 6px);
	}
}

#title {
	position: absolute;
	z-index: 700;
	top: 11px;
	left: 11px;
	padding: 10px 10px 10px 10px;
	font: normal 12x Helvetica,Arial,Meiryo,sans-serif;
	white-space: nowrap;
	text-align:center;
	color: white;
	background: rgba(40,100,230,0.8);
	border-radius: 3px;
}
#title h1 {
	font: normal 16px Helvetica,Arial,Meiryo,sans-serif;
	margin: 0 0 0 0;
}
#title a {
	text-decoration: none;
}
#title a:link {
	color: white;
}
#title a:visited {
	color: white;
}
