/* ==========================================================================
   Ride detail — /orders/<id>/
   ========================================================================== */

/* Hero ------------------------------------------------------------------- */
.ride-hero {
  position: relative;
  isolation: isolate;
  min-height: 460px;
  padding: 0 var(--container-padding-x) 120px;
  overflow: hidden;
  background: var(--color-bg);
}

.ride-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: rotate(180deg);
}

.ride-hero__fade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(6, 6, 6, 0.30) 0%, rgba(6, 6, 6, 0.70) 60%, var(--color-bg) 100%),
    linear-gradient(180deg, rgba(6, 6, 6, 0.45) 0%, rgba(6, 6, 6, 0.0) 30%, var(--color-bg) 100%);
  pointer-events: none;
}

/* Header ----------------------------------------------------------------- */
.ride-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 39px;
  gap: 24px;
}

.ride-header__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.ride-header__back:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.ride-header__back-arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
}

.ride-header__logo img {
  height: clamp(56px, 7vw, 88px);
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(12, 12, 12, 0.55));
}

.ride-header__share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ride-header__share:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
}

.ride-header__share > svg {
  width: 18px;
  height: 18px;
  max-width: none;
  flex-shrink: 0;
}

.ride-header__share--copied {
  background: rgba(46, 200, 130, 0.16);
  border-color: rgba(46, 200, 130, 0.5);
  color: rgb(140, 235, 185);
}

@media (max-width: 540px) {
  .ride-header__share-label { display: none; }
  .ride-header__share { padding: 10px; }
}

/* Hero content ----------------------------------------------------------- */
.ride-hero__content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 64px auto 0;
  text-align: center;
}

.ride-hero__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.14);
  border: 1px solid rgba(245, 194, 5, 0.45);
  color: var(--color-accent-from);
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ride-hero__title {
  margin: 22px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: var(--shadow-text);
  color: var(--color-text);
}

.ride-hero__from,
.ride-hero__to {
  white-space: nowrap;
}

.ride-hero__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 4vw, 56px);
  height: auto;
  color: var(--color-accent-from);
}

.ride-hero__arrow svg {
  width: 100%;
  height: auto;
}

.ride-hero__subtitle {
  margin: 22px auto 0;
  max-width: 520px;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

/* Main + card ------------------------------------------------------------ */
.ride-detail {
  padding: 0 var(--container-padding-x) 96px;
}

.ride-detail__card {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: -80px auto 0;
  padding: 48px clamp(20px, 4vw, 56px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.96) 0%, rgba(12, 12, 12, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(245, 194, 5, 0.06);
  backdrop-filter: blur(8px);
}

.ride-detail__section + .ride-detail__section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ride-detail__section-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 1.6vw, 20px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-from);
}

/* Driver block ----------------------------------------------------------- */
.ride-detail__driver {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ride-detail__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-secondary);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}

.ride-detail__avatar--mine {
  background: var(--grad-accent);
  color: var(--color-text);
  box-shadow: 0 0 14px rgba(245, 194, 5, 0.45);
}

.ride-detail__driver-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ride-detail__driver-name {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
}

.ride-detail__own-badge {
  align-self: start;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.16);
  border: 1px solid rgba(245, 194, 5, 0.5);
  color: var(--color-accent-from);
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Phone link — driver phone visible to passenger after booking, passenger
 * phone visible to driver in booking rows. Symmetric disclosure; the gate
 * lives in the view layer. */
.ride-detail__phone {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.10);
  border: 1px solid rgba(245, 194, 5, 0.4);
  color: var(--color-accent-from);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ride-detail__phone:hover {
  background: rgba(245, 194, 5, 0.18);
  border-color: rgba(245, 194, 5, 0.7);
  color: var(--color-text);
}

/* `.app.css` resets svg width/height; restore explicit sizing so the icon
 * keeps its 14px footprint inside the pill (matches the global pattern
 * used by `.ride-header__share > svg`). */
.ride-detail__phone > svg {
  width: 14px;
  height: 14px;
  max-width: none;
  flex-shrink: 0;
}

.ride-detail__phone--compact {
  padding: 3px 10px 3px 8px;
  font-size: 13px;
  background: rgba(245, 194, 5, 0.08);
  border-color: rgba(245, 194, 5, 0.3);
}

.ride-detail__phone--compact > svg {
  width: 12px;
  height: 12px;
}

/* Schedule --------------------------------------------------------------- */
.ride-detail__schedule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  /* stretch (не center) — обе ноги тянутся по высоте более длинной,
   * чтобы big-city контекст («Казахстан», 1 строка) не выглядел
   * съёжившейся карточкой рядом с small-НП («район, / область»,
   * 2 строки). Стрелка центрируется отдельно ниже. */
  align-items: stretch;
  gap: 20px;
}

.ride-detail__leg {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.ride-detail__leg--arrival {
  align-items: flex-end;
  text-align: right;
}

.ride-detail__leg-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.ride-detail__leg-row {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-width: 0;
}

.ride-detail__leg--arrival .ride-detail__leg-row {
  justify-content: flex-end;
}

.ride-detail__leg-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  color: var(--color-text);
  flex-shrink: 0;
}

.ride-detail__leg-where {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ride-detail__leg--arrival .ride-detail__leg-where {
  align-items: flex-end;
  text-align: right;
}

.ride-detail__leg-place {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Район / область (или страна для крупных городов) под названием НП —
 * чтобы Костряковка читалась как «Фёдоровский район, Костанайская область»,
 * а не как абстрактное имя. Шрифт тоньше плейса, но крупнее даты —
 * это смысловой контекст места, а не служебная метка. */
.ride-detail__leg-context {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.3;
  /* «район, область» wraps after the comma at the boundary the view
     supplies (
), not mid-phrase. */
  white-space: pre-line;
  word-break: keep-all;
}

.ride-detail__leg-date {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__schedule-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 16px;
  color: var(--color-accent-from);
  /* Ряд тянется по высоте более длинной ноги (align-items: stretch),
   * поэтому стрелке нужен явный self-center — иначе она приклеится
   * к верху колонки и оторвётся от середины маршрута. */
  align-self: center;
}

.ride-detail__schedule-arrow svg { width: 100%; height: 100%; }

/* Price + occupancy ------------------------------------------------------ */
.ride-detail__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.ride-detail__price {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.ride-detail__price-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  color: var(--color-text);
}

.ride-detail__price-note {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__occupancy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 14px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.ride-detail__occupancy--full {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.35);
}

.ride-detail__occupancy-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1;
  color: var(--color-text);
}

.ride-detail__occupancy-sep {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  margin: 0 4px;
}

.ride-detail__occupancy-note {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__occupancy--full .ride-detail__occupancy-note {
  color: #ff8a8a;
}

/* Parcels badge --------------------------------------------------------- */
.ride-detail__parcels {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(245, 194, 5, 0.06);
  border: 1px solid rgba(245, 194, 5, 0.28);
}

.ride-detail__parcels-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 194, 5, 0.16);
  color: var(--color-accent-from);
  flex-shrink: 0;
}

.ride-detail__parcels-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ride-detail__parcels-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.ride-detail__parcels-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}

/* Actions ---------------------------------------------------------------- */
.ride-detail__actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.ride-detail__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 32px;
  border: 0;
  border-radius: var(--radius-button);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ride-detail__btn--primary {
  background: var(--grad-accent);
  color: var(--color-text);
  box-shadow: var(--shadow-button), 0 8px 24px rgba(245, 194, 5, 0.18);
}

.ride-detail__btn--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-button), 0 12px 32px rgba(245, 194, 5, 0.32);
}

.ride-detail__btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}

.ride-detail__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--color-text);
}

.ride-detail__btn--chat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-text);
}

.ride-detail__btn--chat:hover {
  background: rgba(245, 194, 5, 0.08);
  border-color: rgba(245, 194, 5, 0.5);
  color: var(--color-accent-from);
}

.ride-detail__btn--parcel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 194, 5, 0.12);
  border: 1px solid rgba(245, 194, 5, 0.5);
  color: var(--color-accent-from);
}

.ride-detail__btn--parcel:hover {
  background: rgba(245, 194, 5, 0.2);
  border-color: rgba(245, 194, 5, 0.75);
  color: var(--color-text);
}

.ride-detail__btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--grad-accent);
  color: var(--color-text);
  font-family: var(--font-meta);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 2px rgba(6, 6, 6, 0.6);
}

.ride-detail__btn--danger {
  background: transparent;
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff8a8a;
}

.ride-detail__btn--danger:hover {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.7);
  color: #ffb1b1;
}

.ride-detail__btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ride-detail__notice {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

/* Flash messages (e.g. overlap-rejected booking attempt) */
.ride-detail__messages {
  grid-column: 1 / -1;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.ride-detail__message {
  padding: 14px 18px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
}

.ride-detail__message--error {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ff8a8a;
}

.ride-detail__message--warning {
  background: rgba(255, 168, 70, 0.08);
  border: 1px solid rgba(255, 168, 70, 0.4);
  color: #ffb967;
}

.ride-detail__message--info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
}

.ride-detail__message--success {
  background: rgba(78, 200, 130, 0.1);
  border: 1px solid rgba(78, 200, 130, 0.4);
  color: #6ad99c;
}

.ride-detail__delete-form,
.ride-detail__cancel-form,
.ride-detail__book-form {
  margin: 0;
  display: contents;
}

/* Booking form (passenger view) ----------------------------------------- */
.ride-detail__book-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.ride-detail__book-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Seats counter, shaped as a horizontal pill so it visually matches the
   "Итого" pill next to it — one family of compact, inline controls. The
   wrapper carries the border, the input sits inside as a small numeric
   cell. */
.ride-detail__book-seats {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: text;
  transition: border-color .15s ease, background .15s ease;
}

.ride-detail__book-seats:focus-within {
  border-color: var(--color-accent-from);
  background: rgba(245, 194, 5, 0.04);
}

.ride-detail__book-seats-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Neutral base — address inputs override via --text; the seats input
   gets its specific look from a parent-scoped rule below. */
.ride-detail__book-input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  outline: 0;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.ride-detail__book-input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.ride-detail__book-input:focus {
  border-color: var(--color-accent-from);
  background: rgba(245, 194, 5, 0.05);
  box-shadow: 0 0 0 3px rgba(245, 194, 5, 0.18);
}

/* Seats input lives inside the pill wrapper as a compact numeric cell. */
.ride-detail__book-seats .ride-detail__book-input {
  width: 80px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
}

/* Strip the native up/down spinner on the seats number input — the
   centered numeric value reads cleaner without the cramped arrows. */
.ride-detail__book-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.ride-detail__book-input[type="number"]::-webkit-outer-spin-button,
.ride-detail__book-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Live "seats × price = total" readout under the seats input. */
.ride-detail__book-total {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  align-self: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.ride-detail__book-total-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__book-total-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  /* Defensive cap: even if JS hasn't clamped seats (no-JS / stale cache),
     the computed total can't escape the pill and slide under the
     "Забронировать" button. */
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Booking form — optional address fields (text variant) ----------------- */
.ride-detail__book-extras {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 4px;
}

.ride-detail__book-field--text {
  flex: 1 1 240px;
  min-width: 0;
}

.ride-detail__book-input--text {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: var(--font-meta);
  font-weight: 500;
  font-size: 14px;
  text-align: left;
}

/* Hint section on ride detail (driver-set pickup/dropoff conditions) ---- */
.ride-detail__hints {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ride-detail__hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ride-detail__hint-label {
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  align-self: center;
}

.ride-detail__hint-value {
  flex: 1 1 240px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.45;
}

/* Per-booking & per-parcel address lines (driver view, passenger view) -- */
.ride-detail__booking-addresses,
.ride-detail__booked-addresses {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.4;
}

.ride-detail__booking-address-label,
.ride-detail__booked-address-label {
  display: inline-block;
  margin-right: 6px;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* Booked state (passenger view) ---------------------------------------- */
.ride-detail__booked {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 22px;
  border-radius: 12px;
  background: rgba(245, 194, 5, 0.10);
  border: 1px solid rgba(245, 194, 5, 0.4);
  /* Status card takes its own full-width row at the top of the action
     stack, so the chat/cancel buttons sit on a row below — keeps the
     card and the buttons visually balanced on wide screens, matching
     the mobile layout. */
  flex: 1 0 100%;
}

.ride-detail__booked--parcel {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
}

.ride-detail__booked--parcel .ride-detail__booked-label {
  color: rgba(255, 255, 255, 0.65);
}

.ride-detail__booked-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-from);
}

.ride-detail__booked-value {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
}

.ride-detail__booked-value strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.ride-detail__booked-meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Bookings list (driver view) ------------------------------------------ */
.ride-detail__bookings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ride-detail__booking {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ride-detail__booking-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad-secondary);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.ride-detail__booking-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ride-detail__booking-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ride-detail__booking-date {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.ride-detail__booking-seats {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.ride-detail__booking-seats strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  margin-left: 4px;
}

.ride-detail__booking-chat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.08);
  border: 1px solid rgba(245, 194, 5, 0.35);
  color: var(--color-accent-from);
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}

.ride-detail__booking-chat:hover {
  background: rgba(245, 194, 5, 0.14);
  border-color: rgba(245, 194, 5, 0.6);
}

.ride-detail__booking-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--grad-accent);
  color: var(--color-text);
  font-family: var(--font-meta);
  font-weight: 700;
  font-size: 11px;
  box-shadow: 0 0 0 2px rgba(6, 6, 6, 0.7);
}

.ride-detail__booking-cancel-form {
  margin: 0;
  flex-shrink: 0;
}

.ride-detail__booking-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ride-detail__booking-cancel:hover {
  background: rgba(220, 60, 60, 0.18);
  border-color: rgba(220, 60, 60, 0.55);
  color: rgb(255, 130, 130);
}

.ride-detail__booking-cancel > svg {
  width: 14px;
  height: 14px;
  max-width: none;
  flex-shrink: 0;
}

.ride-detail__bookings-empty {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

/* Parcel list (driver view) -------------------------------------------- */
.ride-detail__parcel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ride-detail__parcel-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(245, 194, 5, 0.2);
}

.ride-detail__parcel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(245, 194, 5, 0.12);
  color: var(--color-accent-from);
  flex-shrink: 0;
  margin-top: 2px;
}

.ride-detail__parcel-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ride-detail__parcel-desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.ride-detail__parcel-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ride-detail__parcel-meta-row {
  display: flex;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
}

.ride-detail__parcel-meta-row dt {
  flex-shrink: 0;
  width: 96px;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 2px 0 0;
}

.ride-detail__parcel-meta-row dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.ride-detail__parcel-phone {
  color: var(--color-accent-from);
  text-decoration: none;
}

.ride-detail__parcel-phone:hover {
  text-decoration: underline;
}

/* Phase 10 trust facts (counterparty view) ------------------------------- */
.ride-detail__driver-disclosure {
  margin: 0;
}

/* Whole driver row is the toggle when facts exist. Inherits the original
   .ride-detail__driver flex layout; we just kill the native marker and add
   cursor/select hints. */
.ride-detail__driver--toggle {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.ride-detail__driver--toggle::-webkit-details-marker {
  display: none;
}

.ride-detail__driver--toggle::marker {
  content: "";
}

.ride-detail__driver-name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ride-detail__driver-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.65);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

.ride-detail__driver--toggle:hover .ride-detail__driver-chevron,
.ride-detail__driver--toggle:focus-visible .ride-detail__driver-chevron {
  background: rgba(245, 194, 5, 0.10);
  border-color: rgba(245, 194, 5, 0.40);
  color: var(--color-accent-from);
}

.ride-detail__driver--toggle:focus-visible {
  outline: none;
}

.ride-detail__driver-disclosure[open] .ride-detail__driver-chevron {
  background: rgba(245, 194, 5, 0.10);
  border-color: rgba(245, 194, 5, 0.40);
  color: var(--color-accent-from);
  transform: rotate(180deg);
}

.ride-detail__facts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ride-detail__fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.ride-detail__fact-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text);
}

.ride-detail__fact-label {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__booking-facts {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.ride-detail__booking-facts > li > span {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 540px) {
  .ride-detail__facts {
    grid-template-columns: 1fr;
  }
  .ride-detail__fact {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
}

/* Driver "about" --------------------------------------------------------- */
.ride-detail__driver-about {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

/* Car block -------------------------------------------------------------- */
.ride-detail__car {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.ride-detail__car-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ride-detail__car-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.1;
  color: var(--color-text);
}

.ride-detail__car-color {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.ride-detail__car-plate-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ride-detail__car-plate-label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.ride-detail__car-plate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--color-text);
  text-transform: uppercase;
}

.ride-detail__car-plate--hidden {
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.35);
}

.ride-detail__car-plate-note {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: right;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 720px) {
  /* Price-row: on mobile both blocks should stretch to full width,
     matching how schedule legs and other info cards behave. By default
     the row is flex+wrap and the occupancy box hugs its content, which
     looks unnaturally short next to the rest of the page. */
  .ride-detail__price-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .ride-detail__occupancy {
    align-items: flex-start;
  }

  /* Seats field reverts to the original stacked layout on mobile — the
     desktop pill is too cramped once the actions row drops to column
     orientation and stretches each item to full width. */
  .ride-detail__book-seats {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
  }
  .ride-detail__book-seats:focus-within {
    background: transparent;
    border: 0;
  }
  .ride-detail__book-seats .ride-detail__book-input {
    width: 100%;
    height: 60px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
    font-size: 22px;
  }

  .ride-hero {
    min-height: 0;
    padding-bottom: 96px;
  }

  .ride-header__back {
    padding: 10px 12px;
    gap: 0;
  }
  .ride-header__back span:not(.ride-header__back-arrow) {
    display: none;
  }

  .ride-hero__content { margin-top: 48px; }

  .ride-hero__title {
    flex-wrap: nowrap;
    gap: 8px;
    font-size: clamp(18px, 6vw, 34px);
  }

  .ride-detail__card {
    margin-top: -64px;
    padding: 28px 20px;
    border-radius: 18px;
  }

  .ride-detail__schedule {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ride-detail__leg--arrival,
  .ride-detail__leg--arrival .ride-detail__leg-where {
    text-align: left;
    align-items: flex-start;
  }

  .ride-detail__leg--arrival .ride-detail__leg-row {
    flex-direction: row-reverse;
    justify-content: flex-end;
  }

  .ride-detail__schedule-arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .ride-detail__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ride-detail__btn,
  .ride-detail__book-input {
    width: 100%;
  }

  .ride-detail__book-field {
    width: 100%;
  }

  /* On narrow screens the flex row collapses: name truncates to 3 chars,
     date overlaps with seats. Switch to a 2-column grid: avatar + info +
     chat on the top row, seats + cancel on a second row indented under info. */
  .ride-detail__booking {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "avatar info  chat"
      ".      stats cancel";
    column-gap: 14px;
    row-gap: 8px;
    align-items: center;
  }
  .ride-detail__booking-avatar { grid-area: avatar; }
  .ride-detail__booking-info { grid-area: info; }
  .ride-detail__booking .ride-detail__booking-chat {
    grid-area: chat;
    margin-left: 0;
    padding: 8px 12px;
  }
  .ride-detail__booking-seats {
    grid-area: stats;
    align-self: start;
  }
  .ride-detail__booking .ride-detail__booking-cancel-form {
    grid-area: cancel;
    justify-self: end;
  }
  .ride-detail__booking .ride-detail__booking-cancel {
    margin-left: 0;
  }

  .ride-detail__car {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ride-detail__car-plate-wrap {
    align-items: flex-start;
  }

  .ride-detail__car-plate-note {
    text-align: left;
  }
}

/* === equal-cta-width: booking submit and the "Передать посылку" link each
   take a full-width row in the actions area so they line up. Without this the
   parcel <a> is content-width and renders narrower than the booking button. === */
.ride-detail__actions .ride-detail__book-form .ride-detail__btn--primary,
.ride-detail__actions .ride-detail__btn--parcel {
  flex: 1 0 100%;
  box-sizing: border-box;
}
/* === /equal-cta-width === */

/* === cta-large-mobile: на больших телефонах и маленьких планшетах
   (720–900px) базовый мобильный брейкпоинт не срабатывал, и блок действий
   оставался в десктопной строке — кнопки «Забронировать»/«Передать посылку»
   сжимались до ширины содержимого и выглядели мелкими. Здесь действия
   принудительно стекаются в колонку и растягиваются на всю ширину карточки,
   с комфортной высотой касания. === */
@media (max-width: 900px) {
  .ride-detail__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ride-detail__actions .ride-detail__btn,
  .ride-detail__actions .ride-detail__book-extras,
  .ride-detail__actions .ride-detail__book-input,
  .ride-detail__actions .ride-detail__cancel-form,
  .ride-detail__actions .ride-detail__delete-form {
    width: 100%;
  }
  .ride-detail__actions .ride-detail__btn {
    min-height: 60px;
    height: auto;
    padding: 16px 24px;
    font-size: 16px;
  }
  .ride-detail__book-total {
    align-self: center;
  }
}
/* === /cta-large-mobile === */