:root {
  --bg: #0a1f1d;
  --panel: #102b27;
  --panel-alt: #163530;
  --border: #1f4a43;
  --text: #e8f3ef;
  --text-dim: #7fa398;
  --teal: #2dd4bf;
  --amber: #f2a65a;
  --danger: #ff6b6b;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }

#app {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
}

#sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 18px;
}

#sidebar h1 {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 4px;
}
#sidebar .sub { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.field input[type="text"],
.field input[type="number"],
.field input[type="file"] {
  width: 100%;
  background: #0e2522;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 12px;
}

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

button.run {
  width: 100%;
  background: var(--teal);
  color: #062c27;
  border: none;
  border-radius: 6px;
  padding: 9px 0;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
button.run:hover { background: #45e0cc; }
button.run:disabled { opacity: .5; cursor: default; }

#status {
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
  padding: 8px 10px;
  border-radius: 6px;
  display: none;
  align-items: center;
  gap: 8px;
}
#status.show { display: flex; }
#status.loading { background: rgba(45, 212, 191, 0.12); color: var(--teal); border: 1px solid rgba(45,212,191,.4); }
#status.ok { background: rgba(45, 212, 191, 0.12); color: var(--teal); border: 1px solid rgba(45,212,191,.4); }
#status.err { background: rgba(255, 107, 107, 0.12); color: var(--danger); border: 1px solid rgba(255,107,107,.4); }

.spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(45,212,191,.3);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

button.run.is-loading { opacity: .75; cursor: progress; }

#summary {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
#summary b { color: var(--text); }

#course-list {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
#course-list .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
#course-list .item:hover { background: var(--panel-alt); }
#course-list .item.active { background: var(--panel-alt); color: var(--text); }
#course-list .badge-gs { color: var(--teal); }
#course-list .badge-k7 { color: var(--amber); }
#course-list .clear-btn {
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
}

#map { width: 100%; height: 100%; }

.legend {
  position: absolute;
  bottom: 16px;
  left: 376px;
  background: rgba(10, 31, 29, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  z-index: 5;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.gs { background: var(--teal); }
.dot.k7 { background: var(--amber); }
.sq.depot { width: 8px; height: 8px; display: inline-block; background: var(--danger); }
