@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css");
* { box-sizing: border-box; }
:root {
  font: 100%/1.5 "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  --blue-light: #6eaee7;
  --blue: #416fdf;
  --blue-accent: #6875e0;
  --navy: #171d35;
}
body {
  margin: 0;
  padding: 1rem;
  background: #f5f6f8;
  color: #1a1a1a;
  font-optical-sizing: auto;
}
h1 {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
h2 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
nav {
  display: inline-flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
nav a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: transform 100ms ease-out;
}
nav a:active { transform: scale(0.97); }
table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 1rem; border-radius: 8px; overflow: hidden; }
th, td { border: 1px solid #e2e5ea; padding: 0.4rem 0.5rem; font-size: 0.85rem; text-align: left; }
th { background: var(--blue); color: #fff; font-weight: 700; border-color: var(--blue); }
.col-narrow { width: 3.2rem; white-space: nowrap; }
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  min-height: 44px;
  font-size: 0.9rem;
  transition: transform 100ms ease-out;
}
button:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: #e0453f; color: #fff; }
.btn-plain { background: #e8edfa; color: var(--navy); }

.bus-select-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.bus-select-label { font-size: 0.85rem; font-weight: 700; color: #6b7280; margin-bottom: 0.6rem; }
.bus-btn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.bus-btn {
  aspect-ratio: 1 / 1;
  min-height: 44px;
  background: #eaf1fd;
  color: var(--blue);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
}
.bus-btn.active {
  background: linear-gradient(135deg, var(--blue-light), var(--blue-accent));
  color: #fff;
}
input, select {
  padding: 0.4rem 0.5rem;
  min-height: 44px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
}
.home-header { padding: 1.75rem 0.25rem 1rem; }
.home-header h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 0.35rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.75rem 1.5rem;
  min-height: 128px;
  border: none;
  border-radius: 22px;
  text-decoration: none;
  color: #1a1a1a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 100ms ease-out, box-shadow 100ms ease-out;
}
.home-card:active { transform: scale(0.98); }
.home-card--purple { background: #fff; border: 1.5px solid #dce6fb; }
.home-card--yellow { background: linear-gradient(135deg, var(--blue-light), var(--blue-accent)); color: #fff; }
.home-card--blue { background: var(--navy); color: #fff; }
.home-card--yellow .home-card-desc, .home-card--blue .home-card-desc { color: rgba(255, 255, 255, 0.8); }
.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(65, 111, 223, 0.1);
  color: var(--blue);
}
.home-card--yellow .home-card-icon, .home-card--blue .home-card-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.home-card-icon svg { width: 30px; height: 30px; }
.home-card-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.home-card-desc { font-size: 0.9rem; color: #565a66; }
.rider-list { margin-bottom: 0.5rem; }
.stop-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 1rem;
  margin-top: 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border-radius: 12px 12px 0 0;
}
.stop-group-header:first-child { margin-top: 0; }
.stop-group {
  background: #fff;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.rider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef0f4;
  transition: background-color 150ms ease-out;
}
.stop-group .rider-card:last-child { border-bottom: none; }
.rider-card.boarded { background: #eef4ff; }
.rider-name { font-size: 1rem; font-weight: 600; }
.rider-meta { font-size: 0.82rem; color: #6b7280; margin-top: 0.1rem; }
.board-toggle {
  flex-shrink: 0;
  min-width: 84px;
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #f0f1f5;
  color: #8a8f9a;
  border: 1.5px solid #e2e5ea;
}
.rider-card.boarded .board-toggle {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.bar { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; }
.muted { color: #6b7280; font-size: 0.85rem; }

.bus-panel {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}
.bus-panel-header {
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.bus-panel table { margin-bottom: 0; border-radius: 0; }
.bus-panel details { padding: 0.75rem 1rem 1rem; }
.bus-panel details table { margin-top: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  nav a, button, .rider-row.boarded { transition: none; }
}
@media print {
  nav, .no-print { display: none !important; }
  body { padding: 0; background: #fff; }
  .bus-print { page-break-after: always; }
  th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
