/* ============================================================
   ハイウェイラジオ 受信マップ アプリ
   サイト (css/style.css, css/dark.css) のデザインを踏襲
   ============================================================ */

:root {
	--bg: #ffffff;
	--text: #333333;
	--muted: #666666;
	--surface: #ffffff;
	--surface-2: #f4f6f4;
	--surface-3: #f8faf8;
	--border: #e5e5e5;
	--border-2: #d0d5d0;
	--accent: #006432;
	--accent-2: #237447;
	--accent-soft: #eaf5ee;
	--accent-soft-2: #f0f5f0;
	--link: #0645ad;
	--header-bg: #006432;
	--header-text: #ffffff;
	--footer-bg: #3f463f;
	--footer-text: #cccccc;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
	--danger: #dc3545;
	--warning: #b8860b;
	--ok: #28a745;
	--radius: 16px;
}

html.dark {
	--bg: #0e1a14;
	--text: #e0e0e0;
	--muted: #a0b8a4;
	--surface: #121a16;
	--surface-2: #0f1712;
	--surface-3: #131d18;
	--border: #2a3a2e;
	--border-2: #3a5a3e;
	--accent: #66bb6a;
	--accent-2: #81c784;
	--accent-soft: #1a2a1e;
	--accent-soft-2: #1a221e;
	--link: #66bb6a;
	--header-bg: #006432;
	--header-text: #ffffff;
	--footer-bg: #1a221e;
	--footer-text: #a0b8a4;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	--shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: "JetBrains Mono", "IBM Plex Sans JP", "Noto Serif Hentaigana", sans-serif;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition: background 0.2s, color 0.2s;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	font-weight: bold;
}

img {
	max-width: 100%;
	border-radius: 5px;
}

.leaflet-container img {
	border-radius: 0;
}

h1 {
	font-size: 1.3rem;
	margin: 6px 0;
}

h2 {
	font-size: 1.1rem;
	margin: 18px 0 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

h3 {
	font-size: 1rem;
}

small {
	color: var(--muted);
}

.hidden { display: none !important; }

/* ============ ヘッダー（常にスマホUI） ============ */

.app-header {
	background: var(--header-bg);
	color: var(--header-text);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	position: sticky;
	top: 0;
	z-index: 1001;
	padding-top: env(safe-area-inset-top, 0px);
}

.app-header .header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 16px;
}

.app-header .logo img {
	height: 44px;
	width: auto;
	display: block;
}

.hamburger {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
}

.hamburger-line {
	display: block;
	width: 24px;
	height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.active .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: rgba(0, 80, 50, 0.92);
	backdrop-filter: blur(10px);
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s ease;
	z-index: 999;
}

.navbar.open { max-height: 700px; }

.nav-menu {
	list-style: none;
	display: flex;
	flex-direction: column;
}

.nav-menu li {
	flex: none;
	width: 100%;
}

.nav-menu a {
	display: block;
	padding: 14px 20px;
	color: #fff;
	text-decoration: none;
	font-size: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	transition: background 0.25s;
	text-align: left;
}

.nav-menu a:hover { background: rgba(255, 255, 255, 0.075); }

.nav-menu a.active {
	background: rgba(255, 255, 255, 0.18);
	font-weight: bold;
}

.nav-menu a i {
	width: 1.6em;
	text-align: center;
}

/* お知らせ未読バッジ */
.nav-badge {
	display: inline-block;
	min-width: 20px;
	height: 20px;
	line-height: 20px;
	padding: 0 6px;
	margin-left: 8px;
	background: #ec2d23;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	border-radius: 10px;
	text-align: center;
	vertical-align: middle;
}

/* hidden 属性は author スタイルの display に負けるため明示する */
.nav-badge[hidden] {
	display: none;
}

/* ============ メイン ============ */

.app-main {
	flex: 1;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 10px 12px 30px;
}

.view-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.view-title i { color: var(--accent); }

.lead {
	font-size: 0.85rem;
	color: var(--muted);
	line-height: 1.6;
	margin-bottom: 10px;
}

/* ============ フッター ============ */

.app-footer {
	background: var(--footer-bg);
	color: var(--footer-text);
	padding: 14px 16px 24px;
	margin-top: 24px;
}

.app-footer .footer-inner {
	max-width: 900px;
	margin: 0 auto;
	text-align: center;
}

.app-footer .footer-links {
	list-style: none;
	display: flex;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.app-footer .footer-links a {
	color: #ddd;
	font-size: 0.9rem;
}

html.dark .app-footer .footer-links a { color: #a5d6a7; }

.app-footer .copyright {
	font-size: 0.72rem;
	color: var(--footer-text);
	border-top: 1px solid rgba(128, 128, 128, 0.3);
	padding-top: 12px;
	margin-top: 12px;
}

/* 放送確認エリア（フッター内） */
.reception-zone {
	margin: 10px auto 0;
	max-width: 620px;
}

.reception-card {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 14px;
	padding: 12px 14px;
	color: #fff;
	text-align: left;
}

.reception-card h3 {
	font-size: 0.95rem;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 7px;
}

.reception-card p {
	font-size: 0.8rem;
	opacity: 0.9;
	margin-bottom: 8px;
}

.reception-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ============ カード・タイル ============ */

.tile {
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--border);
	padding: 16px;
	display: block;
	position: relative;
	transition: box-shadow 0.2s, filter 0.2s;
}

a.tile:hover { box-shadow: var(--shadow-lg); filter: brightness(0.94); }
a.tile:active { filter: brightness(0.88); box-shadow: var(--shadow); }

.tile h3 { margin-bottom: 8px; color: var(--text); }
.tile p { font-size: 0.87rem; color: var(--muted); line-height: 1.5; }

.tile-container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin: 10px 0;
}

@media (min-width: 640px) {
	.tile-container.cols-2 { grid-template-columns: 1fr 1fr; }
}

/* 局カード（トピック風） */
.station-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px;
	flex-wrap: wrap;
	position: relative; /* ★の配置基準 */
}

.station-card .thumbnail {
	width: 96px;
	height: 72px;
	border-radius: 10px;
	flex-shrink: 0;
	background: var(--accent-soft-2);
	object-fit: cover;
}

.station-card .info {
	flex: 1 1 160px;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.station-card .info h3 {
	flex: 1;
	min-width: 0;
	font-size: 1.15rem;
	margin: 0;
	word-break: keep-all;
	overflow-wrap: break-word;
}

.station-card .icon-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	font-size: 1.3rem;
	color: var(--muted);
	min-width: 34px;
}

.station-card .icon-info i { color: var(--accent); }
.station-card .icon-info span { font-weight: 600; font-size: 1.5rem; color: var(--text); }

.station-card .station-meta {
	flex: 1 1 100%;
	min-width: 160px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.8rem;
	color: var(--muted);
}

.station-card .station-meta .road {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* お気に入り★（カード右上） */
.fav-star {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: rgba(255, 255, 255, 0.75);
	font-size: 1rem;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.fav-star:hover { transform: scale(1.1); }
.fav-star:active { transform: scale(0.92); }
.fav-star.active {
	color: #ffc107;
	background: rgba(0, 0, 0, 0.5);
}

/* ============ バッジ ============ */

.badge {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 600;
	margin: 1px;
	vertical-align: middle;
	white-space: nowrap;
}

.badge.status-0 { background: #d4edda; color: #155724; }
.badge.status-1 { background: #fff3cd; color: #856404; }
.badge.status-2 { background: #e2e3e5; color: #383d41; }
.badge.status--1 { background: #f8d7da; color: #721c24; }
.badge.status--2 { background: #e2e3e5; color: #6c757d; }
.badge.status-3 { background: #cce5ff; color: #004085; }
.badge.data--1 { background: #fff3cd; color: #856404; }
.badge.data-0 { background: #d4edda; color: #155724; }

html.dark .badge.status-0 { background: #1e3a1e; color: #c8e6c9; }
html.dark .badge.status-1 { background: #4a3a1e; color: #ffe0b2; }
html.dark .badge.status-2 { background: #2a2a2a; color: #ccc; }
html.dark .badge.status--1 { background: #4a1e1e; color: #ef9a9a; }
html.dark .badge.status--2 { background: #2a2a2a; color: #aaa; }
html.dark .badge.status-3 { background: #1e3a4a; color: #b3e5fc; }
html.dark .badge.data--1 { background: #4a3a1e; color: #ffe0b2; }
html.dark .badge.data-0 { background: #1e3a1e; color: #c8e6c9; }

/* ============ ボタン ============ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 10px 18px;
	background: #388e3c;
	color: #fff;
	border: none;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, filter 0.2s;
	text-decoration: none;
	font-family: inherit;
}

.btn:hover { background: #43a047; font-weight: 600; }
.btn:active { filter: brightness(0.9); }

.btn.secondary {
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn.secondary:hover { background: var(--border); }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #c82333; }

.btn.blue { background: #1976d2; }
.btn.blue:hover { background: #1e88e5; }

.btn.block {
	display: flex;
	width: 100%;
}

.btn:disabled {
	background: #9e9e9e;
	cursor: not-allowed;
	opacity: 0.7;
}

.btn.small { padding: 6px 12px; font-size: 0.8rem; border-radius: 10px; }

/* ============ フォーム ============ */

.input,
select.input,
textarea.input {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--border-2);
	border-radius: 12px;
	font-size: 1rem;
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
select.input:focus,
textarea.input:focus {
	outline: none;
	border-color: var(--accent-2);
	box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.15);
}

html.dark .input:focus,
html.dark select.input:focus,
html.dark textarea.input:focus {
	box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.2);
}

label.field {
	display: block;
	margin: 10px 0 4px;
	font-size: 0.85rem;
	color: var(--muted);
}

/* スイッチ */
.switch-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
}

.switch-row:last-child { border-bottom: none; }

.switch-row .label {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.switch-row .label b { font-size: 0.95rem; }
.switch-row .label small { font-size: 0.75rem; color: var(--muted); }

.switch {
	position: relative;
	width: 52px;
	height: 28px;
	flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
	position: absolute;
	inset: 0;
	background: var(--border-2);
	border-radius: 28px;
	transition: 0.25s;
	cursor: pointer;
}

.switch .slider::before {
	content: "";
	position: absolute;
	width: 22px;
	height: 22px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: 0.25s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.switch input:checked + .slider { background: #388e3c; }
.switch input:checked + .slider::before { transform: translateX(24px); }

/* ============ ネイティブselect（base-select / ::picker） ============ */

select,
::picker(select) {
	appearance: base-select;
}

select::picker-icon {
	display: none;
}

select.input {
	cursor: pointer;
	background-image: url("/data/img/select.svg");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 1.1em;
	padding-right: 40px;
}

::picker(select) {
	border: 1.5px solid var(--border-2);
	border-radius: 14px;
	padding: 5px;
	background-color: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-lg);
}

option {
	padding: 7px 10px;
	transition: background 0.2s;
	border: 0;
	margin-top: 3px;
	background-color: var(--surface);
	color: var(--text);
	border-radius: 14px;
}

option:hover {
	background-color: var(--accent-soft);
	color: var(--accent-2);
	cursor: pointer;
}

select:has(option:disabled:checked) {
	color: #999;
}

option:disabled {
	color: #999;
	cursor: pointer;
}

option:checked {
	background-color: var(--accent-soft);
	color: var(--accent-2);
	cursor: pointer;
}

option:checked:disabled {
	filter: grayscale(0.9);
	cursor: pointer;
}

option::checkmark {
	font-weight: 900;
	font-family: var(--fa-family-classic, "Font Awesome 6 Free");
	content: "\f00c";
	margin-right: 4px;
}

/* ============ アラート ============ */

.alert {
	padding: 12px 4px;
	border-radius: 14px;
	font-size: 0.88rem;
	line-height: 1.55;
	margin: 10px 0;
	box-shadow: var(--shadow);
}

.alert.error { background: #dc3545; color: #fff; }
.alert.warning { background: #ffdb66; color: #000; }
.alert.success { background: #28a745; color: #fff; }
.alert.info { background: #23c1d9; color: #000; }

html.dark .alert.error { background: #a52a2a; color: #fff; }
html.dark .alert.warning { background: #8a6d1a; color: #fff; }
html.dark .alert.success { background: #2e7d32; color: #fff; }
html.dark .alert.info { background: #0f6b7a; color: #e0e0e0; }

/* ============ Top ============ */

.now-card { margin-top: 10px; }

.now-card.broadcasting { border-left: 5px solid #28a745; }
.now-card.approaching { border-left: 5px solid #e6950a; }
.now-card.none { border-left: 5px solid #9e9e9e; }

.now-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.82rem;
	font-weight: 700;
	padding: 3px 12px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.now-card.broadcasting .now-status { background: #d4edda; color: #155724; }
.now-card.approaching .now-status { background: #fff3cd; color: #856404; }
.now-card.none .now-status { background: #e2e3e5; color: #383d41; }

html.dark .now-card.broadcasting .now-status { background: #1e3a1e; color: #c8e6c9; }
html.dark .now-card.approaching .now-status { background: #4a3a1e; color: #ffe0b2; }
html.dark .now-card.none .now-status { background: #2a2a2a; color: #ccc; }

.map-frame {
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	background: var(--surface-2);
	margin: 12px 0;
}

#topMap {
	width: 100%;
	height: 320px;
	background: var(--surface-2);
}

.map-note { font-size: 0.72rem; color: var(--muted); margin: 4px 2px 0; }

/* ============ 検索 ============ */

.search-box {
	display: flex;
	gap: 8px;
	margin: 10px 0;
}

.search-box .input { flex: 1; }

.search-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.search-filters select.input { width: auto; flex: 1; min-width: 140px; font-size: 0.88rem; }

.result-count { font-size: 0.8rem; color: var(--muted); margin: 6px 2px; }

/* ============ 詳細 ============ */

.detail-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.detail-section {
	background: var(--surface-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px;
}

.detail-section h2 {
	margin-top: 0;
	border-bottom: 2px solid var(--accent);
	padding-bottom: 6px;
	margin-bottom: 10px;
	color: var(--text);
}

.detail-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.86rem;
}

.detail-table th,
.detail-table td {
	text-align: left;
	padding: 7px 8px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}

.detail-table th {
	width: 42%;
	color: var(--muted);
	font-weight: 600;
	white-space: nowrap;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td { border-bottom: none; }

.description-box {
	font-size: 0.88rem;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}

.official-link-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--accent-soft);
	border: 1px solid var(--accent-2);
	color: var(--accent-2);
	font-weight: 700;
}

html.dark .official-link-card {
	background: #15241a;
	border-color: #2e4a34;
	color: #a5d6a7;
}

.official-link-card i { font-size: 1.4rem; }
.official-link-card small { display: block; font-weight: 400; font-size: 0.75rem; }

/* ============ GPS ============ */

.gps-status-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 14px;
	margin: 8px 0;
	background: var(--surface-2);
	border: 1px solid var(--border);
	font-size: 0.88rem;
}

.gps-status-bar .led {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #9e9e9e;
	flex-shrink: 0;
}

.gps-status-bar.recording .led { background: #28a745; animation: pulse 1.2s infinite; }
.gps-status-bar.error .led { background: #dc3545; }

@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5); }
	50% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
}

.gps-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin: 10px 0;
}

.gps-stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 10px;
	text-align: center;
}

.gps-stat b { display: block; font-size: 1.15rem; }
.gps-stat span { font-size: 0.7rem; color: var(--muted); }

.audio-meter {
	position: relative;
	height: 10px;
	border-radius: 5px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	overflow: hidden;
	margin: 8px 0 2px;
}

.audio-meter .bar {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #1b7f3a, #6fd18f);
	transition: width 0.1s linear, background 0.2s linear;
}

/* 判定状態でメーターの色を変える */
.audio-meter .bar.noise { background: linear-gradient(90deg, #b23c3c, #e08b8b); }
.audio-meter .bar.silence { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.audio-meter .bar.unclear { background: linear-gradient(90deg, #b8860b, #e0c060); }
.audio-meter .bar.program, .audio-meter .bar.air { background: linear-gradient(90deg, #1b7f3a, #6fd18f); }

/* 放送判定のしきい値マーカー */
.audio-meter .threshold {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--text);
	opacity: 0.45;
}

.detect-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 6px 0 2px;
}

.detect-chips .chip {
	font-size: 0.7rem;
	padding: 3px 8px;
	border-radius: 15px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.detect-line {
	font-size: 0.78rem;
	color: var(--muted);
	margin: 2px 0 6px;
}

.recordings-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	margin-bottom: 8px;
	width: 100%;
	text-align: left;
	color: var(--text);
	font-size: 0.85rem;
}

.recordings-item .rec-icon { font-size: 1.3rem; color: var(--accent); }
.recordings-item .rec-meta { flex: 1; min-width: 0; }
.recordings-item .rec-meta b { display: block; font-size: 0.85rem; }
.recordings-item .rec-meta small { font-size: 0.7rem; }

.gps-hint-list { padding-left: 20px; font-size: 0.83rem; color: var(--muted); line-height: 1.7; }
.gps-hint-list li { margin-bottom: 4px; }

.rec-order-note { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

/* ============ マイページ ============ */

.profile-card {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 10px 0;
}

.profile-card .avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--surface-2);
	border: 2px solid var(--accent-2);
}

.profile-card .profile-info { flex: 1; min-width: 0; }
.profile-card .profile-info b { display: block; font-size: 1.15rem; }
.profile-card .profile-info small { display: block; font-size: 0.78rem; }

/* ============ 履歴 ============ */

.history-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	margin-bottom: 8px;
}

.history-item .h-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent-2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.15rem;
	flex-shrink: 0;
}

.history-item .h-body { flex: 1; min-width: 0; }
.history-item .h-body b { display: block; font-size: 0.9rem; }
.history-item .h-body small { font-size: 0.75rem; line-height: 1.5; display: block; }

.history-item .heard {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 20px;
	white-space: nowrap;
}

.history-item .heard.yes { background: #d4edda; color: #155724; }
.history-item .heard.no { background: #e2e3e5; color: #383d41; }
.history-item .heard.gps { background: #cce5ff; color: #004085; }

html.dark .history-item .heard.yes { background: #1e3a1e; color: #c8e6c9; }
html.dark .history-item .heard.no { background: #2a2a2a; color: #ccc; }
html.dark .history-item .heard.gps { background: #1e3a4a; color: #b3e5fc; }

/* ============ お知らせ ============ */

.notice-item {
	display: block;
	padding: 14px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin-bottom: 10px;
	transition: box-shadow 0.2s, filter 0.2s;
}

a.notice-item:hover { box-shadow: var(--shadow-lg); filter: brightness(0.94); }
a.notice-item:active { filter: brightness(0.88); }

.notice-item h3 {
	font-size: 1rem;
	margin: 0 0 6px 0;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 8px;
}

.notice-item h3 .unread-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #ec2d23;
	flex-shrink: 0;
}

.notice-item p {
	font-size: 0.85rem;
	color: var(--muted);
	margin: 0;
	line-height: 1.55;
}

.notice-item .notice-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 6px;
	font-size: 0.75rem;
	color: var(--muted);
}

.notice-type {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: 0.72rem;
	font-weight: 600;
	white-space: nowrap;
}

.notice-type.notice { background: #cce5ff; color: #004085; }
.notice-type.maintenance { background: #fff3cd; color: #856404; }
.notice-type.issue { background: #f8d7da; color: #721c24; }
.notice-type.alert { background: #dc3545; color: #fff; }

html.dark .notice-type.notice { background: #1e3a4a; color: #b3e5fc; }
html.dark .notice-type.maintenance { background: #4a3a1e; color: #ffe0b2; }
html.dark .notice-type.issue { background: #4a1e1e; color: #ef9a9a; }
html.dark .notice-type.alert { background: #8a1f1f; color: #ef9a9a; }

.notice-body {
	font-size: 0.9rem;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}

.notice-account-badge {
	background: #f0e6ff;
	color: #6a3ab2;
}

html.dark .notice-account-badge { background: #2e2550; color: #cbb3f5; }

/* ============ 設定・その他 ============ */

.settings-group {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 6px 16px;
	margin: 10px 0;
}

.about-logo {
	text-align: center;
	margin: 20px 0 10px;
}

.about-logo img {
	height: 70px;
	width: auto;
}

.about-logo h1 { margin-top: 10px; }

.about-body { font-size: 0.9rem; line-height: 1.75; }
.about-body h2 { margin-top: 22px; }
.about-body ul, .about-body ol { padding-left: 22px; }
.about-body li { margin: 5px 0; }

.about-body table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 8px 0; }
.about-body th, .about-body td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.about-body th { background: var(--surface-2); white-space: nowrap; }

.menu-tile {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 10px;
}

.menu-tile .m-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent-2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	flex-shrink: 0;
}

.menu-tile .m-body { flex: 1; min-width: 0; }
.menu-tile .m-body b { display: block; font-size: 0.95rem; }
.menu-tile .m-body small { font-size: 0.75rem; }
.menu-tile .m-arrow { color: var(--muted); }

/* ============ トースト ============ */

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(120px);
	background: #333;
	color: #fff;
	padding: 12px 20px;
	border-radius: 12px;
	font-size: 0.88rem;
	z-index: 9999;
	opacity: 0;
	transition: all 0.3s;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	max-width: 95vw;
	text-align: center;
	pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc3545; }
.toast.success { background: #28a745; }
.toast.warning { background: #f0ad4e; color: #000; }

/* ============ モーダル（確認ダイアログ） ============ */

.app-modal {
	position: fixed;
	inset: 0;
	z-index: 9990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.app-modal[hidden] { display: none; }

.app-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.app-modal-box {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	animation: modal-pop 0.18s ease-out;
}

@keyframes modal-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 16px 10px;
}

.app-modal-header h3 {
	margin: 0;
	font-size: 1.05rem;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 8px;
}

.app-modal-close {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 1.1rem;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 8px;
}

.app-modal-close:hover { background: var(--surface-2); color: var(--text); }

.app-modal-body {
	padding: 4px 16px 16px;
	font-size: 0.92rem;
	line-height: 1.65;
	color: var(--text);
	word-break: break-word;
}

.app-modal-body small { color: var(--muted); }

.app-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 12px 16px;
	border-top: 1px solid var(--border);
	background: var(--surface-2);
}

.app-modal-footer .btn { min-width: 110px; }

/* ============ ローディング ============ */

.app-loading {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	padding: 14px 22px;
	border-radius: 14px;
	z-index: 9998;
	font-size: 0.95rem;
}

.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
	text-align: center;
	padding: 30px 16px;
	color: var(--muted);
	font-size: 0.88rem;
}

.empty i { font-size: 2.4rem; margin-bottom: 10px; display: block; color: var(--border-2); }

/* ============ リーフレット調整 ============ */

.leaflet-container { font-family: inherit; }
.station-popup b { display: block; font-size: 0.95rem; }
.station-popup small { color: #666; }

html.dark .leaflet-layer,
html.dark .leaflet-tile { filter: brightness(0.75) contrast(1.1); }

/* ============ ターンスタイル ============ */

.turnstile-wrap {
	margin: 12px 0;
	display: flex;
	justify-content: center;
	min-height: 65px;
}

.divider {
	border: none;
	border-top: 1px solid var(--border);
	margin: 18px 0;
}

.space-6 { height: 6px; }
.space-12 { height: 12px; }

.muted { color: var(--muted); }
.center { text-align: center; }

.tagline {
	font-size: 0.8rem;
	color: var(--muted);
	text-align: center;
	margin: 14px 0 6px;
}
