.map-page {
  background:
    radial-gradient(circle at 76% 7%, rgba(204, 255, 74, 0.27), transparent 22rem),
    var(--cream);
}

.map-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 55px 0 38px;
}

.map-header h1 {
  margin: 15px 0 0;
  font-size: clamp(45px, 6vw, 70px);
}

.map-header > p {
  max-width: 400px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.planner {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 590px;
  margin-bottom: 70px;
  border: 1px solid rgba(16, 41, 33, 0.1);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(18, 45, 37, 0.09);
  overflow: hidden;
}

.route-panel {
  position: relative;
  z-index: 2;
  padding: 32px;
  box-shadow: 16px 0 45px rgba(16, 41, 33, 0.08);
}

.route-panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 27px;
}

.route-panel-heading h2 { margin-bottom: 4px; }
.route-panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }

.location-fields {
  position: relative;
  padding: 4px 0 6px;
}

.location-field {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf6;
  transition: 0.2s ease;
}

.location-field:focus-within {
  border-color: var(--teal);
  background: white;
  box-shadow: 0 0 0 3px rgba(13, 71, 59, 0.08);
}

.location-field > span:last-child { flex: 1; min-width: 0; }
.location-field small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 600; }
.location-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 600; }
.location-field input::placeholder { color: #a5b0ac; font-weight: 400; }

.location-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 71, 59, 0.11);
}

.end-dot { background: var(--lime); border: 2px solid var(--teal); box-shadow: 0 0 0 4px rgba(204, 255, 74, 0.2); }
.location-line { width: 1px; height: 13px; margin-left: 20px; border-left: 1px dashed #aeb9b4; }

.route-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.route-numbers .input-wrap { min-height: 54px; }
.route-numbers .input-wrap input { font-size: 18px; }
.route-options {
  display: grid;
  gap: 13px;
  margin: 22px 0;
}

.route-round { margin: 0; }

.route-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 17px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--teal);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.route-button:hover { transform: translateY(-1px); background: #0a3b31; }
.route-button:disabled { cursor: wait; opacity: 0.7; transform: none; }
.route-button span:last-child { color: var(--lime); font-size: 18px; }
.route-status { min-height: 18px; margin: 12px 2px 0; color: #a14235; font-size: 10px; line-height: 1.4; }

.map-wrap { position: relative; min-width: 0; background: #dce3da; }
#map { width: 100%; height: 100%; min-height: 590px; z-index: 0; filter: saturate(0.72) contrast(0.97); }

.map-placeholder {
  position: absolute;
  z-index: 400;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 15px;
  background: rgba(255, 254, 250, 0.9);
  box-shadow: 0 14px 40px rgba(16, 41, 33, 0.16);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
}

.map-placeholder[hidden] { display: none; }
.map-pin { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; color: var(--lime); background: var(--teal); font-size: 21px; }
.map-placeholder strong { font-family: "Manrope", sans-serif; font-size: 13px; }
.map-placeholder small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.map-result {
  position: absolute;
  z-index: 500;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  color: white;
  background: rgba(13, 71, 59, 0.94);
  box-shadow: 0 14px 40px rgba(16,41,33,.24);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.map-result[hidden] { display: none; }
.map-result > div { min-width: 110px; padding: 15px 17px; border-right: 1px solid rgba(255,255,255,.12); }
.map-result > div:last-child { border-right: 0; }
.map-result small { display: block; margin-bottom: 5px; color: rgba(255,255,255,.52); font-size: 8px; }
.map-result strong { font-family: "Manrope", sans-serif; font-size: 14px; }
.map-result > div:first-child strong { color: var(--lime); font-size: 23px; }
.map-result sup { font-size: 11px; }

.leaflet-control-zoom a { color: var(--teal) !important; }
.leaflet-control-attribution { font-size: 8px !important; }
.fuelly-marker { border: 2px solid white; border-radius: 50%; background: var(--teal); box-shadow: 0 3px 9px rgba(16,41,33,.3); }
.fuelly-marker.end { background: var(--lime); border-color: var(--teal); }

@media (max-width: 900px) {
  .map-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .map-header > p { max-width: 550px; }
  .planner { grid-template-columns: 1fr; }
  .route-panel { box-shadow: 0 16px 45px rgba(16,41,33,.06); }
  #map { min-height: 500px; }
}

@media (max-width: 620px) {
  .map-header { padding: 38px 4px 28px; }
  .map-header h1 { font-size: 46px; }
  .route-panel { padding: 25px 20px; }
  .map-result { left: 12px; right: 12px; bottom: 12px; grid-template-columns: 1fr 1fr; }
  .map-result > div { min-width: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .map-result > div:nth-child(2) { border-right: 0; }
  .map-result > div:nth-child(3), .map-result > div:nth-child(4) { border-bottom: 0; }
}
