:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #14213d;
  --muted: #5b6473;
  --line: #dce2e8;
  --brand: #0f3d5e;
  --accent: #cb6a2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 0% 0%, #eef4fb 0, #f4f6f8 42%),
    linear-gradient(120deg, #f9fbfd 0, #f4f6f8 100%);
  font-family: "Noto Sans KR", "Pretendard", "Segoe UI", sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  margin: 0;
  font-size: 1.4rem;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links a,
.site-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

main {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.service-intro,
.editorial,
.control-wrap,
.panel,
#map,
.item,
.detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.service-intro,
.editorial,
.control-wrap {
  padding: 14px;
}

.service-intro h2,
.editorial h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.control-wrap {
  display: grid;
  gap: 8px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.controls input,
.controls select,
.controls button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.controls button {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.sync-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  min-height: 64vh;
}

#map {
  min-height: 64vh;
}

.panel {
  padding: 12px;
  overflow: auto;
}

.panel-title {
  margin: 4px 0 8px;
  font-size: 1rem;
}

.detail {
  padding: 12px;
}

.detail.empty,
.detail-empty {
  color: var(--muted);
}

.detail-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}

.detail-sub {
  color: #3f4d63;
  margin-bottom: 8px;
}

.detail-grid {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.detail-links-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  padding: 10px;
  cursor: pointer;
}

.item .name {
  font-weight: 700;
}

.item .meta,
.item .dist {
  color: var(--muted);
  font-size: 0.88rem;
}

.type-badge {
  display: inline-block;
  margin: 6px 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.type-building {
  background: #dbeafe;
  color: #1e3a8a;
}

.type-subway {
  background: #d1fae5;
  color: #065f46;
}

.type-road {
  background: #ffedd5;
  color: #9a3412;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 14px 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 5px 0;
}

.site-footer a {
  margin-right: 10px;
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  #map {
    min-height: 52vh;
  }
}
