:root {
  --bg: #0e0f12;
  --panel: #15171c;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --accent: #4f9dff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #22252b;
  background: #101216;
}

.title {
  font-weight: 600;
  letter-spacing: 0.4px;
}

.controls button {
  margin-left: 8px;
  padding: 6px 10px;
  border: 1px solid #2b2f36;
  background: #1b1f26;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.controls button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.main {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: calc(100vh - 52px);
}

#canvasWrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#loading {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  background: #1b1f26;
  border: 1px solid #2b2f36;
  border-radius: 6px;
  font-size: 12px;
}

.panel {
  background: var(--panel);
  border-left: 1px solid #22252b;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid #22252b;
  font-weight: 600;
}

.panel-body {
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}

.hidden {
  display: none;
}

#detailImage {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #2b2f36;
  margin-bottom: 10px;
}

.detail-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.neighbors-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.neighbors-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.neighbor-card {
  background: #1b1f26;
  border: 1px solid #2b2f36;
  border-radius: 6px;
  padding: 4px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.neighbor-card img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }

  .panel {
    border-left: none;
    border-top: 1px solid #22252b;
  }

  #canvasWrap {
    min-height: 60vh;
  }
}
