:root {
  --bg: #0b1020;
  --panel: #0f1730;
  --muted: #93a4c7;
  --text: #e7eefc;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #7aa2ff;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  color: #d6e2ff;
}

.layout {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.header__title {
  font-weight: 700;
  font-size: 16px;
}

.header__subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.main {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 0;
}

.panel {
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 14px;
  overflow: auto;
}

.panel__section {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.panel__section:last-child {
  border-bottom: none;
}

.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input,
.textarea {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.textarea {
  resize: vertical;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.row {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.row--split .col {
  flex: 1;
}

.row--split .btn {
  width: 100%;
}

.btn {
  width: 100%;
  border: 1px solid rgba(122, 162, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(122, 162, 255, 0.15);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.btn--danger {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.45);
}

.btn:disabled,
.input:disabled,
.textarea:disabled,
select.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
}

.edit-box {
  margin-top: 10px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.edit-box__title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.edit-box__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.edit-box__kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.edit-box__kv code {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  display: inline-block;
}

.status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

.status--error {
  color: var(--danger);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.details summary {
  cursor: pointer;
  color: var(--muted);
}

.pre {
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  max-height: 240px;
  overflow: auto;
}

.map {
  min-height: 0;
}

.map__canvas {
  height: 100%;
  width: 100%;
}

/* GeoJSON FeatureCollection summary (Preview), above Raw Response JSON */
.geo-preview {
  width: 100%;
  margin: 10px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.geo-preview:not(.geo-preview--empty) + .pre {
  margin-top: 0;
}

.geo-preview--empty {
  display: none;
}

.geo-preview__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
}

.geo-preview__summary {
  color: var(--muted);
  margin: 0 0 10px;
}

.geo-preview__summary strong,
.geo-preview__row strong {
  color: var(--text);
  font-weight: 700;
}

.geo-preview__sep {
  margin: 0 0.35em;
  opacity: 0.65;
}

.geo-preview__row {
  color: var(--muted);
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.geo-preview__row:first-of-type {
  padding-top: 0;
  border-top: none;
}

/* Leaflet control styling (match dark UI) */
.leaflet-control-layers,
.leaflet-bar {
  background: rgba(15, 23, 48, 0.92) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.leaflet-control-layers label,
.leaflet-control-layers span,
.leaflet-control-layers a {
  color: var(--text) !important;
  font-size: 12px;
}

.leaflet-control-layers-expanded {
  padding: 10px 10px !important;
}

.leaflet-control-zoom a {
  background: rgba(15, 23, 48, 0.92) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.leaflet-control-attribution {
  background: rgba(11, 16, 32, 0.7) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

/* Route markers/arrows */
.route-label {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #0b1020;
  background: var(--labelFill, #22c55e);
  border: 3px solid var(--labelStroke, #0b1020);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.route-arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--arrowColor, #ffffff);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.route-arrow-icon {
  background: transparent !important;
  border: none !important;
}

/* Editor markers */
.wp-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  color: #0b1020;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(122, 162, 255, 0.9);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.wp-icon--selected {
  border-color: rgba(255, 207, 107, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 207, 107, 0.22), 0 12px 22px rgba(0, 0, 0, 0.45);
}

.wp-icon--locked {
  opacity: 0.55;
}

@media (max-width: 1000px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: 520px 1fr;
  }
  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

