:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --panel: #fff7e0;
  --ink: #1d1a14;
  --accent: #d65c1b;
  --muted: #6b5b4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Avenir", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(120deg, #fff3d6, #f6dfc6);
  border-bottom: 2px solid #f2c992;
}

.brand__title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__subtitle {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.logo-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 14px;
}

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

.layout {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 0;
  height: calc(100vh - 72px);
}

.map {
  min-height: 300px;
}

.panel {
  background: var(--panel);
  padding: 20px 24px;
  border-left: 2px solid #f2c992;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toggle-button {
  border: 1px solid #f0d6a8;
  background: #fff2cf;
  color: var(--ink);
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

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

.layout.is-collapsed .panel {
  display: none;
}

.layout.is-collapsed .map {
  height: calc(100vh - 72px);
}

.floating-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: none;
  z-index: 1500;
  box-shadow: 0 12px 30px rgba(29, 26, 20, 0.2);
}

body.panel-collapsed .floating-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff2cf;
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid #f0d6a8;
}

.metric__label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric__value {
  font-size: 16px;
  font-weight: 600;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.link-button {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(29, 26, 20, 0.45);
  padding: 20px;
  z-index: 2000;
}

.modal.is-open {
  display: flex;
}

.modal__card {
  background: #fff7e0;
  border: 2px solid #f2c992;
  border-radius: 16px;
  padding: 20px;
  max-width: 420px;
  width: min(90vw, 420px);
  display: grid;
  gap: 12px;
}

.modal__card h3 {
  margin: 0;
}

.modal__card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal__card input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f0d6a8;
  font-size: 13px;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn--ghost {
  background: #fff2cf;
  color: var(--ink);
  border: 1px solid #f0d6a8;
}

.modal__note {
  font-size: 12px;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel {
    border-left: none;
    border-top: 2px solid #f2c992;
  }

  .map {
    height: 60vh;
  }

  .layout.is-collapsed {
    height: calc(100vh - 72px);
  }

  .layout.is-collapsed .map {
    height: calc(100vh - 72px);
  }
}
