:root {
  --bg: #e8eef2;
  --bg-hero: linear-gradient(160deg, #0b3d4a 0%, #1a6b7c 45%, #2d8a6e 100%);
  --panel: #ffffff;
  --ink: #14222a;
  --muted: #5a6b75;
  --accent: #0d6e78;
  --accent-2: #c45c26;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 34, 42, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Sora", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(13, 110, 120, 0.08), transparent 45%),
    radial-gradient(ellipse at 90% 20%, rgba(196, 92, 38, 0.07), transparent 40%),
    var(--bg);
  line-height: 1.5;
}
[x-cloak] { display: none !important; }

.wrap { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }

.hero {
  background: var(--bg-hero);
  color: #f4fafb;
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 80%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  opacity: 0.9;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  max-width: 16ch;
}
.lede { max-width: 42rem; margin: 0 0 0.75rem; opacity: 0.95; }
.disclaimer { font-size: 0.875rem; opacity: 0.8; margin: 0 0 1.5rem; }
.disclaimer a { color: #dff7f4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin: 1.25rem 0;
}
.panel h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.section-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.pad { padding: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: #f3f7f8; color: #0b3d4a; }
.hero .btn-primary { background: #fff; color: #0b3d4a; }
.btn-primary:hover { filter: brightness(0.97); }
.btn-link { background: transparent; color: #dff7f4; text-decoration: underline; padding-inline: 0.25rem; }
.btn-ghost {
  background: #f3f6f8;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
}
.btn-ghost span { font-weight: 700; color: var(--accent); }

.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid #9fb4bc;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  background: #fff;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.is-active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.line-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .line-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.line-card { cursor: pointer; border-radius: 12px; }
.line-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.line-card-inner {
  border: 1px solid #d7e0e5;
  border-left-width: 4px;
  border-radius: 12px;
  background: #f7fafb;
  padding: 0.9rem;
  height: 100%;
}
.line-card.is-selected .line-card-inner { box-shadow: 0 0 0 2px rgba(13,110,120,0.35); }
.line-card-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-ok { background: #dcfae6; color: var(--ok); }
.badge-warn { background: #fef0c7; color: var(--warn); }
.badge-danger { background: #fee4e2; color: var(--danger); }
.badge-outline { border: 1px solid #c9d5db; background: #fff; color: var(--ink); }

.empty-state { text-align: center; padding: 1.5rem 0.5rem; }
.empty-title { font-family: var(--display); font-size: 1.25rem; margin: 0 0 0.35rem; }

.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.tab-pair { display: flex; gap: 0.35rem; background: #eef3f5; border-radius: 999px; padding: 0.2rem; }
.tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

#network-canvas {
  width: 100%;
  height: auto;
  max-height: 70vh;
  background: #f4f8f9;
  border-radius: 12px;
  border: 1px solid #d7e0e5;
  margin-top: 0.75rem;
}

.linear-line { margin: 1rem 0 1.5rem; }
.linear-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.linear-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: flex-start;
}
.station-dot {
  flex: 0 0 auto;
  width: 4.5rem;
  text-align: center;
  position: relative;
  padding-top: 1.1rem;
}
.station-dot::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line-color, #888);
  opacity: 0.35;
}
.station-dot:first-child::before { left: 50%; }
.station-dot:last-child::before { right: 50%; }
.station-dot .node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-color, #888);
  margin: 0 auto 0.35rem;
  position: relative;
  z-index: 1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.station-dot.is-affected .node {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.25);
  transform: scale(1.25);
}
.station-dot .label {
  font-size: 0.65rem;
  line-height: 1.2;
  color: var(--muted);
  display: block;
  max-width: 4.5rem;
  margin-inline: auto;
}
.station-dot.is-affected .label { color: var(--danger); font-weight: 700; }

.report-list, .official-list { list-style: none; margin: 0; padding: 0; }
.report-item {
  border-left: 4px solid #ccc;
  padding: 0.9rem 0 0.9rem 0.9rem;
  border-bottom: 1px solid #e6eef1;
}
.report-head { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.report-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.35rem; }
.remarks { font-style: italic; color: var(--muted); }
.vote-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }

.official-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid #e6eef1;
}
.official-item a { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.official-empty {
  padding: 0.5rem 0 0.25rem;
}
.official-empty code {
  font-size: 0.8em;
  background: #eef3f5;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.field { display: block; margin: 0.85rem 0; }
.field > span, .field legend {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.field select, .field input[type="text"] {
  width: 100%;
  max-width: 420px;
  border: 1px solid #c5d2d8;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
}
.radio { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 0.85rem; margin-bottom: 0.35rem; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.form-error { color: var(--danger); font-weight: 600; }
.form-ok { color: var(--ok); font-weight: 600; }

details { border-top: 1px solid #e6eef1; padding: 0.75rem 0; }
details summary { cursor: pointer; font-weight: 650; }
details p { margin: 0.5rem 0 0; color: var(--muted); }

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
