.tour-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  /* Lets the list shrink and scroll inside a capped flex column. */
  min-height: 0;
}

.tour-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
}

.tour-pager-label {
  color: var(--color-text-muted);
  font-size: 13px;
}

.tour-item {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

/* Revealed by swiping the row right; .tour-item's overflow clips it to the row. */
.tour-item-delete-bg {
  position: absolute;
  inset: 0 50% 0 0;
  display: flex;
  align-items: center;
  padding-left: 20px;
  background: var(--color-danger);
}

.tour-item-delete-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Opaque, so it hides the delete background at rest; pan-y leaves vertical scroll to the browser. */
.tour-item-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-surface);
  cursor: pointer;
  transition: background 0.15s;
  touch-action: pan-y;
}

.tour-item-checkbox {
  flex-shrink: 0;
  /* Visual only: the row's click handler toggles selection, so nothing double-toggles. */
  pointer-events: none;
  accent-color: var(--color-primary);
}

.tour-item-details {
  /* Lets the name's text-overflow ellipsis work inside a flex item. */
  min-width: 0;
  flex: 1;
}

.tour-item-content:hover {
  background: var(--color-surface-2);
}

/* The default outline reads poorly on this row's hover and active backgrounds. */
.tour-item-content:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.tour-item.active .tour-item-content {
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-primary);
  padding-left: 13px;
}

.tour-item-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-item-name mark {
  background: none;
  color: var(--color-primary-text);
  font-weight: 700;
}

.tour-item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.show-all-btn {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  color: var(--color-primary-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: background 0.15s;
}

.show-all-btn:hover {
  background: var(--color-surface-2);
}

.show-all-btn.active {
  background: var(--color-primary-strong);
  color: #fff;
  border-top-color: var(--color-primary-strong);
}

.show-all-btn.active:hover {
  background: var(--color-primary-strong-hover);
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.selection-count {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.selection-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.empty-state {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.map-container {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  /* Not none: that also blocks pull-to-refresh; iOS pinch is handled in ui/map.js. */
  touch-action: pan-x pan-y;
}

/* Grey, not hue-rotated: inverted greens turn harsh; the route pane above is unaffected. */
.map-tiles-dark {
  filter: grayscale(1) invert(1) brightness(0.9) contrast(0.9);
}

.map-top-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  padding: 7px 11px;
  /* <button> doesn't inherit the page font. */
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pin-toggle input {
  cursor: pointer;
  accent-color: var(--color-primary);
}

.line-style-wrap {
  position: relative;
}

.line-style-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 1200;
}

.line-style-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: default;
}

.line-style-field > span:first-child {
  flex: 0 0 52px;
}

.line-style-field input[type='range'] {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.line-style-field input[type='color'] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.line-style-value {
  min-width: 34px;
  text-align: right;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.photo-pin img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  background: var(--color-surface-2);
}

.map-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 500;
}

.map-empty-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  pointer-events: auto;
}

.map-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.map-empty-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.map-empty-card p {
  color: var(--color-text-muted);
  font-size: 13px;
}

.map-empty-card .btn {
  margin-top: 10px;
}

.map-loading-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  color: var(--color-text-muted);
  font-size: 13px;
}
