:root {
  --route-forest: #174f2b;
  --route-leaf: #267044;
  --route-leaf-dark: #103b22;
  --route-amber: #c87924;
  --route-amber-dark: #7a4316;
  --route-paper: #ffffff;
  --route-mint: #f0f7f1;
  --route-ink: #18241d;
  --route-muted: #526159;
  --route-line: #cbd9ce;
  --route-max-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--route-mint);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--route-ink);
  background: var(--route-paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.city-green-route {
  min-height: 100vh;
}

.route-shell {
  width: min(var(--route-max-width), calc(100% - 28px));
  margin: 0 auto;
}

.route-topbar {
  color: #ffffff;
  background: var(--route-forest);
}

.route-topbar .route-shell {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.route-brand,
.route-nav {
  display: flex;
  align-items: center;
}

.route-brand {
  min-height: 44px;
  min-width: 0;
  gap: 9px;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.route-brand img {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
}

.route-brand span {
  overflow-wrap: anywhere;
}

.route-nav {
  min-width: 0;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.route-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.route-nav a:hover,
.route-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.route-hero {
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--route-line);
  background: var(--route-mint);
}

.route-eyebrow {
  margin: 0 0 5px;
  color: var(--route-amber-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.route-hero h1 {
  max-width: 680px;
  margin: 0;
  color: var(--route-leaf-dark);
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.route-hero-copy {
  max-width: 720px;
  margin: 8px 0 14px;
  color: var(--route-muted);
  line-height: 1.55;
}

[data-locate-routes],
.route-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

[data-locate-routes] {
  color: #ffffff;
  background: var(--route-leaf);
}

[data-locate-routes]:hover,
[data-locate-routes]:focus-visible,
.route-action-primary:hover,
.route-action-primary:focus-visible {
  background: var(--route-leaf-dark);
}

[data-route-status] {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--route-muted);
  font-size: 0.86rem;
}

.route-list-section,
.route-detail-section,
.route-map-section {
  border-bottom: 1px solid var(--route-line);
}

.route-list-section {
  padding: 18px 0 20px;
  background: var(--route-paper);
}

.route-list-section h2,
.route-map-section h2,
.route-detail-title {
  margin: 0;
  color: var(--route-leaf-dark);
  font-size: 1.35rem;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

[data-route-list] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.route-list-fallback {
  margin: 0;
  color: var(--route-muted);
}

.route-fallback-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--route-leaf-dark);
  font-weight: 900;
}

.route-card {
  width: 100%;
  min-height: 70px;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--route-line);
  border-radius: 8px;
  color: var(--route-ink);
  background: var(--route-paper);
  text-align: left;
  cursor: pointer;
}

.route-card:hover,
.route-card:focus-visible {
  border-color: var(--route-leaf);
  background: var(--route-mint);
}

.route-card[aria-current="true"] {
  border-color: var(--route-amber);
  box-shadow: inset 4px 0 0 var(--route-amber);
  background: #fffaf2;
}

.route-card-title {
  color: var(--route-leaf-dark);
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.route-card-meta {
  color: var(--route-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.route-card-species,
.route-card-nearby-distance {
  font-size: 0.8rem;
  line-height: 1.35;
}

.route-card-species {
  color: var(--route-leaf-dark);
}

.route-card-nearby-distance {
  color: var(--route-amber-dark);
  font-weight: 900;
}

.route-list-loading {
  min-height: 140px;
  display: flex;
  align-items: center;
  margin: 10px 0 0;
  color: var(--route-muted);
}

.route-detail-section {
  padding: 26px 0;
  background: var(--route-mint);
}

.route-detail-section > p:first-child {
  margin: 0;
  color: var(--route-muted);
}

.route-detail-summary {
  max-width: 740px;
  margin: 8px 0 0;
  color: var(--route-muted);
  line-height: 1.65;
}

.route-detail-facts {
  margin: 10px 0 0;
  color: var(--route-amber-dark);
  font-weight: 900;
}

.route-tree-title {
  margin: 20px 0 8px;
  color: var(--route-leaf-dark);
  font-size: 1rem;
}

.route-tree-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-tree-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 0;
  color: var(--route-leaf-dark);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.route-action-primary {
  color: #ffffff;
  background: var(--route-leaf);
}

.route-action-secondary {
  border-color: var(--route-leaf);
  color: var(--route-leaf-dark);
  background: var(--route-paper);
}

.route-action-secondary:hover,
.route-action-secondary:focus-visible {
  background: #e7f2e9;
}

.route-map-section {
  padding: 28px 0 34px;
  background: var(--route-paper);
}

.route-map-intro {
  margin: 6px 0 14px;
  color: var(--route-muted);
  line-height: 1.55;
}

[data-route-map] {
  width: 100%;
  height: clamp(320px, 52vh, 520px);
  overflow: hidden;
  border: 1px solid var(--route-line);
  border-radius: 8px;
  background: #e8f0e8;
}

[data-route-map] .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.route-map-fallback {
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--route-muted);
  text-align: center;
}

[data-route-map-status] {
  min-height: 24px;
  margin: 9px 0 0;
  color: var(--route-muted);
  font-size: 0.88rem;
}

.route-map-line,
.route-map-tree,
.route-map-start,
.route-map-end {
  cursor: pointer;
}

.route-map-endpoint {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.route-map-endpoint-visual {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(24, 36, 29, 0.32);
}

.route-map-start {
  background: transparent;
}

.route-map-end {
  background: transparent;
}

.route-map-start .route-map-endpoint-visual {
  background: #17633a;
}

.route-map-end .route-map-endpoint-visual {
  background: #c87924;
}

.route-map-line:focus,
.route-map-tree:focus,
.route-map-start:focus,
.route-map-end:focus {
  outline: 3px solid var(--route-amber);
  outline-offset: 2px;
}

.route-map-tooltip {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}

.route-footer {
  padding: 22px 0;
  color: var(--route-muted);
  background: #e8f1e9;
}

.route-footer p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .route-shell {
    width: min(100% - 24px, var(--route-max-width));
  }

  .route-topbar .route-shell {
    min-height: 54px;
    align-items: flex-start;
    padding-block: 5px;
    gap: 8px;
  }

  .route-brand span {
    font-size: 0.9rem;
  }

  .route-nav a {
    padding-inline: 8px;
    font-size: 0.82rem;
  }

  .route-nav {
    max-width: 232px;
    row-gap: 0;
  }

  .route-hero {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .route-hero h1 {
    font-size: 1.7rem;
  }

  .route-hero-copy {
    margin-top: 6px;
    margin-bottom: 11px;
    font-size: 0.92rem;
  }

  [data-locate-routes],
  .route-action {
    width: 100%;
  }

  .route-list-section {
    padding-top: 14px;
    padding-bottom: 16px;
  }

  [data-route-list],
  .route-tree-list {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 88px;
    padding-block: 9px;
  }

  .route-detail-section,
  .route-map-section {
    padding-top: 22px;
    padding-bottom: 26px;
  }
}

@media (max-width: 360px) {
  .route-brand span {
    display: none;
  }
}
