:root {
	--primary: #005CAF; 
	--white: #ffffff;
	--text-main: #333333; 
	--text-light: #666666;
	--bg-panel: #ffffff;
	--border-color: #005CAF;
	--border-light: #dddddd; 
	--bg-light: #f7f9fa; 
	--active-bg: #e6f0fa;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: 'Noto Sans JP', sans-serif;
	color: var(--text-main); 
}

body, html {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: #e5e5e5;
}

#map {
	position: absolute;
	top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1;
}

.lang-btn {
	position: absolute;
	top: 20px; right: 20px; z-index: 2000;
	padding: 8px 16px; font-weight: bold;
}

#control-panel {
	position: absolute; z-index: 1000;
	background-color: var(--bg-panel);
	border: 3px solid var(--border-color);
	display: flex; flex-direction: column;
	box-shadow: none;
}

.app-title {
	font-family: 'Black Ops One', system-ui;
	color: var(--primary);
	text-align: center;
	font-size: 28px;
	padding: 15px 0;
	border-bottom: 1px solid var(--border-light); 
	background-color: var(--bg-light); 
	letter-spacing: 1px;
}

.tabs {
	display: flex;
	border-bottom: 2px solid var(--border-color);
	background: var(--white);
	flex-shrink: 0;
}

.tab-btn {
	flex: 1; background: var(--white); color: var(--primary);
	border: none; border-right: 1px solid var(--border-light);
	padding: 12px 0; font-weight: bold; cursor: pointer;
	font-size: 14px; transition: none;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { background: var(--primary); color: var(--white); }

.tab-content {
	display: none; padding: 15px; overflow-y: auto; flex: 1;
}
.tab-content.active { display: flex; flex-direction: column; }

.btn-group { display: flex; gap: 8px; }
.divider { border-top: 1px dashed var(--border-light); margin: 15px 0; }
.category-header {
	display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px;
}
.category-title { font-weight: bold; font-size: 14px; color: var(--primary); }
.category-desc { font-size: 11px; color: var(--text-light); }

input[type="text"] {
	width: 100%; padding: 12px; border: 2px solid var(--border-light); 
	font-size: 16px; margin-bottom: 10px; outline: none;
	color: var(--text-main); border-radius: 0; transition: border-color 0.2s;
}
input[type="text"]:focus { background-color: var(--active-bg); border-color: var(--primary); }

.flat-btn {
	background-color: var(--primary); color: var(--white) !important; 
	border: 2px solid var(--primary); padding: 12px;
	font-size: 14px; font-weight: bold; cursor: pointer;
	text-align: center; text-decoration: none; display: inline-block; border-radius: 0;
}
.flat-btn:disabled {
	background-color: var(--border-light); border-color: var(--border-light);
	color: #999999 !important; cursor: not-allowed;
}
.flat-btn:not(:disabled):active { background-color: var(--white); color: var(--primary) !important; }
.flat-btn.outline { background-color: var(--white); color: var(--primary) !important; }
.flat-btn.outline:not(:disabled):active { background-color: var(--primary); color: var(--white) !important; }
.flat-btn.small { padding: 6px 10px; font-size: 12px; border-width: 2px; }
.full-width { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.mt-10 { margin-top: 10px; }

.chip-container { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
	border: 1px solid var(--border-light); border-radius: 999px;
	padding: 6px 14px; font-size: 12px; background: var(--bg-light);
	color: var(--text-main); font-weight: bold; cursor: pointer; user-select: none;
}
.chip.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.results-list, .saved-list {
	margin-top: 15px; display: flex; flex-direction: column; gap: 8px;
}
.result-item, .saved-item {
	border: 1px solid var(--border-light); border-left: 4px solid var(--primary); 
	padding: 10px; background: var(--white); cursor: pointer; border-radius: 0;
}
.result-item:hover, .saved-item:hover { background: var(--bg-light); }
.result-item.active, .saved-item.active {
	background: var(--primary) !important; border-color: var(--primary) !important;
}
.result-item.active .item-title, .saved-item.active .item-title,
.result-item.active .item-sub, .saved-item.active .item-sub { color: var(--white) !important; }
.item-title {
	font-weight: bold; color: var(--text-main); font-size: 14px;
	margin-bottom: 3px; word-break: break-all;
}
.item-sub { font-size: 11px; color: var(--text-light); word-break: break-all; }

.panel-footer {
	padding: 10px; text-align: center; font-size: 12px;
	border-top: 1px solid var(--border-light); background: var(--bg-light); flex-shrink: 0;
}
.panel-footer a { color: var(--primary); text-decoration: none; font-weight: bold; }

.modal-overlay {
	display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(51, 51, 51, 0.8); z-index: 3000; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
	background: var(--white); border: 3px solid var(--primary);
	width: 90%; max-width: 500px; max-height: 80vh; padding: 20px;
	display: flex; flex-direction: column; border-radius: 0;
}
.modal-content h2 {
	color: var(--primary); border-bottom: 1px solid var(--border-light);
	padding-bottom: 8px; margin-bottom: 12px; font-size: 18px;
}
.modal-body {
	overflow-y: auto; font-size: 13px; line-height: 1.6; color: var(--text-main);
	flex: 1; white-space: pre-wrap;
}

.leaflet-popup-content-wrapper {
	border: 3px solid var(--primary) !important; border-radius: 0 !important;
	background: var(--white) !important; box-shadow: 0 4px 10px rgba(51, 51, 51, 0.2) !important; 
}
.leaflet-popup-tip { background: var(--primary) !important; box-shadow: none !important; }
.custom-popup h3 {
	margin: 0 0 4px 0; color: var(--primary); font-size: 15px; font-weight: bold;
	border-bottom: 1px solid var(--border-light); padding-bottom: 5px;
}
.custom-popup p { margin: 5px 0 10px 0; font-size: 11px; color: var(--text-light); }
.popup-actions { display: flex; gap: 4px; margin-bottom: 8px; }

/* ▼ Leaflet標準UIの位置調整（パネル被り防止） */
@media (min-width: 769px) {
	#control-panel { top: 20px; left: 20px; width: 380px; height: calc(100vh - 40px); }
	.leaflet-control-container .leaflet-left { left: 400px; }
}
@media (max-width: 768px) {
	#control-panel {
		bottom: 0; left: 0; width: 100vw; height: 50vh;
		border-bottom: none; border-left: none; border-right: none;
	}
	.app-title { font-size: 22px; padding: 8px 0; }
	.tab-btn { padding: 10px 0; font-size: 13px; }
	.tab-content { padding: 12px; }
	
	/* スマホ画面でパネルの上にズームボタンを退避させる */
	.leaflet-control-container .leaflet-bottom {
		bottom: 52vh !important; 
	}
}