.rlm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--rlm-border);
  border-radius: var(--rlm-radius-sm);
  background: var(--rlm-bg-elevated);
  color: var(--rlm-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--rlm-transition), border-color var(--rlm-transition), box-shadow var(--rlm-transition);
}

.rlm-btn:hover {
  border-color: var(--rlm-border-strong);
  background: var(--rlm-bg-panel);
}

.rlm-btn--primary {
  background: var(--rlm-accent-soft);
  border-color: var(--rlm-accent);
  color: var(--rlm-accent);
}

.rlm-btn--primary:hover {
  box-shadow: 0 0 20px var(--rlm-accent-glow);
}

.rlm-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--rlm-radius);
}

.rlm-btn--sm {
  padding: 5px 10px;
  font-size: 12px;
}

.rlm-btn--ghost {
  background: transparent;
}

.rlm-input,
.rlm-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rlm-border);
  border-radius: var(--rlm-radius-sm);
  background: var(--rlm-bg-deep);
  color: var(--rlm-text);
  font-family: inherit;
  font-size: 13px;
}

.rlm-input:focus,
.rlm-select:focus {
  outline: none;
  border-color: var(--rlm-accent);
  box-shadow: 0 0 0 3px var(--rlm-accent-soft);
}

.rlm-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rlm-text-dim);
}

.rlm-field {
  margin-bottom: 14px;
}

.rlm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.rlm-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--rlm-border);
  background: var(--rlm-bg-elevated);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--rlm-transition);
}

.rlm-chip.active {
  border-color: var(--rlm-accent);
  background: var(--rlm-accent-soft);
  color: var(--rlm-accent);
}

.rlm-poi-card {
  padding: 14px;
  margin-bottom: 10px;
  background: var(--rlm-bg-elevated);
  border: 1px solid var(--rlm-border);
  border-radius: var(--rlm-radius);
  cursor: pointer;
  transition: border-color var(--rlm-transition), transform var(--rlm-transition);
}

.rlm-poi-card:hover,
.rlm-poi-card.selected {
  border-color: var(--rlm-accent);
}

.rlm-poi-card__type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.rlm-poi-card__type--fire { background: rgba(239, 68, 68, 0.2); color: var(--rlm-fire); }
.rlm-poi-card__type--police { background: rgba(59, 130, 246, 0.2); color: var(--rlm-police); }
.rlm-poi-card__type--ems { background: rgba(34, 197, 94, 0.2); color: var(--rlm-ems); }
.rlm-poi-card__type--hospital { background: rgba(236, 72, 153, 0.2); color: var(--rlm-hospital); }
.rlm-poi-card__type--dispatch { background: rgba(139, 92, 246, 0.2); color: var(--rlm-dispatch); }

.rlm-poi-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.rlm-poi-card__coords {
  font-family: var(--rlm-font-mono);
  font-size: 11px;
  color: var(--rlm-text-muted);
}

.rlm-review-card {
  text-align: center;
  padding: 20px 12px;
}

.rlm-review-card__preview {
  height: 140px;
  margin-bottom: 16px;
  border-radius: var(--rlm-radius);
  background: linear-gradient(135deg, var(--rlm-bg-deep), var(--rlm-bg-elevated));
  border: 1px dashed var(--rlm-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.rlm-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.rlm-review-actions .rlm-btn--approve { border-color: var(--rlm-success); color: var(--rlm-success); }
.rlm-review-actions .rlm-btn--reject { border-color: var(--rlm-danger); color: var(--rlm-danger); }
.rlm-review-actions .rlm-btn--skip { color: var(--rlm-text-muted); }

.rlm-progress {
  height: 6px;
  background: var(--rlm-bg-deep);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.rlm-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rlm-accent), #fbbf24);
  border-radius: 999px;
  transition: width 400ms ease;
}

.rlm-queue-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--rlm-text-muted);
}

.rlm-build-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--rlm-bg-deep);
  border-radius: var(--rlm-radius-sm);
  border: 1px solid var(--rlm-border);
}

.rlm-build-queue-item__order {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rlm-accent-soft);
  color: var(--rlm-accent);
  border-radius: 50%;
  font-family: var(--rlm-font-mono);
  font-size: 11px;
  font-weight: 700;
}

.rlm-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--rlm-text-dim);
}

.rlm-empty__icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Command palette */
.rlm-cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.rlm-cmd-overlay.open {
  display: flex;
}

.rlm-cmd {
  width: min(560px, 92vw);
  background: var(--rlm-bg-panel);
  border: 1px solid var(--rlm-border-strong);
  border-radius: var(--rlm-radius);
  box-shadow: var(--rlm-shadow);
  overflow: hidden;
}

.rlm-cmd input {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--rlm-border);
  background: transparent;
  color: var(--rlm-text);
  font-size: 16px;
  font-family: inherit;
}

.rlm-cmd input:focus {
  outline: none;
}

.rlm-cmd__list {
  max-height: 320px;
  overflow-y: auto;
}

.rlm-cmd__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--rlm-border);
}

.rlm-cmd__item:hover,
.rlm-cmd__item.focused {
  background: var(--rlm-accent-soft);
}

.rlm-cmd__item kbd {
  margin-left: auto;
  padding: 2px 6px;
  font-family: var(--rlm-font-mono);
  font-size: 10px;
  background: var(--rlm-bg-deep);
  border: 1px solid var(--rlm-border);
  border-radius: 4px;
  color: var(--rlm-text-dim);
}

.rlm-cmd__hint {
  padding: 10px 18px;
  font-size: 11px;
  color: var(--rlm-text-dim);
  border-top: 1px solid var(--rlm-border);
}

/* Popup on map */
.rlm-leaflet-popup .leaflet-popup-content-wrapper {
  background: var(--rlm-bg-panel);
  color: var(--rlm-text);
  border-radius: var(--rlm-radius);
  border: 1px solid var(--rlm-border-strong);
  box-shadow: var(--rlm-shadow);
}

.rlm-leaflet-popup .leaflet-popup-tip {
  background: var(--rlm-bg-panel);
}

.rlm-popup h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.rlm-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.rlm-popup__coords {
  font-family: var(--rlm-font-mono);
  font-size: 11px;
  color: var(--rlm-text-muted);
}

.rlm-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 20px;
  background: var(--rlm-bg-panel);
  border: 1px solid var(--rlm-accent);
  border-radius: var(--rlm-radius);
  box-shadow: var(--rlm-shadow);
  z-index: 3000;
  opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}

.rlm-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.rlm-kbd-hint {
  position: fixed;
  bottom: 12px;
  right: calc(var(--rlm-sidebar-w) + 16px);
  font-size: 11px;
  color: var(--rlm-text-dim);
  z-index: 400;
  pointer-events: none;
}

.rlm-main.sidebar-collapsed .rlm-kbd-hint {
  right: 16px;
}
