.segment-details.rich-details-ui {
  display: block;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce5f3;
  border-radius: 12px;
}
.segment-details.rich-details-ui[hidden] { display: none !important; }

/* One-way results: keep the detail control beside the Select button. */
.flight { position: relative; }
.flight .inline-detail-toggle { position: absolute; right: 102px; top: 35px; z-index: 2; }

.rich-details-ui .detail-route { margin: 0; padding: 14px 18px; background: #f5f8fc; border-bottom: 1px solid #e2e9f4; }
.fare-detail-table { border-bottom: 1px solid #e2e9f4; }
.fare-detail-table > div { display: grid; grid-template-columns: .8fr 1.3fr 1.3fr 1fr 1.2fr; gap: 14px; padding: 11px 18px; }
.fare-detail-table .fare-head { color: #6b7c99; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #fbfcff; }
.fare-detail-table .fare-value { color: #142d5a; font-size: 13px; align-items: center; }
.fare-detail-table .fare-value strong:last-child { color: #065f46; }
.fare-detail-actions { display: flex; align-items: center; gap: 20px; padding: 12px 18px; }
.passenger-price-details,.fare-rules-details { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: #1463df; font: inherit; font-size: 13px; cursor: pointer; }
.passenger-price-details:hover,.fare-rules-details:hover { text-decoration: underline; }
#passenger-price-modal { width: min(1180px, calc(100vw - 36px)); max-width: none; border: 0; border-radius: 10px; padding: 0; color: #172747; box-shadow: 0 22px 60px rgba(11, 29, 61, .28); }
#passenger-price-modal::backdrop { background: rgba(10, 24, 50, .55); }
.passenger-price-modal-content { position: relative; padding: 26px 28px 30px; }
.passenger-price-modal-content .close { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; border: 2px solid #18294a; border-radius: 9px; background: #fff; color: #18294a; font-size: 30px; line-height: 1; cursor: pointer; }
.passenger-price-modal-content h2 { margin: 0 0 36px; font-size: 25px; }
.price-detail-total { margin: 0 0 8px; color: #263651; font-size: 15px; }
.price-detail-total strong { font-size: 17px; }
.price-detail-total span { color: #62718a; }
.price-detail-table-wrap { overflow-x: auto; border: 1px solid #dce5f3; border-radius: 7px; }
.price-detail-table-wrap table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.price-detail-table-wrap th, .price-detail-table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #dce5f3; }
.price-detail-table-wrap th { color: #2d3b52; background: #f8fafc; font-weight: 700; }
.price-detail-table-wrap td:nth-child(n+4), .price-detail-table-wrap th:nth-child(n+4) { text-align: right; }
.price-detail-table-wrap tfoot th, .price-detail-table-wrap tfoot td { border-bottom: 0; background: #f7f9fd; }
.price-pending { color: #7a879b; }
.price-detail-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 7px; background: #fff7df; color: #7d5a10; font-size: 13px; line-height: 1.45; }
.rich-leg { display: grid; grid-template-columns: minmax(0, 1fr) 270px; border-bottom: 1px solid #e2e9f4; }
.rich-leg:last-child { border-bottom: 0; }
.rich-leg-main { padding: 18px; min-width: 0; }
.rich-carrier { display: flex; gap: 9px; align-items: center; margin-bottom: 16px; color: #102b57; }
.rich-carrier b, .rich-carrier small { display: block; }
.rich-carrier small { margin-top: 3px; color: #6880a7; font-size: 12px; }
.rich-plane { width: 31px; height: 31px; border: 1px solid #dce7f8; border-radius: 50%; display: grid; place-items: center; color: #1764e8; overflow: hidden; }
.rich-plane img { display: block; width: 22px; height: 22px; max-width: 22px; max-height: 22px; object-fit: contain; }
.rich-leg-points { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(145px, .8fr) minmax(130px, 1fr); align-items: center; gap: 14px; }
.rich-point small, .rich-info-label { display: block; color: #7387a9; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.rich-point strong { display: block; color: #132e5c; font-size: 18px; margin: 3px 0; }
.rich-point em { color: #1463df; font-size: 13px; font-style: normal; }
.rich-point span { display: block; color: #6b7c99; font-size: 12px; line-height: 1.35; }
.rich-duration { text-align: center; color: #1764e8; }
.rich-duration i { display: block; height: 1px; margin: 8px 0 5px; position: relative; background: #91afe8; }
.rich-duration i::after { content: '›'; position: absolute; right: -2px; top: -12px; font-size: 21px; font-style: normal; }
.rich-duration small { color: #7387a9; font-size: 11px; }
.rich-info-row { display: flex; flex-wrap: wrap; gap: 18px 30px; margin: 17px 0 0 40px; color: #4d6387; font-size: 12px; }
.rich-info-row strong { color: #203c69; margin-left: 5px; }
.rich-baggage { margin: 15px 0 0 40px; padding: 11px 13px; border-radius: 8px; background: #f7f9fd; color: #4c6389; font-size: 12px; }
.rich-baggage b { color: #1b3763; }
.rich-baggage span + span::before { content: ' · '; color: #98a8c0; }
.fare-rule-groups { display: grid; gap: 11px; }
.fare-rule-group { border-top: 1px solid #e1e8f3; padding-top: 10px; }
.fare-rule-group h4 { margin: 0 0 6px; }
.fare-rule-group div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 11px; color: #51698e; }
.fare-rule-group div span { max-width: 58%; }
.fare-rule-group div b { color: #183c78; text-align: right; font-size: 11px; }
.fare-rules-modal-content { padding: 27px 30px; min-width: min(650px,calc(100vw - 32px)); position: relative; }
.fare-rules-modal-content h2 { margin: 0 0 5px; font-size: 23px; }
.fare-rules-modal-content > p { margin: 0 0 19px; color: #61718d; }
.fare-rules-modal-content > small { display: block; margin-top: 18px; color: #71819c; line-height: 1.45; }
.fare-rules-modal-content .fare-rule-groups { border: 1px solid #e0e8f4; border-radius: 9px; padding: 2px 16px 13px; }
.fare-rules-modal-content .fare-rule-group div { font-size: 12px; padding: 7px 0; }
.fare-rules-modal-content .fare-rule-group div b { font-size: 12px; }
.rich-services { padding: 18px; border-left: 1px solid #e2e9f4; background: #fbfcff; color: #4d6387; font-size: 12px; }
.rich-services h4 { margin: 0 0 7px; color: #18355f; font-size: 12px; }
.rich-services p { margin: 0 0 17px; line-height: 1.45; }
.rich-services p:last-child { margin-bottom: 0; }
.rich-connection { display: flex; align-items: center; gap: 10px; padding: 0 18px 14px; color: #1764e8; font-size: 12px; font-weight: 700; }
.rich-connection::before, .rich-connection::after { content: ''; height: 1px; flex: 1; background: #a9c2ee; }

@media (max-width: 850px) {
  .rich-leg { grid-template-columns: 1fr; }
  .rich-services { border-left: 0; border-top: 1px solid #e2e9f4; }
  .rich-leg-points { grid-template-columns: 1fr; }
  .rich-duration { display: none; }
  .rich-info-row, .rich-baggage { margin-left: 0; }
  .fare-detail-table > div { grid-template-columns: 1fr 1fr; }
  .flight .inline-detail-toggle { right: 94px; }
}
