:root {

  --cream: #f2e3ce;

  --paper: #fbf4e9;

  --ink: #212333;
  --muted: #6f7777;
  --blue: #5f8c8b;
  --blue-deep: #385c66;
  --green: #cbd8c5;
  --yellow: #f0c375;
  --coral: #e97654;
  --coral-deep: #c95f45;
  --line: #d8cabb;
  --shadow: 0 16px 40px rgba(33, 35, 51, .13);
  --font-ui: "Nunito Sans", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Nunito Sans",
    system-ui, sans-serif;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);

}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  height: 76px;
  padding: 12px clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(251, 244, 233, .93);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon-frame {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid rgba(33, 35, 51, .08);
  box-shadow: 0 5px 14px rgba(33, 35, 51, .10);

}

.brand-icon {
  width: 54px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

.brand-name {
  font-family: "Nunito Sans", "Avenir Next Rounded",
    "Avenir Next", system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 0em;
  line-height: 1;
  color: var(--ink);
}

main {
  display: grid;
  grid-template-columns: minmax(330px, 430px) 1fr;
  grid-template-rows: minmax(590px, calc(100vh - 76px)) auto;
}

.planner {
  padding: 30px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.map-panel {
  position: relative;
  min-height: 590px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 590px;
  background: #d8dfd9;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .74rem;
  font-weight: 800;
  color: var(--blue-deep);
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

h2 {
  font-size: 1.35rem;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: .9rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fffaf2;
  color: var(--ink);
  outline: none;
  transition: .2s;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(95, 140, 139, .22);
}

.time-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.primary-button,
.ghost-button,
.add-stop,
.map-action {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  padding: 15px 20px;
  background: var(--coral);
  color: #fffaf5;
  margin-top: 5px;
  box-shadow: var(--shadow);
}

.primary-button:hover {
  background: var(--coral-deep);
}

.ghost-button {
  padding: 10px 16px;
  background: var(--green);
  color: var(--ink);
}

.text-button {
  border: 0;
  background: none;
  color: var(--blue-deep);
  font-weight: 800;
  padding: 4px;
  white-space: nowrap;
}

.add-stop {
  justify-self: start;
  padding: 9px 14px;
  background: #e9eee4;
  color: var(--ink);
}

.stops {
  display: grid;
  gap: 12px;
}

.stop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 78px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px dashed #aebfa9;
  border-radius: 18px;
  background: #f4f3e9;
}

.duration-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.duration-control input {
  padding-right: 5px;
}

.duration-control span {
  font-weight: 600;
  color: var(--muted);
}

.remove-stop {
  width: 34px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #a5524d;
  font-size: 1.55rem;
}

.status {
  color: var(--muted);
  margin: 16px 0 0;
  min-height: 2.5em;
  font-size: .9rem;
}

.map-action {
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 13px 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.map-action:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 24px clamp(18px, 4vw, 48px) 46px;
}

.hidden {
  display: none;
}

.summary-card,
.timeline-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(33, 35, 51, .07);
}

.summary-card.accent {
  background: var(--yellow);
  border-color: transparent;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  margin-bottom: 8px;
}

.summary-card strong {
  font-size: 1.35rem;
}

.timeline-card {
  grid-column: 1 / -1;
}

.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 90px 22px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 66px;
}

.timeline-time {
  font-weight: 800;
  color: var(--blue-deep);
}

.timeline-line {
  position: relative;
  height: 100%;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--blue);
  display: block;
}

.timeline-line::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 6px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline li:last-child .timeline-line::after {
  display: none;
}

.timeline-title {
  font-weight: 800;
}

.timeline-detail {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 4px;
}

.weather-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7efec;
  font-size: .82rem;
}

.user-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue-deep);
  border: 4px solid white;
  box-shadow: 0 0 0 3px rgba(56, 92, 102, .24);
}

@media (max-width: 900px) {
  .app-header {
    height: 68px;
  }

  .brand {
    width: 150px;
  }

  main {
    display: block;
  }

  .planner {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px 18px;
  }

  .map-panel,
  #map {
    min-height: 58vh;
    height: 58vh;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 18px;
  }
}

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

  .stop-row {
    grid-template-columns: minmax(0, 1fr) 100px 70px;
    padding: 10px;
  }

  .summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-card {
    padding: 15px;
  }

  .summary-card strong {
    font-size: 1.05rem;
  }

  .timeline li {
    grid-template-columns: 70px 20px 1fr;
  }
}

.weather-dot-wrap {
  background: transparent;
  border: 0;
}

.weather-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 250, 242, .96);
  box-shadow:
    0 2px 8px rgba(33, 35, 51, .28),
    0 0 0 1px rgba(33, 35, 51, .14);
  transition: transform .15s ease, box-shadow .15s ease;
}

.weather-dot:hover {
  transform: scale(1.22);
  box-shadow:
    0 3px 10px rgba(33, 35, 51, .38),
    0 0 0 2px rgba(255, 250, 242, .9);
}

.weather-dot--stop {
  width: 18px;
  height: 18px;
  border-width: 3px;
}

.weather-dot--good {
  background: #6f9b83;
}

.weather-dot--watch {
  background: #e3b85f;
}

.weather-dot--challenging {
  background: #df8758;
}

.weather-dot--bad {
  background: #c95545;
}

.weather-popup {
  color: var(--ink);
  min-width: 190px;
}

.weather-popup > strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 3px;
}

.weather-popup-time {
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 9px;
}

.weather-popup-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.weather-popup-symbol {
  font-size: 1.45rem;
}

.weather-popup-main b {
  font-size: 1.08rem;
}

.weather-popup-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: .8rem;
}

.weather-popup--stop section {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.weather-popup--stop h4 {
  margin: 0 0 5px;
  font-size: .86rem;
  color: var(--blue-deep);
}

.place-confirmation {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #aac1bd;
  border-radius: 18px;
  background: #edf2ec;
}

.confirmation-heading {
  margin-bottom: 12px;
}

.place-confirmation h2 {
  font-size: 1.08rem;
}

.place-choices {
  display: grid;
  gap: 10px;
}

.place-choice span {
  font-size: .78rem;
  color: var(--muted);
}

.place-choice select {
  padding: 11px 12px;
}

.confirmation-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.compact-button {
  margin: 0;
  padding: 11px 16px;
}

.stop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  align-items: center;
}

.move-stop,
.remove-stop {
  border: 0;
  border-radius: 8px;
  background: #e6ece5;
  color: var(--ink);
  height: 20px;
  line-height: 1;
  padding: 0;
}

.remove-stop {
  grid-column: 1 / -1;
  width: auto;
  height: 20px;
  font-size: 1.1rem;
  background: #f4dfd8;
  color: #a5524d;
}

.move-stop:disabled {
  opacity: .28;
  cursor: default;
}

.journey-bar {
  position: absolute;
  z-index: 520;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: 16px;
  background: rgba(251, 244, 233, .95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-align: center;
  pointer-events: none;
}

.journey-bar strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .95rem;
}

.journey-bar span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

@media (max-width: 560px) {
  .journey-bar {
    top: 10px;
    padding: 9px 12px;
  }

  .journey-bar span {
    font-size: .7rem;
  }

  .confirmation-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .confirmation-actions button {
    width: 100%;
  }
}

.saved-trips {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.saved-trips-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.saved-trips-heading h2 {
  font-size: 1.05rem;
}

.saved-trips-list {
  display: grid;
  gap: 8px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.saved-trip {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 6px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf2;
  overflow: hidden;
}

.saved-trip-open {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  color: var(--ink);
}

.saved-trip-open strong,
.saved-trip-open span {
  display: block;
}

.saved-trip-open strong {
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-trip-open span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-trip-delete {
  border: 0;
  background: #f4dfd8;
  color: #a5524d;
  font-size: 1.2rem;
}

.weather-summary-card {
  grid-column: 1 / -1;
  background: linear-gradient(
    135deg,
    #f5eee1,
    #e6efeb
  );
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(33, 35, 51, .07);
}

.weather-summary-text {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.55;
  max-width: 900px;
}