:root {
  --ink: #142b25;
  --muted: #64736f;
  --green: #1c6553;
  --green-dark: #164d40;
  --mint: #e8f0eb;
  --cream: #f7f4ec;
  --orange: #ef7045;
  --line: #d9dfda;
  --white: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 66px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 800; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--green); }
.tagline { color: var(--muted); font-size: 13px; }

.layout { height: calc(100vh - 66px); display: grid; grid-template-columns: minmax(360px, 470px) 1fr; }
.panel { overflow-y: auto; padding: 40px 42px 60px; background: var(--cream); }
.intro { margin-bottom: 35px; }
.eyebrow { margin: 0 0 10px; color: var(--orange); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(39px, 4vw, 53px); line-height: .98; letter-spacing: -.035em; }
.intro > p:last-child { margin: 18px 0 0; max-width: 390px; color: var(--muted); line-height: 1.55; }

.form-section { padding: 25px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.section-heading h2 { margin: 0 0 2px; font-size: 16px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.step { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 12px; font-weight: 800; }

textarea, input { width: 100%; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 13px; resize: vertical; line-height: 1.45; font-size: 12px; }
input { height: 45px; padding: 0 13px; }
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(28 101 83 / 10%); }

.button-row { display: flex; gap: 9px; margin-top: 10px; }
.button { min-height: 43px; padding: 0 18px; border: 0; border-radius: 10px; font-weight: 750; }
.primary { color: white; background: var(--green); }
.primary:hover, .route-button:hover { background: var(--green-dark); }
.secondary { color: var(--green); background: var(--mint); }
.button:disabled { cursor: wait; opacity: .58; }
.route-button { width: 100%; margin-top: 13px; color: white; background: var(--green); }

.locations { display: grid; gap: 9px; }
.location { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgb(255 255 255 / 70%); }
.location-row { display: grid; grid-template-columns: 28px 1fr 32px; gap: 8px; align-items: center; }
.location-number { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--orange); font-size: 11px; font-weight: 800; }
.location input { height: 38px; font-size: 12px; }
.location-status { margin: 7px 0 0 36px; color: var(--muted); font-size: 11px; }
.location.error { border-color: #dfa99b; }
.location.error .location-status { color: #a63d26; }
.remove { border: 0; color: var(--muted); background: transparent; font-size: 19px; }
.link-button { margin-left: 4px; padding: 0; border: 0; color: var(--green); background: transparent; text-decoration: underline; font-size: inherit; font-weight: 750; }
.field-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 750; }
.input-action { display: grid; grid-template-columns: 1fr 45px; gap: 8px; }
.icon-button { border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--green); font-size: 22px; }

.summary { margin-top: 16px; padding: 18px; border-radius: 12px; color: white; background: var(--ink); }
.summary-stats { display: flex; gap: 24px; margin-bottom: 14px; }
.summary strong { display: block; font-size: 22px; }
.summary span { color: #b9c8c4; font-size: 11px; }
.summary ol { margin: 0; padding-left: 22px; font-size: 12px; line-height: 1.8; }
.message { margin-top: 12px; padding: 11px 13px; border-radius: 9px; color: #8b321f; background: #f9ded5; font-size: 12px; }
.hidden { display: none !important; }

.map-wrap { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; }
.map-badge { position: absolute; right: 10px; bottom: 9px; z-index: 2; padding: 5px 8px; border-radius: 6px; color: #52615d; background: rgb(255 255 255 / 86%); font-size: 9px; }
.marker { width: 33px; height: 33px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); color: white; background: var(--orange); box-shadow: 0 3px 8px rgb(20 43 37 / 28%); font-weight: 800; }
.marker span { transform: rotate(45deg); }
.marker.origin { background: var(--green); }

@media (max-width: 800px) {
  .topbar { height: 58px; padding: 0 18px; }
  .tagline { display: none; }
  .layout { height: auto; min-height: calc(100vh - 58px); display: flex; flex-direction: column; }
  .panel { order: 2; padding: 28px 20px 50px; overflow: visible; }
  .map-wrap { order: 1; height: 43vh; min-height: 330px; }
  h1 { font-size: 42px; }
}
