:root {
	--m-red: #800000;
	--bg: #f8f9fa;
	--line-hkkob: #194da4;
	--line-hkta: #d9731d;
	--line-hk-kyo: #3c7846;
	--line-hk-ara: #4f402d;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
	font-family: "Helvetica Neue", Arial, sans-serif;
	background: var(--bg);
	color: #333;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 20px;
}

.container {
	text-align: center;
	padding: 30px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
	max-width: 560px;
	width: 100%;
	border-top: 6px solid var(--m-red);
}

h1 {
	font-size: 22px;
	font-weight: 900;
	color: #111;
	margin-bottom: 8px;
	letter-spacing: 0.5px;
}

.subtitle {
	font-size: 13px;
	font-weight: bold;
	color: #888;
	margin-bottom: 25px;
}

.completion-note {
	margin: -14px 0 20px;
	color: #666;
	font-size: 12px;
	line-height: 1.5;
}

.line-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: auto;
	min-width: 0;
	flex: 1 1 auto;
	padding: 12px 14px;
	margin: 0;
	border: 2px solid #eee;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 900;
	color: #222;
	cursor: pointer;
	background: #fff;
	transition: all 0.2s ease;
	text-decoration: none;
	box-sizing: border-box;
}

.line-entry {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 12px 0;
}

.line-btn:hover {
	background: #fdfdfd;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

.line-btn:active { transform: translateY(0); }

/* Route color bars and hover borders */
.btn-kob { border-left: 8px solid var(--line-hkkob); }
.btn-kob:hover { border-color: var(--line-hkkob); }
.btn-ta { border-left: 8px solid var(--line-hkta); }
.btn-ta:hover { border-color: var(--line-hkta); }
.btn-kyo { border-left: 8px solid var(--line-hk-kyo); }
.btn-kyo:hover { border-color: var(--line-hk-kyo); }
.btn-ara { border-left: 8px solid var(--line-hk-ara); }
.btn-ara:hover { border-color: var(--line-hk-ara); }

.btn-text {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
	margin-left: 10px;
}

.completion-group {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.completion-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	color: #555;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.completion-circle {
	--completion: 0%;
	--chart-color: #333;
	position: relative;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: conic-gradient(var(--chart-color) var(--completion), #e7e9eb 0);
	color: #222;
	font-size: 11px;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	font-family: inherit;
	cursor: pointer;
}

.completion-circle::before {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: #fff;
}

.completion-value { position: relative; z-index: 1; }
.completion-item-weekend .completion-circle { --chart-color: #c62828; }
.completion-circle:focus-visible { outline: 3px solid #1976d2; outline-offset: 2px; }

.completion-details {
	width: 100%;
	margin: -6px 0 12px;
	padding: 14px;
	border: 1px solid #e5e8eb;
	border-radius: 8px;
	background: #fff;
	text-align: left;
}

.completion-details[hidden] { display: none; }
.completion-details-heading { margin-bottom: 4px; color: #222; font-size: 14px; }
.completion-details-summary,
.completion-details-message { margin-bottom: 10px; color: #666; font-size: 12px; }
.completion-station-list { list-style: none; }
.completion-station-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 8px;
	padding: 7px 0;
	border-top: 1px solid #f0f1f2;
	font-size: 12px;
}

.completion-station-name { min-width: 0; font-weight: 700; }
.completion-station-status { white-space: nowrap; font-size: 11px; }
.completion-station-status.is-complete { color: #28743b; }
.completion-station-status.is-incomplete { color: #c62828; }
.completion-station-status.is-na { color: #999; }

.arrow {
	color: #ccc;
	font-size: 18px;
	flex: 0 0 auto;
}

@media (max-width: 420px) {
	body { padding: 12px; }
	.container { padding: 22px 14px; }
	.line-entry { gap: 5px; }
	.line-btn { gap: 6px; padding: 10px 8px; font-size: 14px; }
	.btn-text { margin-left: 5px; }
	.completion-group { gap: 5px; }
	.completion-circle { width: 36px; height: 36px; font-size: 10px; }
	.completion-circle::before { inset: 3px; }
	.completion-details { padding: 10px; }
	.completion-station-row { gap: 5px; font-size: 11px; }
	.completion-station-status { font-size: 10px; }
}
