:root {
  --ink: #1a2040;
  --muted: #687393;
  --paper: #edf0f9;
  --panel: #ffffff;
  --red: #9f041b;
  --orange: #e07837;
  --green: #19734a;
  --line: #dbe1ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  color: var(--red);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover,
.button:hover {
  border-color: var(--orange);
}

.hero,
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgb(26 32 64 / 7%);
}

.hero {
  padding: 28px;
  margin-bottom: 18px;
}

.hero h1,
.panel h1,
.panel h2 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.card,
.panel {
  padding: 18px;
}

.metric {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 900;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.rank {
  color: var(--orange);
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.button.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.button.danger {
  border-color: #7b1530;
  background: #7b1530;
  color: #fff;
}

.button.secondary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.notice {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
}

.notice.error {
  color: #7b1530;
}

.notice.success {
  color: var(--green);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.route-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.route-card h3 {
  margin: 0 0 6px;
}

.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3eee9;
  color: #7b4b33;
  font-size: 0.78rem;
  font-weight: 800;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px;
}

.checkbox-list input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 680px) {
  .shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1 1 120px;
  }
}
