.route-page .route-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #101820 0%, #243447 55%, #0b6f6a 100%);
  border-radius: 8px;
}

.route-page .route-hero h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.route-page .route-hero p {
  max-width: 720px;
  margin: 0 0 16px;
  color: #dbe7ee;
}

.route-page .route-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-page .route-hero-map {
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background:
    linear-gradient(rgba(16, 24, 32, .2), rgba(16, 24, 32, .74)),
    url("/img/carousel-1.jpg") center / cover;
}

.route-page .route-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 200px) minmax(150px, 190px);
  gap: 8px;
  align-items: stretch;
  margin-bottom: 14px;
}

.route-page .listing-search,
.route-page .route-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
}

.route-page .listing-search i,
.route-page .route-filter i {
  flex: 0 0 auto;
  color: #1479d4;
}

.route-page .listing-search .form-control,
.route-page .route-filter .form-control {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.route-page .route-summary {
  margin: 0 0 14px;
  color: #344054;
  font-size: .95rem;
}

.route-card .route-card-map {
  display: flex;
  min-height: 150px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #172434, #0b6f6a);
}

.route-card .route-card-map img {
  width: 100%;
  height: 180px;
  display: block;
  object-fit: cover;
  transition: transform .25s ease;
}

.route-card:hover .route-card-map img {
  transform: scale(1.025);
}

.route-card .route-card-map i {
  font-size: 2rem;
}

.route-facts {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: #4f5f70;
  font-size: .93rem;
}

.route-facts span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-builder {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.route-builder-panel,
.route-detail-panel {
  padding: 16px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #fff;
}

.route-builder-panel h3,
.route-detail-panel h2 {
  margin: 0 0 12px;
  color: #20212b;
  font-size: 1.25rem;
}

.route-builder-map,
.route-detail-map {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #eef3f7;
}

.route-builder-form {
  display: grid;
  gap: 12px;
}

.route-builder-form label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #344054;
  font-weight: 700;
}

.route-builder-form label small {
  color: #66788a;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.4;
}

.route-image-preview {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #385069;
  border-radius: 10px;
  background: #0d1a28;
}

.route-image-preview[hidden] {
  display: none;
}

.route-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.route-builder-form textarea {
  min-height: 110px;
  resize: vertical;
}

.route-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.route-mode-picker button,
.route-stop-row button,
.route-rating button {
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #20212b;
  min-height: 40px;
}

.route-mode-picker button.is-active {
  color: #fff;
  background: #0b6f6a;
  border-color: #0b6f6a;
}

.route-stops {
  display: grid;
  gap: 8px;
}

.route-stop-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px 34px;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #f8fafc;
}

.route-stop-row input {
  min-width: 0;
}

.route-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.route-stat {
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #385069;
  border-radius: 10px;
  background: linear-gradient(145deg, #14283b, #0b1724);
  color: #b9c8d6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.route-stat span {
  display: block;
  margin-bottom: 4px;
  color: #b9c8d6;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.route-stat strong {
  display: block;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.25;
}

.route-builder-actions,
.route-detail-actions,
.route-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}

.route-detail-main h1 {
  margin: 0 0 10px;
  color: #20212b;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.route-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  color: #4f5f70;
}

.route-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.route-point-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-point-list li {
  padding: 10px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #f8fafc;
}

.route-rating {
  display: flex;
  gap: 5px;
  margin: 8px 0;
}

.route-rating button {
  width: 40px;
  color: #b45309;
}

.route-rating button.is-selected {
  color: #fff;
  background: #f5a623;
  border-color: #f5a623;
}

.route-comment {
  padding: 12px 0;
  border-bottom: 1px solid #e5edf5;
}

.route-comment:last-child {
  border-bottom: 0;
}

.route-comment header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
  font-weight: 700;
}

.route-comment p {
  margin: 6px 0 0;
}

.route-status {
  min-height: 22px;
  margin: 0;
  color: #4f5f70;
}

.route-empty {
  padding: 18px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #f8fafc;
}

/* Route details use the active site theme instead of fixed white panels. */
html[data-theme] .route-page {
  color: var(--color-text-primary);
  background: var(--color-page);
}

html[data-theme] .route-page .route-detail-main h1,
html[data-theme] .route-page .route-detail-main h2,
html[data-theme] .route-page .route-detail-panel h2,
html[data-theme] .route-page .route-comment strong {
  color: var(--color-text-primary);
}

html[data-theme] .route-page .route-detail-main > p:not(.detail-eyebrow),
html[data-theme] .route-page .route-detail-meta,
html[data-theme] .route-page .route-status,
html[data-theme] .route-page .route-comment,
html[data-theme] .route-page .detail-info-grid p {
  color: var(--color-text-secondary);
}

html[data-theme] .route-page .route-detail-panel,
html[data-theme] .route-page .detail-info-grid section,
html[data-theme] .route-page .route-point-list li,
html[data-theme] .route-page .route-empty {
  border-color: var(--color-border-default);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

html[data-theme] .route-page .route-detail-panel hr,
html[data-theme] .route-page .route-comment {
  border-color: var(--color-border-default);
}

html[data-theme] .route-page .route-detail-panel .form-control {
  border-color: var(--color-border-default);
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}

html[data-theme] .route-page .route-detail-panel .form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme] .route-page .route-rating button {
  border-color: var(--color-border-default);
  background: var(--color-surface-1);
  color: #f5a623;
}

html[data-theme] .route-page .route-rating button:hover,
html[data-theme] .route-page .route-rating button:focus-visible,
html[data-theme] .route-page .route-rating button.is-selected {
  border-color: #f5a623;
  background: #f5a623;
  color: #111820;
}

@media (max-width: 991.98px) {
  .route-page .route-hero,
  .route-builder,
  .route-detail-shell {
    grid-template-columns: 1fr;
  }

  .route-builder-map,
  .route-detail-map {
    min-height: 420px;
  }
}

@media (max-width: 767.98px) {
  .route-page .route-toolbar {
    grid-template-columns: 1fr;
  }

  .route-page .route-hero {
    padding: 18px;
  }

  .route-mode-picker {
    grid-template-columns: 1fr;
  }

  .route-stats {
    grid-template-columns: 1fr;
  }
}
