:root {
  color: #17211d;
  background: #f4f6f2;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  min-height: 100vh;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding: 1.25rem;
  background: #ffffff;
  border-right: 1px solid #d8ded8;
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 8px;
  background: #12624f;
  color: #ffffff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.7rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.05rem;
}

.brand p,
.status p,
.muted,
.energy-summary {
  color: #4b5852;
}

.energy-summary,
.charge-plan {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: #eef5f1;
}

.charge-plan {
  border-left: 4px solid #c05621;
  background: #fff4ec;
  color: #3b2a20;
}

.route-form,
.advanced,
.status,
.route-summary {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #27332f;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #aeb8b1;
  border-radius: 8px;
  padding: 0.75rem 0.8rem;
  background: #ffffff;
  color: #101715;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid #87d5c0;
  outline-offset: 2px;
}

.soc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.primary-button,
.more-button {
  min-height: 3rem;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: #12624f;
  color: #ffffff;
}

.more-button {
  background: #e4ece7;
  color: #0e2f27;
}

.status {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #d8ded8;
}

.map-wrap {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(18, 98, 79, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(18, 98, 79, 0.14) 1px, transparent 1px),
    #edf2ee;
  background-size: 54px 54px;
}

.map-stage {
  display: grid;
  grid-template-rows: auto minmax(20rem, 48vh) minmax(0, 1fr);
  gap: 1rem;
  min-height: 100vh;
  padding: 1rem;
}

.map-toolbar,
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.map-toolbar button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  background: #12624f;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.map-toolbar button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.charger-map {
  position: relative;
  touch-action: none;
  overflow: hidden;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  background: #dce7e0;
  cursor: grab;
  user-select: none;
}

.charger-map:active {
  cursor: grabbing;
}

.tile-layer,
.marker-layer {
  position: absolute;
  inset: 0;
}

.tile-layer img {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
}

.marker-layer {
  z-index: 2;
}

.route-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-shadow,
.route-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-shadow {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 8;
}

.route-path {
  stroke: #12624f;
  stroke-width: 4;
}

.map-controls {
  position: absolute;
  z-index: 3;
  right: 0.8rem;
  top: 0.8rem;
  display: grid;
  gap: 0.4rem;
}

.map-controls button {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid #bdcbc3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #12332b;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 900;
}

.map-controls button:hover {
  background: #e7f0eb;
}

.charger-dot {
  position: absolute;
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #12624f;
  color: #ffffff;
  box-shadow: 0 0.25rem 0.7rem rgba(10, 29, 24, 0.22);
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 900;
}

.cluster-dot {
  width: 2rem;
  height: 2rem;
  background: #c05621;
  font-size: 0.72rem;
}

.charger-dot:hover,
.charger-dot:focus-visible {
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  background: #c05621;
}

.cluster-dot:hover,
.cluster-dot:focus-visible {
  width: 2.35rem;
  height: 2.35rem;
}

.recommended-dot {
  width: 2rem;
  height: 2rem;
  background: #f3b43f;
  color: #1f2117;
}

.endpoint-marker {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: 0 0.25rem 0.7rem rgba(10, 29, 24, 0.28);
  font-weight: 900;
}

.endpoint-marker.start {
  background: #12624f;
}

.endpoint-marker.goal {
  background: #c05621;
}

.empty-map {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  margin: 0;
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  background: #ffffff;
}

.charger-results {
  overflow: hidden;
  border: 1px solid #cbd7cf;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.results-heading {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #d8ded8;
}

#resultCount {
  display: grid;
  min-width: 2.4rem;
  min-height: 2.4rem;
  place-items: center;
  border-radius: 999px;
  background: #e4ece7;
  color: #0e2f27;
  font-weight: 900;
}

.charger-list {
  display: grid;
  max-height: calc(52vh - 5rem);
  margin: 0;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

.charger-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-bottom: 1px solid #edf0ed;
}

.recommended-card {
  border-left: 4px solid #f3b43f;
  background: #fff9e8;
}

.charger-card > div {
  display: grid;
  gap: 0.2rem;
}

.charger-card span {
  color: #4b5852;
}

.charger-card dl {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.25rem 0.7rem;
  margin: 0;
}

.charger-card dt {
  color: #4b5852;
  font-weight: 700;
}

.charger-card dd {
  margin: 0;
}

.empty-list {
  padding: 1rem;
  color: #4b5852;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(58vh, 1fr);
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid #d8ded8;
  }

  .map-wrap {
    min-height: 58vh;
  }

  .map-stage {
    min-height: 58vh;
  }

  .charger-list {
    max-height: 22rem;
  }
}

@media (max-width: 460px) {
  .panel {
    padding: 1rem;
  }

  .soc-row {
    grid-template-columns: 1fr;
  }
}
