:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ec;
  --brand: #10a37f;
  --brand-hover: #0d996e;
  --brand-soft: rgba(16, 163, 127, 0.12);
  --warning: #f9b24a;
  --danger: #ef4444;
  --success: #00863a;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --font: "Segoe UI", "Geist", "SF Pro Text", system-ui, sans-serif;
}

/* aliases used across components */
:root {
  --color-brand: var(--brand);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.rm-app { min-height: 100vh; }

.rm-map-page {
  position: relative;
  height: 100dvh;
  min-height: 640px;
  overflow: hidden;
  background: #d9e2ec;
}

.rm-map, .rm-real-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.rm-map-status {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.rm-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.rm-zoom {
  position: absolute;
  right: 16px;
  bottom: 24px;
  z-index: 500;
  display: grid;
  gap: 8px;
}

.rm-zoom button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.rm-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 600;
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.rm-topbar > * { pointer-events: auto; }

.rm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.rm-brand__logo { display: block; }
.rm-brand__text { display: grid; line-height: 1.05; }
.rm-brand__text strong { font-size: 14px; letter-spacing: .04em; }
.rm-brand__text small { color: var(--muted); font-size: 11px; }

.rm-chip, .rm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.rm-chip { cursor: pointer; max-width: 220px; }
.rm-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-search { position: relative; padding-right: 36px; }
.rm-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.rm-search > button,
.rm-search__clear {
  position: absolute;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.rm-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.rm-search-results button {
  display: grid;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.rm-search-results button:hover { background: #f8fafc; }
.rm-search-results b { display: block; }
.rm-search-results small { color: var(--muted); }

.rm-panel {
  position: absolute;
  top: 78px;
  left: 14px;
  bottom: 14px;
  width: min(400px, calc(100vw - 28px));
  z-index: 550;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.rm-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.rm-eyebrow { margin: 0; color: var(--muted); font-size: 12px; }
.rm-panel__head h2 { margin: 4px 0 0; font-size: 28px; }

.rm-icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 22px;
}

.rm-fuel-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.rm-fuel-tab {
  flex: 0 0 auto;
  min-width: 52px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.rm-fuel-tab.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.rm-filters-btn, .rm-support-btn, .rm-more-btn, .rm-fab {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  min-height: 44px;
  cursor: pointer;
}

.rm-filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

.rm-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
}

.rm-share-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

.rm-share-card {
  scroll-snap-align: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, #0f172a, #1e293b);
  color: #fff;
  text-decoration: none;
  min-height: 148px;
  overflow: hidden;
  position: relative;
}

.rm-share-card img,
.rm-share-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .45;
}

.rm-share-card strong,
.rm-share-card small,
.rm-share-actions {
  position: relative;
  z-index: 1;
}

.rm-share-card small { color: rgba(255,255,255,.8); }
.rm-share-actions { display: flex; gap: 8px; }
.rm-share-actions button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
}

.rm-support-btn {
  color: var(--brand);
  border-color: rgba(16,163,127,.35);
  background: var(--brand-soft);
  font-weight: 600;
}

.rm-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.rm-list-head h3 { margin: 0; font-size: 16px; }
.rm-list-head span { color: var(--muted); font-size: 13px; }

.rm-station-list {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}

.rm-station-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rm-station-card:hover,
.rm-station-card.is-active {
  border-color: rgba(16,163,127,.45);
  box-shadow: 0 8px 24px rgba(16,163,127,.12);
}

.rm-station-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  font-size: 20px;
}

.rm-station-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.rm-station-top h3 { margin: 0; font-size: 15px; }
.rm-station-top span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.rm-station-address {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rm-station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.rm-fuel-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.rm-fuel-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--success);
  font-weight: 600;
}
.rm-fuel-pill.is-empty {
  background: #fef2f2;
  color: var(--danger);
}
.rm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}
.rm-status-dot.is-ok { background: var(--brand); }
.rm-status-dot.is-warn { background: var(--warning); }
.rm-status-dot.is-bad { background: var(--danger); }

.rm-detail {
  position: absolute;
  top: 78px;
  left: 14px;
  bottom: 14px;
  width: min(400px, calc(100vw - 28px));
  z-index: 560;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  overflow: auto;
}

.rm-detail__back {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 8px;
  padding: 0;
}

.rm-detail h2 { margin: 0 0 4px; font-size: 24px; }
.rm-detail .addr { color: var(--muted); margin: 0 0 16px; }

.rm-detail-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
.rm-detail-block h3 { margin: 0 0 10px; font-size: 15px; }

.rm-conf {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.rm-std {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.rm-std button,
.rm-queue button,
.rm-yesno button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.rm-std button.is-active,
.rm-queue button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.rm-yesno {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rm-yesno .yes { background: #ecfdf5; border-color: rgba(16,163,127,.35); color: var(--success); }
.rm-yesno .no { background: #fef2f2; border-color: rgba(239,68,68,.25); color: var(--danger); }

.rm-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.rm-btn {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rm-btn:hover { background: var(--brand-hover); }
.rm-btn--ghost {
  background: #f1f5f9;
  color: var(--text);
}
.rm-btn--block { width: 100%; }

.rm-fab {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 520;
  padding: 0 18px;
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.rm-modal[hidden], [hidden] { display: none !important; }
.rm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
}
.rm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.45);
}
.rm-modal__sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90dvh, 720px);
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: var(--shadow);
}
.rm-modal__sheet--sm { width: min(400px, 100%); }
.rm-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.rm-modal__head h2 { margin: 0; font-size: 22px; }
.rm-modal__head button,
.rm-modal [data-close] {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 20px;
}
.rm-modal__hint { color: var(--muted); margin-top: 0; }
.rm-modal input[type="search"],
.rm-modal input[type="number"] {
  width: 100%;
  min-height: 46px;
  margin: 8px 0 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}
.rm-modal input:focus { border-color: var(--brand); }
.rm-city-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.rm-city-grid button,
.rm-chip-set button,
.rm-amount-grid button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.rm-city-grid button.is-active,
.rm-chip-set button.is-active,
.rm-amount-grid button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.rm-chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.rm-modal h3 { margin: 8px 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.rm-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.rm-route-list { display: grid; gap: 8px; }
.rm-route-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
}
.rm-route-item img { width: 28px; height: 28px; object-fit: contain; }
.rm-amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.rm-custom-amount {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.rm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1100;
  padding: 12px 16px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow);
}

.rm-seo {
  background: #fff;
  border-top: 1px solid var(--line);
}
.rm-seo__inner,
.rm-footer__inner {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}
.rm-seo h1 { margin: 0 0 18px; font-size: 32px; }
.rm-seo h2 { margin: 24px 0 8px; font-size: 20px; }
.rm-seo p { color: #334155; line-height: 1.6; }

.rm-footer {
  background: #0f172a;
  color: rgba(255,255,255,.82);
}
.rm-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.rm-footer strong { color: #fff; font-size: 18px; }

.leaflet-container { font: inherit; background: #d9e2ec; }
.rm-marker {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(15,23,42,.25);
  background: #94a3b8;
}
.rm-marker.is-ok { background: var(--brand); }
.rm-marker.is-warn { background: var(--warning); }
.rm-marker.is-bad { background: var(--danger); }
.rm-marker.is-active {
  outline: 3px solid rgba(16,163,127,.35);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .rm-topbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand location"
      "search search";
  }
  .rm-brand { grid-area: brand; }
  .rm-chip--location { grid-area: location; justify-self: end; max-width: none; }
  .rm-search { grid-area: search; }

  .rm-panel,
  .rm-detail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 58dvh;
    border-radius: 24px 24px 0 0;
  }

  .rm-zoom { bottom: calc(58dvh + 16px); }
  .rm-map-page { min-height: 100dvh; }
}

@media (min-width: 821px) {
  .rm-modal {
    place-items: center;
  }
  .rm-modal__sheet {
    border-radius: 24px;
    margin: 16px;
  }
}
