:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #68736d;
  --line: #d7ddd5;
  --accent: #2f7d57;
  --accent-dark: #225a42;
  --blue: #276f9f;
  --warn: #b66a2b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
}

.sidebar,
.detail {
  min-height: calc(100vh - 36px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.filters {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="search"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.route-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.route-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.route-card[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.route-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e8eee9;
  color: #2c3a32;
  font-size: 12px;
  font-weight: 700;
}

.detail {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 18px;
}

.map-panel,
.route-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-panel {
  min-height: 360px;
  overflow: hidden;
}

.route-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.map-bg {
  fill: #edf2ee;
}

.grid-lines line {
  stroke: #d9e0da;
  stroke-width: 1;
}

.route-path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-marker {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 4;
}

.end-marker {
  fill: var(--warn);
  stroke: #fff;
  stroke-width: 4;
}

.route-detail {
  min-height: 190px;
  padding: 18px;
}

.route-detail h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .shell {
    padding: 10px;
  }

  .workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail {
    min-height: auto;
  }
}
