/* ==========================================================================
   Search Results page
   ========================================================================== */

/* ==========================================================================
   Compact mobile trip summary + quick filter chips
   ========================================================================== */

.trip-summary-bar {
  display: none;
}

.date-slider-heading {
  display: none;
}

.quick-filters-row {
  display: none;
}

@media (max-width: 900px) {
  .trip-summary-bar {
    display: block;

    background: var(--color-overlay-bg);
    padding: var(--space-4) 20px var(--space-2);
  }

  .trip-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .trip-summary-route {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;

    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--color-overlay-text);
  }

  .trip-summary-route span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trip-summary-route svg {
    flex-shrink: 0;
    opacity: 0.7;
  }

  .trip-summary-edit-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-overlay-text);
    font-size: 13px;
    font-weight: 600;
  }

  .trip-summary-sub {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
  }

  /* The full From/To/Date form: collapsed by default on mobile, opened
     by tapping .trip-summary-edit-btn. Desktop ignores this class
     entirely (see .search-summary-inner above), so it's always visible
     there regardless. */
  .search-summary-inner.summary-form-collapsed {
    display: none;
  }

  .search-summary-inner {
    margin-top: var(--space-4);
  }

  .date-slider-heading {
    display: block;
    margin: var(--space-2) 0 var(--space-3);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-overlay-text);
  }

  .quick-filters-row {
    display: flex;
    gap: 8px;
    margin-top: var(--space-4);
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-filters-row::-webkit-scrollbar {
    display: none;
  }

  .quick-filter-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: var(--color-overlay-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }

  .quick-filter-chip--filters {
    background: rgba(255, 255, 255, 0.12);
  }

  .quick-filter-chip--time.active {
    background: var(--color-navy-cta);
    border-color: var(--color-navy-cta);
    color: var(--color-accent-ink);
  }

  .results-count {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
  }
}

.search-summary-bar {
  background: var(--color-overlay-bg);
  padding: var(--space-8) 40px;
}

.search-summary-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.search-summary-field {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

/* These replace what used to be inline `style="flex:..."` on each field.
   That inline flex-basis (200px / 180px) was fine while the row was laid
   out horizontally, but once .search-summary-inner switches to
   flex-direction: column on mobile, flex-basis applies to the main axis -
   which is now HEIGHT, not width. That forced every field to ~180-200px
   tall (label + input only need ~70px), which is what produced the huge
   empty gaps under each field on mobile. Fixed below by resetting these
   to flex: 1 1 auto inside the column-layout breakpoint. */
.search-summary-field--location {
  flex: 1.4 1 200px;
}

.search-summary-field--date {
  flex: 1.2 1 180px;
}

.search-summary-field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.search-summary-field input,
.search-summary-field .dp-trigger {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-heading);
  font-size: var(--fs-body);
  color: var(--color-text-body);
}

.search-summary-field input:focus,
.search-summary-field .dp-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--color-navy-cta);
  box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.12);
}

/* ---- Inline validation (From / To / Date) ---- */
.search-summary-field.has-error input,
.search-summary-field.has-error .dp-trigger {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.search-summary-field.has-error label {
  color: #dc2626;
}

.summary-form-error {
  max-width: var(--max-width);
  margin: var(--space-3) auto 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-left: 4px solid #dc2626;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #b91c1c;
  font-family: var(--font-heading);
  font-size: var(--fs-small, 14px);
  font-weight: 500;
  line-height: 1.45;
  animation: summaryErrorIn 0.25s ease-out;
}

.summary-form-error.hidden {
  display: none;
}

.summary-form-error svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.summary-form-error ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

:root[data-theme="dark"] .summary-form-error {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
}

:root[data-theme="dark"] .search-summary-field.has-error label {
  color: #f87171;
}

@keyframes summaryErrorIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .summary-form-error {
    animation: none;
  }
}

.search-summary-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  color: var(--color-navy);
  flex-shrink: 0;
  margin-bottom: 2px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.search-summary-swap:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
  transform: rotate(180deg);
}

.search-summary-btn {
  flex: 0 0 auto;
  background: var(--color-navy-cta);
  color: var(--color-overlay-text);
  border-radius: var(--radius-md);
  padding: 13px 28px;
  font-weight: 600;
  font-size: var(--fs-small);
}

.search-summary-btn:hover {
  background: var(--color-navy-cta-hover);
}

/* ==========================================================================
   Mobile quick date strip
   ========================================================================== */

/* Hidden by default - a desktop/tablet passenger already has the full
   calendar in the field above; this swipeable strip is a mobile-only
   shortcut, shown by the @media block further down. */
.date-slider-mobile {
  display: none;
}

@media (max-width: 640px) {
  .date-slider-mobile {
    display: flex;
    gap: 8px;

    margin-top: var(--space-4);

    padding: 2px 2px 6px;

    overflow-x: auto;
    overscroll-behavior-x: contain;

    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
  }

  .date-slider-mobile::-webkit-scrollbar {
    display: none;
  }

  .date-chip {
    flex: 0 0 auto;

    scroll-snap-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;

    width: 56px;
    min-height: 56px;
    padding: 6px 0;

    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);

    color: var(--color-text-body);

    cursor: pointer;
  }

  .date-chip .date-chip-month {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-navy);
  }

  .date-chip .date-chip-day {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
  }

  .date-chip .date-chip-weekday {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .date-chip.active {
    background: var(--color-navy-cta);
    border-color: var(--color-navy-cta);
  }

  .date-chip.active .date-chip-day,
  .date-chip.active .date-chip-weekday,
  .date-chip.active .date-chip-month {
    color: var(--color-accent-ink);
  }
}

/* Toolbar: filters + sort */

.results-toolbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-12) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.results-count {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--color-navy);
}

.results-sort {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.results-sort label {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.results-sort select {
  min-width: 205px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 38px 10px 14px;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-text-body);
  background-color: var(--color-white);

  appearance: none;
  -webkit-appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748B' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  background-repeat: no-repeat;
  background-position: right 14px center;

  cursor: pointer;

  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}

.results-sort select:hover {
  border-color: var(--color-navy-cta);
}

.results-sort select:focus {
  outline: none;
  border-color: var(--color-navy-cta);
  box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.12);
}

/* Bus list */

.bus-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-12) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bus-list-card {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  display: grid;
  grid-template-columns: 270px 1fr 180px;
  align-items: center;
  gap: var(--space-6);
  transition: box-shadow var(--duration-fast);
}

.bus-list-card:hover {
  box-shadow: var(--shadow-route-card);
}

.bus-operator-col {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bus-photo-wrap {
  width: 150px;
  height: 92px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-tag-bg);
  border: 1px solid var(--color-border);
  display: block;
  position: relative;
}

.bus-photo-wrap img.bus-result-photo {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  display: block;
}

.bus-operator-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bus-operator-link {
  text-decoration: none;
  color: inherit;
}

.bus-operator-link h3 {
  margin: 0;
}

.bus-name {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.bus-operator-col img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: var(--color-tag-bg);
  flex-shrink: 0;
}

.bus-operator-col h3 {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 2px;
}

.bus-operator-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.bus-schedule-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* This is the middle column of .bus-list-card's 270px/1fr/auto grid.
     A grid item's default min-width is auto (= its content's intrinsic
     width), so a long boarding/dropping stops line here could force
     this 1fr track wider than the space actually available, pushing
     the price/seats-left/button column off the right edge of the card
     (and the whole page horizontally scrollable) instead of wrapping.
     min-width: 0 lets the track actually shrink to fit. */
  min-width: 0;
}

.bus-schedule-times {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bus-schedule-times .time {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-navy);
}

.bus-schedule-times .duration-line {
  flex: 1 0 0;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bus-schedule-times .duration-line span {
  font-size: 11px;
  color: var(--color-text-muted);
}

.bus-schedule-times .duration-line .line {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  position: relative;
}

.bus-schedule-times .duration-line .line::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.bus-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bus-price-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.bus-price-col .price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-navy);
}

.bus-price-col .seats-left {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.bus-price-col .seats-left.low {
  color: #dc2626;
  font-weight: 600;
}

.bus-select-btn {
  background: var(--color-navy-cta);
  color: var(--color-overlay-text);
  border-radius: var(--radius-md);
  padding: 11px 24px;
  font-weight: 500;
  font-size: var(--fs-small);
  white-space: nowrap;
}

.bus-select-btn:hover {
  background: var(--color-navy-cta-hover);
}

@media (max-width: 1024px) {
  .bus-list-card {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .bus-photo-wrap {
    width: 72px;
    height: 72px;
  }

  .bus-operator-col {
    align-items: center;
  }

  .bus-price-col {
    /* A row here squeezes price + seats-left + button into one cramped
       line at phone widths. Stack them and make the CTA a full-width
       tappable button - the standard mobile booking-card pattern. */
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-2);
    width: 100%;
  }

  .bus-price-col .price {
    text-align: left;
  }

  .bus-price-col .seats-left {
    text-align: left;
  }

  .bus-select-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .search-summary-bar {
    padding: var(--space-3) 20px var(--space-6);
  }

  .search-summary-inner {
    flex-direction: column;
    align-items: stretch;
  }

  /* See the note above .search-summary-field--location: once this
     container is a column, a leftover pixel flex-basis becomes a fixed
     height instead of a width. Reset it here. */
  .search-summary-field,
  .search-summary-field--location,
  .search-summary-field--date {
    flex: 1 1 auto;
  }

  .search-summary-swap {
    display: none;
  }

  .results-toolbar,
  .bus-list {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (max-width: 640px) {
  .results-toolbar,
  .bus-list {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .bus-schedule-times {
    flex-wrap: wrap;
  }

  .bus-list-card {
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .bus-price-col {
    gap: 6px;
  }

  .bus-select-btn {
    padding: 10px 24px;
  }
}

/* --- Advanced filters sidebar --- */
.results-with-filters {
  display: flex;
  gap: 24px;
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding: 0 var(--space-12);
  align-items: flex-start;
}
.results-filters-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 18px;
  position: sticky;
  top: 90px;
}
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.filters-header h3 {
  margin: 0;
  font-size: 16px;
}

/* -------------------------------
   Filters toggle (collapsible panel)
   ------------------------------- */

.filters-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-navy);
}

.filters-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
}

.filters-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--duration-fast) ease;
}

.filters-toggle[aria-expanded="true"] .filters-chevron {
  transform: rotate(180deg);
}

.filters-body.filters-collapsed {
  display: none;
}

.filters-body-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--color-navy);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.filter-group {
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
}
.filter-group:first-of-type {
  border-top: none;
  padding-top: 0;
}
.filter-group h4 {
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--color-navy);
}
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
  color: var(--color-text-body);
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
#priceRangeInput {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  outline: none;
}
#priceRangeInput::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-navy-cta);
  cursor: pointer;
  border: 2px solid var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
#priceRangeInput::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-navy-cta);
  cursor: pointer;
  border: 2px solid var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* --- Compare feature --- */
.bus-compare-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-body);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  position: absolute;
  /* Floats slightly above the card's own top edge instead of sitting flush
     inside it - that's what left it touching the bus photo right below. */
  top: -12px;
  left: 10px;
  z-index: 2;
}
.bus-list-card {
  position: relative;
}

.compare-bar {
  /* Sticky to the bottom of the viewport the whole time the Compare
     checkboxes have a selection - position: fixed already means it never
     scrolls away with the list. */
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-overlay-bg);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 500;
  box-shadow: var(--shadow-dropdown);
}

@media (max-width: 640px) {
  .compare-bar {
    /* Full-width inset bar instead of a centered, content-width pill -
       at phone widths the pill's text + two buttons had nowhere to go
       but wrap onto a second line and overlap the card underneath it. */
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 10px;
  }

  .compare-bar > span {
    flex: 1 1 100%;
    font-size: 13px;
  }

  .compare-bar > div {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }
}

/* .btn-outline is styled for light backgrounds (navy text on navy
   border) - on this always-dark bar that made "Clear" invisible in
   every theme. Scoped override, not a change to .btn-outline itself. */
.compare-bar .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.compare-bar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  width: auto;
}

.compare-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
}
.compare-modal-overlay.open {
  opacity: 1;
}
.compare-modal-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 32px;
}
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
}
.compare-table td,
.compare-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 14px;
}
.compare-table th {
  color: var(--color-navy);
  font-weight: 700;
}
.compare-table td:first-child {
  color: var(--color-text-muted);
  font-weight: 500;
}

@media (max-width: 900px) {
  .results-with-filters {
    flex-direction: column;
    margin-top: 20px;
    padding: 0 var(--space-6);
  }
  .results-filters-sidebar {
    width: 100%;
    position: static;
    height: auto;
    overflow: visible;
  }

  /* The "Filters" chip up in the navy banner already opens this same
     panel - this second header inside the sidebar was a duplicate
     control sitting as a dead-looking full-width bar. Desktop still
     shows it (no chip up there to replace it with). */
  .filters-toggle {
    display: none;
  }

  .filters-body {
    margin-top: 0;
  }

  /* Collapsed by default on mobile/tablet - the filter panel used to
     always render open, pushing the actual bus results far down the
     page. Toggled by #filtersToggleBtn in search-results.js. Desktop
     ignores this class entirely, so the sidebar there stays as before:
     always open. */
  .filters-body.filters-collapsed {
    display: none;
  }
}

@media (max-width: 640px) {
  .results-with-filters {
    margin-top: 16px;
    padding: 0 var(--space-4);
  }

  .filter-checkbox input[type="checkbox"],
  .filter-checkbox input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  .filter-checkbox {
    font-size: 14px;
  }
}

/* Mobile / tablet: once .results-with-filters stacks into a column, the
   desktop `align-items: flex-start` shrinks the bus-list wrapper to its
   content width and pins it to the left. Stretch it to the full width so
   the cards sit centred with equal space on both sides. Desktop (>900px)
   is untouched. */
@media (max-width: 900px) {
  .results-with-filters {
    align-items: stretch;
  }

  .results-with-filters > div {
    width: 100%;
    min-width: 0;
  }

  .results-with-filters .bus-list {
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    /* the wrapper already gives the side gutter (24px / 16px on phones) -
       padding again here doubled it, so cards sat further in than the
       toolbar, the filters and the loading skeleton */
    padding-left: 0;
    padding-right: 0;
  }

  .results-with-filters .bus-list-card {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
  }
}

/* Route (city -> city) is the first line of a result card, no districts. */
.bus-route-line {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-navy, var(--color-text-body));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bus-route-line .bus-route-arrow {
  font-weight: 400;
  color: var(--color-text-muted, #6b7280);
  margin: 0 6px;
}

/* Compact, even amenity chips (max 5 + "+N more") that wrap cleanly. */
.bus-tags-row {
  gap: 6px !important;
  align-items: center;
}
.bus-tags-row .tag {
  font-size: 11px;
  letter-spacing: 0.2px;
  padding: 3px 9px;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 999px;
}
.bus-tags-row .tag.tag-type {
  font-weight: 700;
}
.bus-tags-row .tag[hidden] {
  display: none !important;
}
.bus-tags-row .tag.tag-more {
  background: transparent;
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-family: inherit;
  cursor: pointer;
}
.bus-tags-row .tag.tag-more:hover {
  color: var(--color-text-body);
}
@media (max-width: 600px) {
  .bus-route-line { font-size: 14px; margin-bottom: 6px; }
  .bus-tags-row .tag { font-size: 10.5px; padding: 3px 8px; }
}

.bus-stops-preview {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   Empty state text hierarchy
   ========================================================================== */

.empty-state-title {
  margin: var(--space-2) 0 var(--space-1);
  color: var(--color-navy);
  font-size: 18px;
}

.empty-state-hint {
  margin-top: var(--space-2);
  font-weight: 500;
  color: var(--color-text-body);
}

/* ==========================================================================
   MOBILE BACK BUTTON
   ========================================================================== */

.mobile-back-btn {
  display: none;
}

@media (max-width: 640px) {
  .mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 12px 0 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-navy);
    cursor: pointer;
  }
}

.bus-schedule-times .time {
  white-space: nowrap;
}
.ampm {
  font-size: 0.62em;
  font-weight: 600;
  margin-left: 3px;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Results page at laptop / small-desktop widths (about 901px - 1280px)

   The filter sidebar (260px) sits beside the bus list, so each bus card was
   squeezed into a ~540px column and tried to fit photo + times + amenity
   tags + price into ONE row: the tags stacked one-per-line and the card
   grew tall and empty. Here the card becomes two tidy rows instead:
     row 1:  photo + operator name ............ price / seats / button
     row 2:  times, amenity tags (wrapping in a row) - full card width
   ========================================================================== */
.results-with-filters .bus-list {
  /* the list already lives in a flex column next to the sidebar; its own
     48px side padding only stole width from the cards */
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .results-with-filters {
    gap: 18px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
  .results-filters-sidebar {
    width: 230px;
  }
  .results-with-filters .bus-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "operator price"
      "schedule schedule";
    align-items: center;
    gap: var(--space-4) var(--space-5);
  }
  .results-with-filters .bus-operator-col {
    grid-area: operator;
    min-width: 0;
  }
  .results-with-filters .bus-price-col {
    grid-area: price;
    width: auto;
    min-width: 150px;
    align-items: flex-end;
    text-align: right;
  }
  .results-with-filters .bus-price-col .price,
  .results-with-filters .bus-price-col .seats-left {
    text-align: right;
  }
  .results-with-filters .bus-select-btn {
    width: auto;
  }
  .results-with-filters .bus-schedule-col {
    grid-area: schedule;
    border-top: 1px dashed var(--color-border);
    padding-top: var(--space-4);
  }
  .results-with-filters .bus-photo-wrap {
    width: 120px;
    height: 80px;
  }
  .results-with-filters .bus-tags-row {
    gap: 6px;
  }
}

/* ==========================================================================
   Results page at laptop / small-desktop widths (about 901px - 1280px)

   The filter sidebar (260px) sits beside the bus list, so each bus card was
   squeezed into a ~540px column and tried to fit photo + times + amenity
   tags + price into ONE row: the tags stacked one-per-line and the card
   grew tall and empty. Here the card becomes two tidy rows instead:
     row 1:  photo + operator name ............ price / seats / button
     row 2:  times, amenity tags (wrapping in a row) - full card width
   ========================================================================== */
.results-with-filters .bus-list {
  /* the list already lives in a flex column next to the sidebar; its own
     48px side padding only stole width from the cards */
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .results-with-filters {
    gap: 18px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
  .results-filters-sidebar {
    width: 230px;
  }
  .results-with-filters .bus-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "operator price"
      "schedule schedule";
    align-items: center;
    gap: var(--space-4) var(--space-5);
  }
  .results-with-filters .bus-operator-col {
    grid-area: operator;
    min-width: 0;
  }
  .results-with-filters .bus-price-col {
    grid-area: price;
    width: auto;
    min-width: 150px;
    align-items: flex-end;
    text-align: right;
  }
  .results-with-filters .bus-price-col .price,
  .results-with-filters .bus-price-col .seats-left {
    text-align: right;
  }
  .results-with-filters .bus-select-btn {
    width: auto;
  }
  .results-with-filters .bus-schedule-col {
    grid-area: schedule;
    border-top: 1px dashed var(--color-border);
    padding-top: var(--space-4);
  }
  .results-with-filters .bus-photo-wrap {
    width: 120px;
    height: 80px;
  }
  .results-with-filters .bus-tags-row {
    gap: 6px;
  }
}

/* ==========================================================================
   Tablet / small-laptop result cards (641px - 1280px)
   With the filter sidebar open, three columns (photo | times + tags | price)
   squeezed the middle one so the amenity tags stacked one-per-line. Here the
   card is always two tidy rows, with or without the sidebar:
     row 1:  photo + bus name ............ price / seats left / button
     row 2:  departure - arrival, then amenity tags wrapping in a row
   Kept at the END of the file so it wins over the earlier rules.
   ========================================================================== */
@media (min-width: 641px) and (max-width: 1280px) {
  .bus-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "operator price"
      "schedule schedule";
    align-items: center;
    gap: 22px 20px;
  }
  .bus-list-card .bus-operator-col {
    grid-area: operator;
    min-width: 0;
  }
  .bus-list-card .bus-schedule-col {
    grid-area: schedule;
    border-top: 1px dashed var(--color-border);
    padding-top: 16px;
  }
  .bus-list-card .bus-price-col {
    grid-area: price;
    width: auto;
    min-width: 150px;
    align-items: flex-end;
    text-align: right;
  }
  .bus-list-card .bus-price-col .price,
  .bus-list-card .bus-price-col .seats-left {
    text-align: right;
  }
  .bus-list-card .bus-select-btn {
    width: auto;
  }
  .bus-list-card .bus-photo-wrap {
    width: 120px;
    height: 80px;
  }
  .bus-list-card .bus-tags-row {
    gap: 6px;
  }
  .bus-list-card .bus-schedule-times .duration-line {
    min-width: 60px;
  }
}

/* ==========================================================================
   v22 - "Change travel date" bar (js/results-date-strip.js)
   A white card with the chosen day in big letters (BS or AD), the same day in
   the other calendar, a BS/AD switch, a calendar button and a swipeable row
   of day chips. Holidays / weekly days off get a red border. Shown where the
   compact trip summary is shown (tablet and phone); desktop keeps the form.
   ========================================================================== */
.rds {
  display: none;
}

@media (max-width: 900px) {
  .rds {
    display: block;
    margin-top: var(--space-3);
    padding: 14px 12px 6px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    color: var(--color-navy-strong);
  }

  .rds-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 4px 12px;
  }

  .rds-current {
    flex: 1 1 190px;
    min-width: 0;
  }

  .rds-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .rds-main {
    margin-top: 2px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--color-navy-strong);
  }

  .rds-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 3px;
    font-size: 12px;
    color: var(--color-text-muted);
  }

  .rds-reset {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: #1d4ed8;
    text-decoration: underline;
    cursor: pointer;
  }

  .rds-hol {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
  }
  .rds-hol[hidden] {
    display: none;
  }
  .rds-hol.is-red {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
  }
  .rds-hol.is-part {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
  }

  .rds-tools {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .rds-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(0, 53, 128, 0.06);
  }
  .rds-seg button {
    min-width: 38px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    color: var(--color-text-muted);
    cursor: pointer;
  }
  .rds-seg button[hidden] {
    display: none;
  }
  .rds-seg button.is-on {
    background: #003580;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 53, 128, 0.35);
  }

  .rds-calwrap {
    position: relative;
    display: inline-block;
  }
  .rds-iconbtn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: #003580;
    cursor: pointer;
    transition:
      background 0.15s,
      box-shadow 0.15s;
  }
  .rds-iconbtn:hover {
    background: rgba(0, 53, 128, 0.08);
    box-shadow: 0 2px 8px rgba(0, 53, 128, 0.18);
  }

  .rds-rail {
    position: relative;
  }
  .rds-track {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 14px 4px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    outline: none;
  }
  .rds-track::-webkit-scrollbar {
    display: none;
  }
  .rds-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
  }
  .rds-track:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.35);
    border-radius: 14px;
  }

  .rds-month {
    flex: 0 0 auto;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }
  .rds-month span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
  }

  .rds-chip {
    position: relative;
    flex: 0 0 auto;
    width: 60px;
    height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 0;
    border: 1.25px solid #003580;
    border-radius: 16px;
    background: var(--color-white);
    color: var(--color-navy-strong);
    font: inherit;
    cursor: pointer;
    scroll-snap-align: center;
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.15s,
      box-shadow 0.15s,
      background 0.15s;
  }
  .rds-chip:hover:not(.is-sel) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 53, 128, 0.16);
  }
  .rds-wd {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
  .rds-day {
    font-family: var(--font-heading);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-navy-strong);
  }
  .rds-alt {
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(0, 53, 128, 0.09);
    color: #1e40af;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
  }

  /* weekly day off / public holiday: red border and red number */
  .rds-chip.is-wknd,
  .rds-chip.is-hol,
  .rds-chip.is-hol-part {
    border-color: #dc2626;
  }
  .rds-chip.is-wknd .rds-day,
  .rds-chip.is-hol .rds-day {
    color: #dc2626;
  }
  .rds-chip.is-hol-part .rds-day {
    color: #b45309;
  }

  /* today / tomorrow ribbon */
  .rds-tag {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 6px;
    border-radius: 999px;
    background: #f59e0b;
    color: #1f2937;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  }

  /* the chosen day: filled navy, white text - impossible to miss */
  .rds-chip.is-sel {
    background: linear-gradient(160deg, #0a49a8 0%, #003580 48%, #0f172a 100%);
    box-shadow:
      0 0 0 3px rgba(0, 53, 128, 0.18),
      0 10px 20px rgba(0, 53, 128, 0.36);
    transform: translateY(-2px) scale(1.04);
  }
  .rds-chip.is-sel .rds-wd {
    color: rgba(255, 255, 255, 0.8);
  }
  .rds-chip.is-sel .rds-day {
    color: #ffffff;
  }
  .rds-chip.is-sel .rds-alt {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
  }
  .rds-chip.is-sel.is-wknd,
  .rds-chip.is-sel.is-hol,
  .rds-chip.is-sel.is-hol-part {
    box-shadow:
      0 0 0 3px rgba(220, 38, 38, 0.22),
      0 10px 20px rgba(0, 53, 128, 0.36);
  }

  .rds-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: #003580;
    box-shadow: 0 4px 12px rgba(20, 21, 43, 0.2);
    cursor: pointer;
  }
  .rds-arrow-l {
    left: -6px;
  }
  .rds-arrow-r {
    right: -6px;
  }
  .rds-arrow.is-hidden {
    display: none;
  }

  /* dark theme: the card is dark, borders are a light blue so they show */
  :root[data-theme="dark"] .rds {
    border-color: rgba(255, 255, 255, 0.12);
  }
  :root[data-theme="dark"] .rds-chip {
    border-color: rgba(147, 170, 220, 0.55);
  }
  :root[data-theme="dark"] .rds-chip.is-wknd,
  :root[data-theme="dark"] .rds-chip.is-hol,
  :root[data-theme="dark"] .rds-chip.is-hol-part {
    border-color: #f87171;
  }
  :root[data-theme="dark"] .rds-chip.is-wknd:not(.is-sel) .rds-day,
  :root[data-theme="dark"] .rds-chip.is-hol:not(.is-sel) .rds-day {
    color: #f87171;
  }
  :root[data-theme="dark"] .rds-chip.is-hol-part:not(.is-sel) .rds-day {
    color: #fbbf24;
  }
  :root[data-theme="dark"] .rds-alt {
    background: rgba(147, 170, 220, 0.16);
    color: #bcd0ff;
  }
  :root[data-theme="dark"] .rds-hol.is-red {
    background: rgba(248, 113, 113, 0.16);
    color: #fca5a5;
  }
  :root[data-theme="dark"] .rds-hol.is-part {
    background: rgba(251, 191, 36, 0.14);
    color: #fcd34d;
  }
  :root[data-theme="dark"] .rds-seg {
    background: rgba(255, 255, 255, 0.06);
  }
  :root[data-theme="dark"] .rds-seg button.is-on {
    background: #2a5fd6;
  }
  :root[data-theme="dark"] .rds-iconbtn,
  :root[data-theme="dark"] .rds-arrow {
    color: #93c5fd;
  }
  :root[data-theme="dark"] .rds-reset {
    color: #93c5fd;
  }
  :root[data-theme="dark"] .rds-chip.is-sel {
    background: linear-gradient(160deg, #2a5fd6 0%, #1d4ed8 55%, #172554 100%);
  }
}

/* touch screens just swipe - no arrow buttons */
@media (hover: none) {
  .rds-arrow {
    display: none !important;
  }
}

/* ==========================================================================
   v22 - "Modify" panel on phones / tablets: a clean From / To editor.
   The travel date is changed in the date bar right below it (so the panel
   has no second calendar). Desktop keeps the normal one-row search form.
   ========================================================================== */
@media (max-width: 900px) {
  .search-summary-inner:not(.summary-form-collapsed) {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 46px;
    grid-template-areas:
      "from swap"
      "to   swap"
      "go   go";
    gap: 10px 10px;
    align-items: center;
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    animation: rdsPanelIn 0.22s ease-out;
  }
  @keyframes rdsPanelIn {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field--location:nth-of-type(1) {
    grid-area: from;
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field--location:nth-of-type(2) {
    grid-area: to;
  }
  /* the date is chosen in the date bar below - no second calendar here */
  .search-summary-inner .search-summary-field--date {
    display: none;
  }

  .search-summary-inner:not(.summary-form-collapsed) .search-summary-swap {
    grid-area: swap;
    display: flex;
    justify-self: center;
    width: 42px;
    height: 42px;
    margin: 18px 0 0;
    background: rgba(0, 53, 128, 0.08);
    border: 1px solid var(--color-border);
    color: #003580;
    transform: rotate(90deg);
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-swap:hover {
    background: #003580;
    border-color: #003580;
    color: #ffffff;
    transform: rotate(270deg);
  }

  .search-summary-inner:not(.summary-form-collapsed) .search-summary-field {
    gap: 5px;
    min-width: 0;
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    letter-spacing: 0.8px;
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field--location:nth-of-type(1)
    label::before {
    content: "";
    width: 9px;
    height: 9px;
    border: 2.5px solid #003580;
    border-radius: 50%;
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field--location:nth-of-type(2)
    label::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #dc2626;
  }
  .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field
    input {
    padding: 14px 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
  }

  .search-summary-inner:not(.summary-form-collapsed) .search-summary-btn {
    grid-area: go;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
  }

  :root[data-theme="dark"] .search-summary-inner:not(.summary-form-collapsed) {
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  :root[data-theme="dark"]
    .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-field--location:nth-of-type(1)
    label::before {
    border-color: #93c5fd;
  }
  :root[data-theme="dark"]
    .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-swap {
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd;
  }
  :root[data-theme="dark"]
    .search-summary-inner:not(.summary-form-collapsed)
    .search-summary-btn {
    background: #2a5fd6;
  }
}

/* ==========================================================================
   v22 - date bar: same calm look as the operator date strip.
   normal day: white box, blue border | weekly off / holiday: RED border + red
   text | chosen day: light-blue fill (light-red on a holiday), thick border.
   ========================================================================== */
@media (max-width: 900px) {
  .rds-eyebrow,
  .rds-tag {
    display: none;
  }
  .rds-main {
    font-size: 19px;
  }

  /* holiday line: plain red text, no pill */
  .rds-hol,
  .rds-hol.is-red,
  .rds-hol.is-part {
    margin-top: 3px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
  }
  .rds-hol.is-red {
    color: #dc2626;
  }
  .rds-hol.is-part {
    color: #b45309;
  }

  /* "Back to today" amber pill */
  .rds-reset {
    padding: 2px 10px;
    border-radius: 999px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 11px;
    text-decoration: none;
  }

  /* BS / AD switch with flags */
  .rds-seg button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 30px;
    padding: 0 10px;
  }
  .rds-flag {
    display: block;
    flex: 0 0 auto;
  }
  .rds-flag-uk {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
  }
  .rds-seg button:not(.is-on) .rds-flag {
    opacity: 0.75;
  }
  .rds-seg button.is-on {
    background: linear-gradient(135deg, #003580, #0f172a);
  }

  /* chips */
  .rds-chip {
    width: 58px;
    height: 84px;
    border: 1.5px solid #003580;
    background: #fff;
  }
  .rds-wd,
  .rds-day {
    color: #111827;
  }
  .rds-alt {
    background: #f3f4f6;
    color: #6b7280;
  }
  .rds-chip.is-wknd,
  .rds-chip.is-hol,
  .rds-chip.is-hol-part {
    border-color: #dc2626;
  }
  .rds-chip.is-wknd .rds-wd,
  .rds-chip.is-wknd .rds-day,
  .rds-chip.is-hol .rds-wd,
  .rds-chip.is-hol .rds-day {
    color: #dc2626;
  }
  .rds-chip.is-hol-part .rds-wd,
  .rds-chip.is-hol-part .rds-day {
    color: #b45309;
  }

  /* chosen day */
  .rds-chip.is-sel {
    background: #eff6ff;
    border: 2px solid #1d4ed8;
    transform: translateY(-2px);
    box-shadow:
      0 0 0 3px rgba(29, 78, 216, 0.18),
      0 6px 14px rgba(15, 23, 42, 0.12);
  }
  .rds-chip.is-sel .rds-wd,
  .rds-chip.is-sel .rds-day {
    color: #111827;
  }
  .rds-chip.is-sel .rds-alt {
    background: #e0e7ff;
    color: #3730a3;
  }
  .rds-chip.is-sel.is-wknd,
  .rds-chip.is-sel.is-hol,
  .rds-chip.is-sel.is-hol-part {
    background: #eff6ff;
    border-color: #dc2626;
    box-shadow:
      0 0 0 3px rgba(220, 38, 38, 0.18),
      0 6px 14px rgba(15, 23, 42, 0.12);
  }
  .rds-chip.is-sel.is-wknd .rds-wd,
  .rds-chip.is-sel.is-wknd .rds-day,
  .rds-chip.is-sel.is-hol .rds-wd,
  .rds-chip.is-sel.is-hol .rds-day {
    color: #dc2626;
  }
  .rds-chip.is-sel.is-wknd .rds-alt,
  .rds-chip.is-sel.is-hol .rds-alt {
    background: #e0e7ff;
    color: #3730a3;
  }

  /* ---- dark mode: same as light - plain chips, red stays red ---- */
  :root[data-theme="dark"] .rds {
    border-color: rgba(255, 255, 255, 0.14);
  }
  :root[data-theme="dark"] .rds-main {
    color: #f8fafc;
  }
  :root[data-theme="dark"] .rds-sub,
  :root[data-theme="dark"] .rds-month {
    color: #cbd5e1;
  }
  :root[data-theme="dark"] .rds-chip {
    background: #1b1b1b;
    border-color: #6b8fd6;
  }
  :root[data-theme="dark"] .rds-wd,
  :root[data-theme="dark"] .rds-day {
    color: #f1f5f9;
  }
  :root[data-theme="dark"] .rds-alt {
    background: #2b2b2b;
    color: #cbd5e1;
  }
  :root[data-theme="dark"] .rds-iconbtn,
  :root[data-theme="dark"] .rds-arrow {
    background: #1b1b1b;
    border-color: rgba(255, 255, 255, 0.2);
    color: #bfdbfe;
  }
  /* weekly off / holiday: red border + red text, always */
  :root[data-theme="dark"] .rds-chip.is-wknd,
  :root[data-theme="dark"] .rds-chip.is-hol,
  :root[data-theme="dark"] .rds-chip.is-hol-part {
    border-color: #f05252;
  }
  :root[data-theme="dark"] .rds-chip.is-wknd .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-wknd .rds-day,
  :root[data-theme="dark"] .rds-chip.is-hol .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-hol .rds-day {
    color: #ff6b6b;
  }
  :root[data-theme="dark"] .rds-chip.is-hol-part .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-hol-part .rds-day {
    color: #fbbf24;
  }
  /* chosen day */
  :root[data-theme="dark"] .rds-chip.is-sel {
    background: #1e2a44;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
  }
  :root[data-theme="dark"] .rds-chip.is-sel .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-sel .rds-day {
    color: #ffffff;
  }
  :root[data-theme="dark"] .rds-chip.is-sel .rds-alt {
    background: #334155;
    color: #e2e8f0;
  }
  /* chosen holiday / weekly off: stays red */
  :root[data-theme="dark"] .rds-chip.is-sel.is-wknd,
  :root[data-theme="dark"] .rds-chip.is-sel.is-hol {
    background: #3a1a1f;
    border-color: #f05252;
    box-shadow: 0 0 0 3px rgba(240, 82, 82, 0.28);
  }
  :root[data-theme="dark"] .rds-chip.is-sel.is-wknd .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-sel.is-wknd .rds-day,
  :root[data-theme="dark"] .rds-chip.is-sel.is-hol .rds-wd,
  :root[data-theme="dark"] .rds-chip.is-sel.is-hol .rds-day {
    color: #ff6b6b;
  }
  :root[data-theme="dark"] .rds-chip.is-sel.is-wknd .rds-alt,
  :root[data-theme="dark"] .rds-chip.is-sel.is-hol .rds-alt {
    background: #4a2328;
    color: #fecaca;
  }
  :root[data-theme="dark"] .rds-chip.is-sel.is-hol-part {
    background: #3a2d12;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
  }
  :root[data-theme="dark"] .rds-hol.is-red {
    background: transparent;
    color: #f87171;
  }
  :root[data-theme="dark"] .rds-hol.is-part {
    background: transparent;
    color: #fbbf24;
  }
  :root[data-theme="dark"] .rds-reset {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fcd34d;
  }
  :root[data-theme="dark"] .rds-seg button.is-on {
    background: linear-gradient(135deg, #2a5fd6, #172554);
  }
}

/* Price after the passenger's own Diamond coins */
.bus-price-col .price--was {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.bus-price-col .price--now {
  color: #1f9d55;
}
.bus-price-col .price-note {
  font-size: 11px;
  font-weight: 700;
  color: #1f9d55;
  margin-bottom: 2px;
}
