:root {
  --bg: #041321;
  --bg2: #062336;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.96);
  --border: #d0d7de;
  --shadow-soft: 0 10px 30px rgba(4, 15, 32, 0.45);
  --accent: #1a73e8;
  --accent-soft: rgba(26, 115, 232, 0.12);
  --accent-strong: #1557b1;
  --danger: #d93025;
  --text-main: #202124;
  --text-muted: #5f6368;
  --pill-bg: rgba(255, 255, 255, 0.96);
  --pill-border: #dadce0;
  --badge-bg: #e8f0fe;
  --badge-text: #1967d2;
  --mobile-card-bg: #ffffff;
  --mobile-card-shadow: 0 -10px 25px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #0a2340 0%, #020813 55%, #000000 100%);
  overflow: hidden;
}

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

/* Top search shell */
.rm-top-shell {
  position: absolute;
  inset: 12px 12px auto 12px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.rm-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.rm-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}

.rm-logo-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: conic-gradient(
    from 160deg,
    #00bcd4,
    #1a73e8,
    #34a853,
    #fbbc05,
    #e91e63,
    #00bcd4
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.rm-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.rm-logo-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f2933;
}
.rm-logo-sub { font-size: 10px; color: var(--text-muted); }

.rm-pill-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e8f0fe;
  font-size: 11px;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.rm-pill-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Search bar */
.rm-search-shell { display: flex; justify-content: center; pointer-events: none; }

.rm-search-box {
  display: flex;
  align-items: center;
  background: var(--panel-soft);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: 2px 4px 2px 8px;
  width: min(640px, 96vw);
  pointer-events: auto;
}

.rm-search-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
}

.rm-search-icon-btn:hover { background: rgba(0, 0, 0, 0.04); }

.rm-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rm-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 6px;
  font-size: 14px;
  background: transparent;
  color: var(--text-main);
}

.rm-search-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding-right: 6px;
  white-space: nowrap;
}

.rm-clear-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.rm-clear-btn:hover {
  color: var(--danger);
  background: rgba(217, 48, 37, 0.06);
  border-radius: 999px;
}

/* Suggestions dropdown */
.rm-suggestions {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1090;
  width: min(640px, 96vw);
  max-height: 300px;
  overflow-y: auto;
  background: var(--panel-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: 4px 0;
  backdrop-filter: blur(10px);
}
.rm-suggestions.rm-hidden { display: none; }

.rm-suggestion-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rm-suggestion-item:hover {
  background: rgba(32, 33, 36, 0.06);
}

.rm-suggestion-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent-strong);
  flex-shrink: 0;
}

.rm-suggestion-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rm-suggestion-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-suggestion-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-suggestion-tags {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.rm-tag {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
}

/* FABs */
.rm-fab {
  position: absolute;
  right: 14px;
  z-index: 1080;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}
.rm-fab span { font-size: 20px; }
.rm-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.rm-fab:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}
.rm-fab-locate { bottom: 90px; }
.rm-fab-clear { bottom: 40px; }

/* Info card bottom */
.rm-info-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1070;
  background: var(--mobile-card-bg);
  box-shadow: var(--mobile-card-shadow);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--border);
  padding: 10px 16px 12px;
  max-height: 40%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(100%);
  transition: transform 0.18s ease-out;
}
.rm-info-card.rm-open { transform: translateY(0%); }

.rm-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.rm-info-title { font-size: 14px; font-weight: 600; color: var(--text-main); }

.rm-info-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.rm-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
}

.rm-info-text { font-size: 12px; color: var(--text-muted); }

.rm-info-coord {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.rm-info-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  gap: 8px;
}

.rm-info-meta-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rm-info-meta-small {
  font-size: 10px;
  opacity: 0.8;
}

.rm-info-close {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}

.rm-copy-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.rm-copy-btn:hover { background: var(--accent-strong); }
.rm-copy-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* Bottom pill */
.rm-bottom-pill {
  position: absolute;
  left: 10px;
  bottom: 18px;
  z-index: 1060;
  background: rgba(0, 0, 0, 0.55);
  color: #e8f0fe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}
.rm-bottom-pill span { opacity: 0.9; }

@media (max-width: 768px) {
  .rm-top-shell { inset: 10px 10px auto 10px; }
  .rm-logo-pill { padding: 5px 10px; }
  .rm-search-box { width: calc(100vw - 20px); }
  .rm-suggestions { width: calc(100vw - 20px); top: 91px; }
  .rm-bottom-pill { left: 8px; bottom: 16px; }
  .rm-info-meta-row { flex-direction: row; align-items: flex-start; }
}
