:root {
  color-scheme: dark;
  --panel: rgba(13, 18, 22, 0.86);
  --panel-strong: rgba(18, 26, 31, 0.96);
  --line: rgba(255, 255, 255, 0.15);
  --text: #eef5f4;
  --muted: #aab9b7;
  --accent: #4ed4bd;
  --accent-2: #f0bd5d;
  --danger: #ef796d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #06090c;
  color: var(--text);
}

.app-shell {
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
}

.control-panel {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 10;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(240, 189, 93, 0.14);
}

.status-dot.ready {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(78, 212, 189, 0.15);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(239, 121, 109, 0.16);
}

.search-row,
.tools,
.quick-grid {
  display: grid;
  gap: 8px;
}

.search-row {
  grid-template-columns: 1fr 42px;
}

input,
button {
  font: inherit;
}

input[type="search"] {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

input[type="search"]:focus {
  border-color: rgba(78, 212, 189, 0.75);
  box-shadow: 0 0 0 3px rgba(78, 212, 189, 0.14);
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
}

button:hover,
button.active {
  border-color: rgba(78, 212, 189, 0.7);
  background: rgba(78, 212, 189, 0.18);
}

.quick-grid {
  grid-template-columns: repeat(3, 1fr);
}

.quick-grid button {
  min-width: 0;
  font-size: 0.9rem;
}

.tools {
  grid-template-columns: repeat(4, 42px);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  font-size: 1.08rem;
}

.toggle-row,
.range-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.toggle-row {
  grid-template-columns: 18px 1fr;
}

.range-row {
  grid-template-columns: 112px 1fr 48px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

output {
  color: var(--text);
  text-align: right;
}

.place-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--panel-strong);
}

.place-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.map-marker {
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 999px 999px 999px 0;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42);
  transform: rotate(-45deg);
}

.maplibregl-ctrl-group {
  border-radius: 6px;
  overflow: hidden;
  background: rgba(18, 26, 31, 0.92);
  box-shadow: var(--shadow);
}

.maplibregl-ctrl-group button {
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
}

.maplibregl-ctrl-scale {
  border-color: rgba(255, 255, 255, 0.72);
  color: #ffffff;
  background: rgba(13, 18, 22, 0.72);
}

.maplibregl-ctrl-attrib {
  max-width: min(620px, calc(100vw - 380px));
  background: rgba(13, 18, 22, 0.72) !important;
  color: rgba(255, 255, 255, 0.82);
}

.maplibregl-ctrl-attrib a {
  color: #bcefe5;
}

@media (max-width: 760px) {
  .control-panel {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: 48vh;
    overflow: auto;
    padding: 12px;
  }

  .range-row {
    grid-template-columns: 96px 1fr 42px;
  }

  h1 {
    font-size: 1.32rem;
  }

  .maplibregl-ctrl-attrib {
    max-width: calc(100vw - 24px);
  }
}
