:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --text: #17201b;
  --muted: #68746d;
  --line: #dbe3dd;
  --accent: #16735f;
  --accent-dark: #0f5548;
  --warning: #9a5b12;
  --shadow: 0 18px 48px rgba(20, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 34px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 2;
}

.brand-row {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.rate-editor {
  align-items: center;
  background: #eef7f3;
  border: 1px solid #cde5dc;
  border-radius: 999px;
  color: var(--accent-dark);
  display: flex;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  padding: 5px 6px 5px 10px;
  white-space: nowrap;
}

.rate-editor input {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  min-height: 24px;
  padding: 0;
  text-align: right;
  width: 48px;
}

.rate-editor input:focus {
  box-shadow: none;
}

.rate-editor input:disabled {
  color: var(--accent-dark);
  opacity: 1;
}

.rate-editor input::-webkit-outer-spin-button,
.rate-editor input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.rate-editor input[type="number"] {
  appearance: textfield;
}

.rate-edit-button,

.rate-save-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cde5dc;
  border-radius: 999px;
  color: var(--accent-dark);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
}

.rate-save-button {
  font-size: 15px;
  min-width: 28px;
  padding: 0;
}

.rate-edit-button[hidden],
.rate-save-button[hidden] {
  display: none;
}

.controls {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 48px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 115, 95, 0.12);
}

input:disabled {
  color: #56615a;
}

.location-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 124px;
}

.text-button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 750;
  min-height: 48px;
  padding: 0 12px;
}

.text-button:hover,
.text-button:focus {
  background: var(--accent-dark);
  outline: none;
}

.suggestions {
  border: 1px solid transparent;
  display: grid;
  gap: 6px;
  margin-top: -8px;
  max-height: 270px;
  overflow: auto;
}

.suggestions:not(:empty) {
  background: #ffffff;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(20, 32, 27, 0.12);
  padding: 6px;
}

.suggestion {
  background: #fbfcfb;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
  padding: 10px 11px;
  text-align: left;
}

.suggestion:hover,
.suggestion:focus {
  background: #eef7f3;
  outline: none;
}

.status {
  background: #fff8ed;
  border: 1px solid #f0d2a6;
  border-radius: 8px;
  color: var(--warning);
  font-size: 14px;
  line-height: 1.45;
  min-height: 44px;
  padding: 11px 12px;
}

.status.ready {
  background: #eef7f3;
  border-color: #cde5dc;
  color: var(--accent-dark);
}

.status.error {
  background: #fff0f0;
  border-color: #efc2c2;
  color: #a02828;
}

.summary {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
}

.summary article {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 17px 0;
}

.summary strong {
  font-size: 23px;
  letter-spacing: 0;
  line-height: 1.2;
}

.directions-button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  min-height: 52px;
  width: 100%;
}

.directions-button:hover,
.directions-button:focus {
  background: var(--accent-dark);
  outline: none;
}

.directions-button:disabled {
  background: #d4ddd7;
  color: #718078;
  cursor: not-allowed;
}

#selected-pickup,
#selected-delivery,
#selected-return {
  font-size: 16px;
  line-height: 1.45;
}

.map-wrap {
  min-height: 100vh;
  position: relative;
}

#map {
  height: 100%;
  min-height: 100vh;
  width: 100%;
}

.map-wrap::before {
  background:
    linear-gradient(90deg, rgba(245, 247, 244, 0.72), rgba(245, 247, 244, 0)),
    repeating-linear-gradient(0deg, rgba(23, 32, 27, 0.05), rgba(23, 32, 27, 0.05) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(23, 32, 27, 0.05), rgba(23, 32, 27, 0.05) 1px, transparent 1px, transparent 44px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.map-loaded::before {
  display: none;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .panel {
    box-shadow: none;
    padding: 22px;
  }

  .map-wrap,
  #map {
    min-height: 420px;
  }
}

@media (max-width: 480px) {
  .brand-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .rate-editor {
    justify-content: center;
    width: fit-content;
  }
}
