/*
 * RadarČeska — Bus Passenger Compact v1.8.1
 *
 * Passenger v1.8.0 remains the design / data layer.
 * This file only bounds journey height and adds compact
 * progressive-stop presentation.
 *
 * No forced priority declarations.
 */


/* ==========================================================
   WHOLE DETAIL CARD
   ========================================================== */

.app-shell[data-mode="buses"] #busDetailCard {
    max-height:
        min(
            720px,
            calc(100dvh - 126px)
        );

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

    scrollbar-width: thin;
}


/* ==========================================================
   JOURNEY
   ========================================================== */

.app-shell[data-mode="buses"] #busJourney {
    margin-top: 10px;
}

.app-shell[data-mode="buses"] #busJourneyNearby {
    display: none;
}

/*
 * Native old whole-timetable toggle is replaced by our
 * progressive passenger control.
 */
.app-shell[data-mode="buses"] #busJourneyToggle {
    display: none;
}


/* no second scroll area inside the detail card */
.app-shell[data-mode="buses"] #busJourneyTimeline {
    max-height: none;
    overflow: visible;

    margin-top: 8px;
}


/* ==========================================================
   COMPACT STOP ROWS
   ========================================================== */

.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop {

    min-height: 39px;

    padding-top: 4px;
    padding-bottom: 4px;
}


.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop-copy {

    min-width: 0;
}


.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop-copy b {

    font-size: 11.5px;
    line-height: 1.22;
}


.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop-copy small {

    margin-top: 1px;

    font-size: 9px;
    line-height: 1.2;
}


.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop time {

    font-size: 10px;
    line-height: 1.1;
}


/* ==========================================================
   LOAD MORE
   ========================================================== */

.app-shell[data-mode="buses"]
.rc-bus-journey-more-v181 {

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 36px;

    margin: 7px 0 2px;
    padding: 7px 12px;

    border: 1px solid #dbe7ef;
    border-radius: 10px;

    background: #f7fafc;

    color: #37627f;

    font: inherit;
    font-size: 10.5px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.app-shell[data-mode="buses"]
.rc-bus-journey-more-v181:hover {

    background: #f1f7fb;
    border-color: #cadde9;
}


.app-shell[data-mode="buses"]
.rc-bus-journey-more-v181:active {

    transform: translateY(1px);
}


.app-shell[data-mode="buses"]
.rc-bus-journey-more-v181 span {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 19px;
    height: 19px;

    border-radius: 999px;

    background: #e8f3fb;
    color: #1674bd;

    font-size: 13px;
    line-height: 1;
}


/* ==========================================================
   COMPACT SUMMARY
   ========================================================== */

.app-shell[data-mode="buses"]
#busJourney
.bus-journey-summary {

    gap: 6px;
}


.app-shell[data-mode="buses"]
#busJourney
.bus-journey-summary-item {

    min-width: 0;

    padding-top: 7px;
    padding-bottom: 7px;
}


.app-shell[data-mode="buses"]
#busJourney
.bus-journey-summary-item span {

    font-size: 8px;
}


.app-shell[data-mode="buses"]
#busJourney
.bus-journey-summary-item strong {

    font-size: 10.5px;
    line-height: 1.18;

    overflow: hidden;
    text-overflow: ellipsis;
}


.app-shell[data-mode="buses"]
#busJourney
.bus-journey-summary-item small {

    font-size: 8.5px;
}


/* ==========================================================
   V1.8.0 PASSENGER ROOT
   ========================================================== */

.app-shell[data-mode="buses"] #busPassengerV180 {
    margin-bottom: 8px;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 700px) {

    .app-shell[data-mode="buses"] #busDetailCard {

        /*
         * Deliberately smaller than old ~84dvh.
         * The map must remain clearly visible above the sheet.
         */
        max-height: 74dvh;

        padding-bottom:
            max(
                12px,
                env(safe-area-inset-bottom)
            );
    }


    .app-shell[data-mode="buses"] #busJourney {

        margin-top: 7px;
    }


    .app-shell[data-mode="buses"]
    #busJourney
    .bus-journey-head {

        margin-bottom: 6px;
    }


    .app-shell[data-mode="buses"]
    #busJourney
    .bus-journey-summary {

        gap: 4px;
    }


    .app-shell[data-mode="buses"]
    #busJourney
    .bus-journey-summary-item {

        padding:
            6px 6px;
    }


    .app-shell[data-mode="buses"]
    #busJourney
    .bus-journey-summary-item strong {

        font-size: 10px;
    }


    .app-shell[data-mode="buses"]
    #busJourneyTimeline {

        margin-top: 5px;
    }


    .app-shell[data-mode="buses"]
    #busJourneyTimeline
    .bus-journey-stop {

        min-height: 37px;

        padding-top: 3px;
        padding-bottom: 3px;
    }


    .app-shell[data-mode="buses"]
    .rc-bus-journey-more-v181 {

        min-height: 39px;

        margin-top: 6px;

        font-size: 11px;
    }
}

/* ==================================================================
   RADARCESKA BUS PASSENGER COMPACT v1.8.2
   SINGLE PROGRESSIVE JOURNEY OWNER
   ================================================================== */

.app-shell[data-mode="buses"]
#busJourney
.rc-v182-superseded {
  display: none;
}

.app-shell[data-mode="buses"]
#busJourneyNearby[hidden] {
  display: none;
}

.app-shell[data-mode="buses"]
#busJourneyTimeline
.bus-journey-stop[hidden] {
  display: none;
}

.app-shell[data-mode="buses"]
#rcBusJourneyMoreV182 {
  width: 100%;
  margin-top: 8px;
}

/* ==================================================================
   RADARCESKA BUS DETAIL PREMIUM v1.9.0
   CLEAN / COMPACT / SINGLE JOURNEY OWNER
   ================================================================== */

.app-shell[data-mode="buses"] #busDetailCard {
  width: min(390px, calc(100vw - 24px));
  max-width: 390px;
  max-height: min(690px, calc(100dvh - 96px));
  padding: 11px 12px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-topline {
  margin-bottom: 4px;
}

.app-shell[data-mode="buses"] #busDetailTitle {
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -.025em;
}

.app-shell[data-mode="buses"] #busDetailDestination {
  margin: 3px 0 7px;
  font-size: 11.5px;
  line-height: 1.28;
}

.app-shell[data-mode="buses"] #busJourney {
  margin: 7px 0 7px;
  padding: 9px 9px 8px;
  border-radius: 13px;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-head {
  margin-bottom: 6px;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-eyebrow {
  font-size: 7.5px;
  letter-spacing: .055em;
}

.app-shell[data-mode="buses"] #busJourney #busJourneyStatus {
  font-size: 11px;
  line-height: 1.15;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-summary {
  gap: 4px;
  margin-bottom: 5px;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-summary-item {
  min-height: 35px;
  padding: 5px 7px;
  border-radius: 9px;
  grid-template-columns: 66px minmax(0,1fr) auto;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-summary-item > span {
  font-size: 7.5px;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-summary-item > strong {
  font-size: 10.5px;
  line-height: 1.15;
}

.app-shell[data-mode="buses"] #busJourney .bus-journey-summary-item > small {
  font-size: 9px;
}

.app-shell[data-mode="buses"] #busJourneyNearby,
.app-shell[data-mode="buses"] #busJourneyToggle,
.app-shell[data-mode="buses"] .rc-bus-v190-legacy-control {
  display: none;
}

.app-shell[data-mode="buses"] #busJourneyTimeline {
  max-height: none;
  margin: 3px 0 0;
  overflow: visible;
}

.app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop {
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop[hidden] {
  display: none;
}

.app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop-copy b {
  font-size: 11px;
  line-height: 1.15;
}

.app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop-copy small {
  margin-top: 1px;
  font-size: 8.5px;
}

.app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop time {
  font-size: 9.5px;
}

.app-shell[data-mode="buses"] #rcBusJourneyMoreV190 {
  width: 100%;
  min-height: 32px;
  margin: 6px 0 0;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 850;
  cursor: pointer;
}

.app-shell[data-mode="buses"] #busJourneyAmenities:empty {
  display: none;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-primary-grid {
  gap: 4px;
  margin-top: 6px;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-meta {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 9px;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-meta span {
  font-size: 7.5px;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-meta strong {
  font-size: 10.5px;
}

.app-shell[data-mode="buses"] #busDetailCard .train-detail-foot {
  margin-top: 6px;
  padding-top: 6px;
  font-size: 8px;
}

.app-shell[data-mode="buses"] #busDetailCard .rc-bus-v190-no-photo {
  display: none;
}

@media (max-width:700px) {
  .app-shell[data-mode="buses"] #busDetailCard {
    width: 100%;
    max-width: none;
    max-height: 74dvh;
    padding:
      9px
      max(10px, env(safe-area-inset-right))
      max(9px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .app-shell[data-mode="buses"] #busDetailTitle {
    font-size: 18px;
  }

  .app-shell[data-mode="buses"] #busJourney {
    padding: 8px;
  }

  .app-shell[data-mode="buses"] #busJourney .bus-journey-summary-item {
    min-height: 33px;
    grid-template-columns: 60px minmax(0,1fr) auto;
  }

  .app-shell[data-mode="buses"] #busJourneyTimeline .bus-journey-stop {
    min-height: 32px;
  }
}
