/* Draw route. Map chrome is in map-shell.css.
   In-page layout (body.map-page) is in map-page.css. */

.route-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.9rem 0.85rem;
}

.route-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.route-dock .dock-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.route-kicker {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--text) 68%, transparent);
}

.route-total {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.route-count {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.route-head .unit-switch {
  margin-top: 0;
}

.route-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.75rem;
}

.route-name-label {
  font-size: 0.9rem;
  font-weight: 650;
}

.route-name-input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.route-name-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.route-dock .chip {
  background: var(--surface);
}

.route-dock .chip:hover,
.route-dock .chip.is-active,
.route-dock .chip[aria-pressed="true"] {
  background: var(--tint-strong);
}

.route-dock .chip:disabled,
.route-dock .chip:disabled:hover {
  background: var(--surface);
}

.route-actions,
.route-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.route-save .route-privacy {
  flex: 1 1 12rem;
  margin: 0;
}

.route-loop {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
}

.route-loop input {
  width: 1.15rem;
  height: 1.15rem;
}

.route-privacy,
.route-hint,
.route-status {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.route-privacy {
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.route-status:empty {
  display: none;
}

.route-legs {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.route-leg {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
}

.route-leg-num {
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.route-leg-text {
  font-variant-numeric: tabular-nums;
}

.route-remove {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.2;
  min-height: 2.25rem;
  padding: 0.2rem 0.1rem;
  cursor: pointer;
}

.route-remove:hover {
  text-decoration: underline;
}

.leaflet-div-icon.route-pin {
  background: transparent;
  border: 0;
}

.route-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.route-pin--first span {
  background: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent);
}

.route-pin--last span {
  background: var(--route, #0369a1);
}

[data-theme="dark"] .route-pin span {
  color: #042f2e;
}

[data-theme="dark"] .route-pin--last span {
  color: #042f2e;
}

.route-popup-remove {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  min-height: 2.25rem;
}

.route-popup-remove:hover {
  text-decoration: underline;
}

/* This page has no chips over the map, so the credit stays at the
   bottom of the tiles. The shared mobile rule lifts it for other tools. */
@media (max-width: 720px) {
  body.is-map .map-app:has(.route-dock) .leaflet-bottom.leaflet-right {
    top: auto;
    bottom: 0;
  }
}

.tool-landing .route-card p {
  margin: 0;
}

.tool-landing .route-card .tool-btn {
  margin-top: 1rem;
}

.tool-landing .route-card h2 {
  margin-bottom: 0.85rem;
}
