:root {
  --bg: #f4f1e7;
  --panel: #ffffff;
  --ink: #23221f;
  --muted: #81807a;
  --line: rgba(35, 34, 31, 0.1);
  --accent: #ffd42a;
  --accent-deep: #efbd00;
  --green: #2f6b4f;
  --red: #b54747;
  --shadow: 0 30px 90px rgba(43, 38, 23, 0.14);
  --fade: 0.16s ease;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}

.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0d0d0c;
  opacity: 1;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-splash video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease;
}

.intro-splash + .app-shell {
  opacity: 0;
  transform: scale(0.992);
  transition: opacity 0.9s ease, transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-splash.is-leaving {
  pointer-events: none;
  opacity: 0;
}

.intro-splash.is-leaving video {
  opacity: 0.72;
  transform: scale(1.035);
}

.intro-splash.is-leaving + .app-shell {
  opacity: 1;
  transform: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  height: 100dvh;
  padding: 24px;
  overflow: hidden;
  background: #fff;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 12px 14px;
  border: 0;
  border-radius: 0 0 10px 10px;
  background: #111110;
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden;
  contain: paint;
  isolation: isolate;
  clip-path: inset(0);
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: linear-gradient(180deg, #343431 0%, #1d1d1b 58%, #111110 100%);
  pointer-events: none;
}

.app-back {
  position: fixed;
  top: 98px;
  left: 24px;
  z-index: 80;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: #f2f2f0;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.app-back[hidden] {
  display: none !important;
}

.app-back img {
  width: 25px;
  height: 25px;
}

.brand {
  min-width: 0;
}

.road-kings-logo {
  display: block;
  width: min(100%, 660px);
  color: #f3c24b;
  font-size: clamp(32px, 7vw, 68px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  transform: skewX(-10deg);
  transform-origin: center;
  outline: 0;
  -webkit-text-stroke: 1px rgba(38, 27, 9, 0.55);
  text-shadow:
    0 2px 0 #7b4b11,
    0 4px 0 #5a350b,
    0 7px 8px rgba(0, 0, 0, 0.34);
}

.call-link,
.admin-link {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-weight: 900;
}

.admin-link {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 18;
}

.taxi-workspace {
  display: grid;
  height: calc(100dvh - 48px);
  place-items: center;
  padding-top: clamp(150px, 22dvh, 230px);
  overflow: hidden;
}

.booking-card {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100dvh - 180px);
  min-height: min(620px, calc(100dvh - 180px));
  padding: 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.booking-card::-webkit-scrollbar {
  display: none;
}

.screen-back {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 3;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: #f2f2f0;
}

.screen-back img {
  width: 25px;
  height: 25px;
}

.view {
  display: none;
  opacity: 0;
}

.view.active {
  display: block;
  opacity: 1;
}

.view[data-view="tariff"].active {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.mobile-destination {
  display: grid;
  width: 100%;
  min-height: 84px;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: #efefee;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  text-align: center;
}

.mobile-suggestions {
  display: grid;
  margin-top: 20px;
}

.mobile-suggestions button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid rgba(35, 34, 31, 0.08);
  background: transparent;
  text-align: left;
}

.mobile-suggestions i {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #ededeb;
}

.mobile-suggestions i::after {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #b9b8b4;
  content: "";
}

.mobile-suggestions strong,
.mobile-suggestions small {
  display: block;
}

.mobile-suggestions strong {
  font-size: 20px;
  line-height: 1.12;
}

.mobile-suggestions small,
.mobile-suggestions em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.tariff-suggestions {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 10px;
}

.tariff-suggestions button {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 54px;
  padding: 6px 0;
  border: 0;
  border-top: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 0;
  background: transparent;
}

.tariff-suggestions button:first-child {
  border-top: 0;
}

.tariff-suggestions i {
  display: grid;
}

.tariff-suggestions strong {
  font-size: 17px;
}

.tariff-suggestions small,
.tariff-suggestions em {
  font-size: 13px;
  line-height: 1.15;
}

.tariff-suggestions i {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.tariff-suggestions i::after {
  width: 15px;
  height: 15px;
}

.route-form,
.details-form {
  display: grid;
  gap: 16px;
}

.route-fields,
.route-compact {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 22px;
  background: #fff;
}

.route-compact {
  gap: 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.route-compact .route-field {
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 18px;
  background: #fff;
}

.route-field {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 12px 18px;
}

.route-field + .route-field {
  border-top: 1px solid rgba(35, 34, 31, 0.08);
}

.route-compact .route-field + .route-field {
  border-top: 1px solid rgba(35, 34, 31, 0.08);
}

.route-field > span {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-field input,
.route-field strong {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  outline: none;
}

.route-dot {
  grid-row: 1 / span 2;
  display: block;
  width: 18px;
  height: 18px;
  align-self: center;
  justify-self: center;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(35, 34, 31, 0.08);
}

.to-field .route-dot {
  background: var(--accent);
}

.error {
  grid-column: 2;
  min-height: 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.suggestions {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  max-height: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0 solid rgba(35, 34, 31, 0.08);
  border-radius: 0 0 17px 17px;
  background: #f7f7f5;
  opacity: 0;
  pointer-events: none;
  scrollbar-width: thin;
  visibility: hidden;
  transform-origin: top center;
  transition:
    max-height 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease,
    visibility 0s linear 0.26s,
    border-width 0s linear 0.26s;
}

.suggestions.open {
  max-height: min(330px, var(--suggestions-max-height, 42dvh));
  border-width: 0 1px 1px;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    visibility 0s,
    border-width 0s;
}

.route-point.suggestions-attached {
  border-radius: 17px 17px 0 0;
}

.suggestions.floating {
  position: fixed;
  top: var(--suggestions-top);
  right: auto;
  left: var(--suggestions-left);
  width: var(--suggestions-width);
}

.route-point-shell,
.route-stop-entry {
  position: relative;
  min-width: 0;
}

.route-point-shell.suggestions-open,
.route-stop-entry.suggestions-open {
  z-index: 20;
}

.suggestions button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 60px;
  align-content: center;
  padding: 10px 14px 10px 46px;
  border: 0;
  border-bottom: 1px solid rgba(35, 34, 31, 0.08);
  background: transparent;
  text-align: left;
}

.suggestions button::before {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(35, 34, 31, 0.12);
  content: "";
  transform: translateY(-50%);
}

.suggestions button:first-child {
  box-shadow: inset 0 1px 0 rgba(35, 34, 31, 0.08);
}

.suggestions button:last-of-type {
  border-bottom: 0;
}

.suggestions button:hover,
.suggestions button.active,
.suggestions button[aria-selected="true"] {
  background: #f0f0ed;
}

.suggestions strong,
.suggestions small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions strong {
  font-size: 15px;
  line-height: 1.25;
}

.suggestions small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.suggestions-state {
  min-height: 50px;
  margin: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: 0 24px;
  border: 0;
  border-radius: 22px;
  font-size: 18px;
  font-weight: 900;
}

.button.primary {
  background: linear-gradient(180deg, #ffda35 0%, #ffd21f 100%);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(148, 105, 0, 0.12);
}

.button.secondary {
  border: 1px solid rgba(35, 34, 31, 0.1);
  background: #f2f2f0;
  color: var(--ink);
}

.button.wide {
  width: 100%;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.status.error {
  color: var(--red);
}

.status.ready {
  color: var(--green);
}

.tariff-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 86%);
  gap: 12px;
  margin: 18px -26px 14px;
  padding: 0 26px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.tariff-strip::-webkit-scrollbar {
  display: none;
}

.tariff-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(132px, 46%) minmax(0, 1fr);
  grid-template-areas:
    "car name"
    "car seats"
    "car price";
  column-gap: 16px;
  align-content: center;
  align-items: center;
  min-height: 178px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 24px;
  background: #f2f2f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  scroll-snap-align: center;
  transition:
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.tariff-card.active {
  background: #eeeeec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.tariff-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tariff-card img {
  grid-area: car;
  justify-self: stretch;
  width: 100%;
  height: 112px;
  object-fit: contain;
  transform: translateZ(0) scale(1);
  transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

.tariff-card.active img {
  transform: translateZ(0) scale(1.08);
}

.tariff-card span {
  grid-area: name;
  align-self: end;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.04;
}

.tariff-card small {
  grid-area: seats;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.tariff-card strong {
  grid-area: price;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.05;
}

.payment-panel {
  padding: 14px;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 18px;
  background: #fff;
}

.payment-panel strong {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.route-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0;
}

.route-metrics span,
.driver-card {
  padding: 14px;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 18px;
  background: #fff;
}

.route-metrics small,
.route-metrics strong,
.driver-card span,
.driver-card strong,
.driver-card small {
  display: block;
}

.route-metrics small,
.driver-card span,
.driver-card small {
  color: var(--muted);
}

.route-metrics strong,
.driver-card strong {
  margin-top: 5px;
  font-size: 19px;
}

.tariff-bottom {
  margin-top: auto;
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.details-form > .checkout {
  margin-bottom: -6px;
}

.checkout .submit {
  min-height: 70px;
}

.icon-back {
  min-width: 84px;
}

.checkout-menu {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: #f2f2f0;
}

.checkout-menu img,
.settings-back img,
.settings-info img,
.settings-icon {
  width: 24px;
  height: 24px;
}

.ghost-menu {
  opacity: 0.48;
}

.settings-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.settings-head strong,
.settings-head small {
  display: block;
}

.settings-head small {
  color: var(--muted);
}

.settings-back,
.settings-info {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: #f2f2f0;
}

.settings-tariff {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
}

.settings-car {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.settings-tariff span,
.settings-tariff strong,
.settings-tariff small {
  display: block;
}

.settings-tariff span {
  color: var(--muted);
  font-weight: 900;
}

.settings-tariff strong {
  margin-top: 5px;
  font-size: 30px;
}

.settings-tariff small {
  margin-top: 4px;
  color: var(--muted);
}

.settings-options {
  display: grid;
  gap: 10px;
}

.trip-preferences {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.trip-preferences label {
  display: grid;
  grid-template-rows: 30px auto 38px;
  gap: 4px;
  min-width: 0;
}

.trip-preferences label > span:not(.preference-image):not(.preference-stepper) {
  display: block;
  min-height: 26px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.trip-preferences .preference-image {
  display: block;
  width: 30px;
  height: 30px;
  min-height: 0;
  margin: 0;
  border: 1px dashed rgba(35, 34, 31, 0.18);
  border-radius: 9px;
  background: #f2f2f0;
}

.trip-preferences select {
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 13px;
  background: #f7f7f5;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.settings-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 18px;
  background: #f7f7f5;
}

.settings-row strong,
.settings-row span {
  display: block;
}

.settings-row span {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.settings-row input,
.settings-row textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 14px;
  background: #fff;
  outline: none;
}

.settings-row input {
  height: 48px;
  padding: 0 12px;
}

.settings-row textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
}

.settings-payment .payment-choice {
  margin-top: 8px;
}

.settings-payment .payment-choice span {
  margin-top: 0;
}

.payment-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.payment-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-choice label {
  position: relative;
}

.payment-choice span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.payment-choice input:checked + span {
  background: var(--accent);
}

.waiting-state {
  display: grid;
  min-height: 560px;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.car-color {
  display: block;
  width: 42px;
  height: 42px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #1f1f1f;
  box-shadow: 0 12px 30px rgba(35, 34, 31, 0.16);
}

.car-color[data-color="white"] {
  background: #f8f8f4;
}

.car-color[data-color="gray"] {
  background: #8b8f91;
}

.car-color[data-color="black"] {
  background: #1f1f1f;
}

.waiting-car {
  width: min(360px, 78vw);
  height: 168px;
  object-fit: contain;
}

.waiting-state h2 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
}

.waiting-state p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.waiting-state .waiting-eta {
  max-width: 360px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.order-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.search-dots {
  display: none;
  height: 8px;
  align-items: center;
  gap: 4px;
}

.details-form.is-searching .search-dots {
  display: inline-flex;
}

.status-with-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-search-dots {
  display: inline-flex;
  color: var(--muted);
}

.driver-card .status-with-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.driver-card .status-search-dots {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 4px;
}

.search-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: search-dot-pulse 0.9s ease-in-out infinite;
}

.search-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.search-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes search-dot-pulse {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.driver-card {
  width: min(100%, 420px);
  text-align: left;
}

.assigned-state {
  display: grid;
  min-height: 560px;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.assigned-car {
  width: min(380px, 82vw);
  height: 172px;
  object-fit: contain;
}

.assigned-heading span,
.assigned-car-card span,
.assigned-route-card > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.assigned-heading h2 {
  max-width: 430px;
  margin: 4px 0 0;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.12;
}

.assigned-car-card {
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
}

.assigned-car-card strong,
.assigned-car-card span {
  display: block;
}

.assigned-car-card strong {
  margin-top: 4px;
  font-size: 17px;
}

.license-plate {
  min-width: 132px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.assigned-route-card {
  width: min(100%, 430px);
}

@media (min-width: 900px) {
  .booking-card {
    width: min(620px, 100%);
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 0;
  }

  .topbar {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
  }

  .app-back {
    top: 82px;
    left: 18px;
  }

  .call-link,
  .admin-link {
    display: none;
  }

  .taxi-workspace {
    height: 100dvh;
    padding: 230px 0 0;
    place-items: stretch;
  }

  .booking-card {
    width: 100%;
    max-height: calc(100dvh - 230px);
    min-height: calc(100dvh - 230px);
    padding: 22px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .taxi-workspace:has([data-view="tariff"].active) {
    padding-top: 178px;
  }

  .taxi-workspace:has([data-view="tariff"].active) .booking-card {
    max-height: calc(100dvh - 178px);
    min-height: calc(100dvh - 178px);
  }

  .view[data-view="tariff"] .route-field {
    min-height: 62px;
    height: 62px;
    padding: 7px 16px;
  }

  .view[data-view="tariff"] .route-field strong {
    font-size: 17px;
    line-height: 1.12;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-destination {
    min-height: 86px;
    font-size: 23px;
  }

  .tariff-strip {
    grid-auto-columns: minmax(304px, 86vw);
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .tariff-card {
    min-height: 118px;
    grid-template-columns: minmax(128px, 44%) minmax(0, 1fr);
    padding: 10px 12px;
  }

  .tariff-card img {
    height: 68px;
  }

  .tariff-card span {
    font-size: 20px;
  }

  .tariff-card strong {
    font-size: 24px;
  }

  .view[data-view="tariff"] .tariff-strip {
    margin-top: 10px;
    margin-bottom: 0;
  }

  .view[data-view="tariff"] .payment-panel {
    margin-top: -4px;
    padding: 8px 10px;
  }

  .view[data-view="tariff"] .payment-choice span {
    min-height: 34px;
  }

  .view[data-view="tariff"] .checkout {
    margin-top: 16px;
  }

  .view[data-view="tariff"] .checkout .submit {
    min-height: 64px;
  }

  .view[data-view="tariff"] .checkout-menu {
    width: 54px;
    height: 54px;
  }

  .route-metrics {
    grid-template-columns: 1fr;
  }

  .checkout {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .icon-back {
    min-width: 72px;
    padding-inline: 14px;
    font-size: 15px;
  }

  .settings-tariff {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 700px) and (max-height: 740px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 210px 167px 48px 48px 0;
  }
}

/* The rate stays visible on every tariff card; the calculated trip total remains on the right. */
.tariff-card .tariff-rate {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 3;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .tariff-card .tariff-rate {
    bottom: 14px;
    left: 14px;
    font-size: 12px;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #1f7a5a;
  outline-offset: 3px;
}

@media (min-width: 701px) {
  .view[data-view="details"] .trip-preferences {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .view[data-view="details"] .trip-preferences label {
    display: grid;
    min-height: 96px;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: minmax(32px, auto) 38px;
    column-gap: 10px;
    row-gap: 5px;
    align-items: center;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(35, 34, 31, 0.08);
    border-radius: 16px;
    background: #f2f2f0;
  }

  .view[data-view="details"] .trip-preferences .preference-image {
    width: 76px;
    height: 76px;
    grid-column: 1;
    grid-row: 1 / 3;
    border: 0;
    border-radius: 12px;
    background: transparent;
    object-fit: contain;
    mix-blend-mode: multiply;
  }

  .view[data-view="details"] .trip-preferences label > span:not(.preference-image):not(.preference-stepper) {
    min-height: 0;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.2;
  }

  .view[data-view="details"] .preference-stepper {
    display: grid;
    height: 38px;
    min-width: 0;
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    overflow: hidden;
    border-radius: 11px;
    background: #fff;
  }

  .view[data-view="details"] .preference-stepper button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
  }

  .view[data-view="details"] .preference-stepper output {
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Tablet and desktop workspace. Mobile layout remains unchanged. */
@media (min-width: 701px) {
  .taxi-workspace,
  .taxi-workspace:has([data-view="details"].active) {
    align-items: start;
    padding: 116px 28px 28px;
  }

  .booking-card,
  .taxi-workspace:has([data-view="details"].active) .booking-card {
    width: min(760px, 100%);
    height: calc(100dvh - 144px);
    max-height: 960px;
    padding: 28px;
  }

  .view[data-view="tariff"].active {
    height: 100%;
    grid-template-rows: minmax(300px, 1fr) 210px auto;
    gap: 16px;
  }

  .view[data-view="tariff"] .route-planner {
    padding-right: 4px;
  }

  .view[data-view="tariff"] .tariff-strip {
    height: 210px;
    min-height: 210px;
    margin: 0 -28px;
    padding: 0 28px 8px;
  }

  .view[data-view="tariff"] .tariff-card {
    height: 202px;
    min-height: 202px;
  }

  .tariff-footer {
    grid-template-rows: 48px 48px 70px;
  }

  .details-form {
    height: 100%;
  }

  .view[data-view="waiting"] .waiting-state,
  .view[data-view="assigned"] .assigned-state {
    width: min(620px, 100%);
    min-height: 100%;
    margin-inline: auto;
  }
}

@media (min-width: 1100px) {
  .taxi-workspace,
  .taxi-workspace:has([data-view="details"].active) {
    padding: 120px 48px 36px;
  }

  .booking-card,
  .taxi-workspace:has([data-view="details"].active) .booking-card {
    width: min(1180px, 100%);
    height: min(760px, calc(100dvh - 156px));
    max-height: none;
    padding: 30px;
  }

  .view[data-view="tariff"].active {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
    grid-template-rows: minmax(260px, 300px) auto;
    column-gap: 30px;
    row-gap: 18px;
    align-content: center;
  }

  .view[data-view="tariff"] .route-planner {
    grid-row: 1 / -1;
    min-height: 0;
    padding: 4px 30px 4px 0;
    border-right: 1px solid rgba(35, 34, 31, 0.09);
  }

  .view[data-view="tariff"] .tariff-strip {
    grid-column: 2;
    width: 100%;
    height: 300px;
    min-height: 300px;
    margin: 0;
    padding: 0 0 8px;
    grid-auto-columns: minmax(360px, 86%);
  }

  .view[data-view="tariff"] .tariff-card {
    height: 292px;
    min-height: 292px;
    grid-template-columns: minmax(190px, 48%) minmax(0, 1fr);
    padding: 24px;
  }

  .view[data-view="tariff"] .tariff-card img {
    height: 160px;
  }

  .view[data-view="tariff"] .tariff-footer {
    grid-column: 2;
    grid-template-rows: 48px 48px 70px;
  }

  .view[data-view="details"].active {
    height: 100%;
  }

  .view[data-view="details"] .details-form {
    grid-template-columns: minmax(350px, 0.9fr) minmax(430px, 1.1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    column-gap: 28px;
    row-gap: 14px;
  }

  .view[data-view="details"] .settings-head {
    grid-column: 1 / -1;
  }

  .view[data-view="details"] .settings-tariff {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    align-content: center;
    margin: 0;
  }

  .view[data-view="details"] .settings-car {
    height: min(280px, 34dvh);
  }

  .view[data-view="details"] .settings-options {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    margin: 0;
    padding-right: 4px;
    overflow-y: auto;
  }

  .view[data-view="details"] .details-form > .checkout,
  .view[data-view="details"] .details-form > .status {
    grid-column: 1 / -1;
    margin: 0;
  }

  .view[data-view="details"] .details-form > .checkout {
    grid-row: 3;
  }

  .view[data-view="details"] .details-form > .status {
    grid-row: 4;
  }
}

.recover-order-button {
  position: fixed;
  top: 108px;
  left: 24px;
  z-index: 70;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(35, 34, 31, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(35, 34, 31, 0.1);
  font-weight: 900;
}

.public-order-actions {
  display: grid;
  width: min(100%, 420px);
  gap: 5px;
}

.cancel-order-link {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #a44747;
  font-size: 13px;
  font-weight: 800;
}

.order-dialog {
  width: min(430px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(26, 25, 22, 0.24);
}

.order-dialog::backdrop {
  background: rgba(20, 20, 18, 0.48);
  backdrop-filter: blur(5px);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dialog-head {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.dialog-head span,
.dialog-card label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dialog-head h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.dialog-head button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #f2f2f0;
  color: var(--ink);
  font-size: 26px;
}

.dialog-card > label {
  display: grid;
  gap: 7px;
}

.dialog-card input[type="tel"],
.dialog-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f5;
}

.dialog-card input[type="tel"] {
  height: 52px;
  padding: 0 14px;
}

.dialog-card textarea {
  padding: 12px 14px;
  resize: vertical;
}

.cancel-reasons {
  display: grid;
  gap: 7px;
}

.active-orders-list {
  display: grid;
  gap: 8px;
}

.active-order-choice {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f5f3;
  color: var(--ink);
  text-align: left;
  transition: background 0.2s ease, transform 0.2s ease;
}

.active-order-choice:active {
  transform: scale(0.985);
}

.active-order-choice strong,
.active-order-choice span,
.active-order-choice small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-order-choice strong {
  font-size: 15px;
}

.active-order-choice span {
  font-size: 12px;
  font-weight: 700;
}

.active-order-choice small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.cancel-reasons input {
  position: absolute;
  opacity: 0;
}

.cancel-reasons span {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.cancel-reasons input:checked + span {
  border-color: #d7b621;
  background: #fff6c9;
}

.dialog-status {
  min-height: 20px;
  color: #a44747 !important;
  font-weight: 700;
}

.cancel-confirm {
  background: #a44747;
  color: #fff;
}

.site-tools {
  display: none;
}

.left-site-tools {
  position: fixed;
  top: 64px;
  left: 18px;
  z-index: 72;
  display: flex;
  align-items: center;
  gap: 7px;
}

.left-site-tools .recover-order-button {
  position: static;
}

.site-info-menu {
  position: relative;
}

.site-info-menu[hidden] {
  display: none;
}

#siteInfoButton {
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(35, 34, 31, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(35, 34, 31, 0.1);
  font-size: 12px;
  font-weight: 900;
}

#siteInfoButton > span {
  display: grid;
  width: 18px;
  gap: 3px;
}

#siteInfoButton i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.site-info-menu nav {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  display: grid;
  grid-auto-rows: minmax(64px, auto);
  width: min(310px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(35, 34, 31, 0.16);
}

.site-info-menu nav[hidden] {
  display: none;
}

.site-info-menu nav a {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
}

.site-info-menu nav a + a {
  border-top: 1px solid var(--line);
}

.site-phone-links {
  display: grid;
  border-top: 1px solid var(--line);
}

.site-phone-links a {
  min-height: 60px;
}

.site-info-menu nav strong {
  font-size: 13px;
}

.site-info-menu nav small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .site-info-menu nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 62px;
  }

  .site-info-menu nav a {
    min-height: 62px;
    place-items: center;
    padding: 10px;
    text-align: center;
  }

  .site-info-menu nav a + a {
    border-top: 0;
  }

  .site-phone-links {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-phone-links a + a {
    border-left: 1px solid var(--line);
  }

  .site-info-menu nav small {
    display: none;
  }
}

.site-setting-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.site-setting-list label {
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
}

.site-setting-list label + label {
  border-top: 1px solid var(--line);
}

.site-setting-list strong,
.site-setting-list small {
  display: block;
}

.site-setting-list strong {
  font-size: 14px;
}

.site-setting-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.site-setting-list input {
  width: 42px;
  height: 24px;
  accent-color: var(--accent-deep);
}

.service-area {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-radius: 14px;
  background: #f2f2f0;
}

.service-area span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clear-saved-order {
  min-height: 50px;
  border-radius: 14px;
  font-size: 13px;
}

@media (max-width: 700px) {
  .recover-order-button {
    top: 64px;
    left: 18px;
    min-height: 40px;
    padding-inline: 13px;
    font-size: 12px;
  }
}

/* Keep recommendations inside their row so they cannot run under tariffs. */
@media (max-width: 700px) {
  .active-order-return {
    top: 64px;
  }

  .taxi-workspace:has([data-view="tariff"].active) .booking-card {
    padding-top: 28px;
  }

  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 362px 167px 48px 48px 0;
    gap: 10px;
  }

  .view[data-view="tariff"] .route-planner {
    height: 362px;
    min-height: 0;
    max-height: 362px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 700px) and (max-height: 740px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 210px 167px 48px 48px 0;
  }

  .view[data-view="tariff"] .route-planner {
    height: 210px;
    max-height: 210px;
  }
}

/* Final non-mobile responsive layer. */
@media (min-width: 701px) {
  .taxi-workspace,
  .taxi-workspace:has([data-view="details"].active) {
    height: 100dvh;
    align-items: start;
    justify-items: center;
    padding: 116px 28px 28px;
  }

  .booking-card,
  .taxi-workspace:has([data-view="details"].active) .booking-card {
    width: min(760px, 100%);
    height: calc(100dvh - 144px);
    max-height: 960px;
    min-height: 0;
    padding: 28px;
    overflow: hidden;
  }

  .view[data-view="tariff"].active {
    height: 100%;
    grid-template-rows: minmax(300px, 1fr) 210px auto;
    gap: 16px;
  }

  .view[data-view="tariff"] .route-planner {
    height: auto;
    max-height: none;
    min-height: 0;
    padding-right: 4px;
  }

  .view[data-view="tariff"] .tariff-strip {
    height: 210px;
    min-height: 210px;
    margin: 0 -28px;
    padding: 0 28px 8px;
  }

  .view[data-view="tariff"] .tariff-card {
    height: 202px;
    min-height: 202px;
  }

  .tariff-footer {
    grid-template-rows: 48px 48px 70px;
  }

  .details-form {
    height: 100%;
  }
}

@media (min-width: 1100px) {
  .taxi-workspace,
  .taxi-workspace:has([data-view="details"].active) {
    padding: 120px 48px 36px;
  }

  .booking-card,
  .taxi-workspace:has([data-view="details"].active) .booking-card {
    width: min(1180px, 100%);
    height: min(760px, calc(100dvh - 156px));
    max-height: none;
    padding: 30px;
  }

  .view[data-view="tariff"].active {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
    grid-template-rows: 300px auto;
    column-gap: 30px;
    row-gap: 18px;
    align-content: center;
  }

  .view[data-view="tariff"] .route-planner {
    grid-column: 1;
    grid-row: 1 / -1;
    padding: 4px 30px 4px 0;
    border-right: 1px solid rgba(35, 34, 31, 0.09);
  }

  .view[data-view="tariff"] .tariff-strip {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 300px;
    min-height: 300px;
    margin: 0;
    padding: 0 0 8px;
    grid-auto-columns: minmax(360px, 86%);
  }

  .view[data-view="tariff"] .tariff-card {
    height: 292px;
    min-height: 292px;
    grid-template-columns: minmax(190px, 48%) minmax(0, 1fr);
    padding: 24px;
  }

  .view[data-view="tariff"] .tariff-card img {
    height: 160px;
  }

  .view[data-view="tariff"] .tariff-footer {
    grid-column: 2;
    grid-row: 2;
    grid-template-rows: 48px 48px 70px;
  }

  .view[data-view="details"].active {
    height: 100%;
  }

  .view[data-view="details"] .details-form {
    grid-template-columns: minmax(350px, 0.9fr) minmax(430px, 1.1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    column-gap: 28px;
    row-gap: 14px;
  }

  .view[data-view="details"] .settings-head {
    grid-column: 1 / -1;
  }

  .view[data-view="details"] .settings-tariff {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    align-content: center;
    margin: 0;
  }

  .view[data-view="details"] .settings-car {
    height: min(280px, 34dvh);
  }

  .view[data-view="details"] .settings-options {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    margin: 0;
    padding-right: 4px;
    overflow-y: auto;
  }

  .view[data-view="details"] .details-form > .checkout,
  .view[data-view="details"] .details-form > .status {
    grid-column: 1 / -1;
    margin: 0;
  }

  .view[data-view="details"] .details-form > .checkout {
    grid-row: 3;
  }

  .view[data-view="details"] .details-form > .status {
    grid-row: 4;
  }
}

@media (max-width: 700px) and (max-height: 899px) {
  .view[data-view="tariff"].active {
    display: block;
    min-height: 0;
  }

  .tariff-bottom {
    margin-top: 0;
  }
}

.taxi-workspace:has([data-view="details"].active) {
  padding-top: clamp(118px, 18dvh, 170px);
}

@media (max-width: 700px) {
  .taxi-workspace:has([data-view="details"].active) {
    padding-top: 60px;
  }

  .taxi-workspace:has([data-view="details"].active) .booking-card {
    max-height: calc(100dvh - 60px);
    min-height: calc(100dvh - 60px);
  }
}

/* Final layout rhythm for tariff and trip details screens. */
.view[data-view="tariff"].active,
.view[data-view="details"].active {
  height: 100%;
  min-height: 0;
}

.view[data-view="tariff"].active {
  display: grid;
  grid-template-rows: auto auto minmax(150px, 1fr) auto;
  gap: 12px;
}

.view[data-view="tariff"] .route-compact,
.view[data-view="tariff"] .tariff-suggestions,
.view[data-view="tariff"] .tariff-strip,
.view[data-view="tariff"] .payment-panel,
.view[data-view="tariff"] .checkout {
  margin-top: 0;
  margin-bottom: 0;
}

.view[data-view="tariff"] .tariff-strip {
  align-self: stretch;
  align-items: center;
}

.view[data-view="tariff"] .tariff-card {
  min-height: 150px;
}

.tariff-bottom {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.tariff-bottom .checkout,
.details-form > .checkout {
  margin: 0;
}

.view[data-view="details"].active {
  display: block;
}

.details-form {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
}

.settings-tariff {
  grid-template-columns: minmax(130px, 42%) minmax(0, 1fr);
  gap: 14px;
  padding: 0;
}

.settings-car {
  height: clamp(92px, 15dvh, 136px);
}

.settings-options {
  align-content: start;
  min-height: 0;
  gap: 8px;
}

.settings-row {
  padding: 11px 12px;
}

.settings-row input {
  height: 42px;
  margin-top: 6px;
}

.settings-row textarea {
  min-height: 76px;
  height: clamp(76px, 11dvh, 112px);
  margin-top: 6px;
  resize: none;
}

.details-form > .checkout {
  align-self: end;
  transform: translateY(4px);
}

.details-form > .status:empty {
  display: none;
}

.details-form > .status {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 104px;
  z-index: 2;
}

@media (max-width: 700px) {
  .booking-card {
    overflow: hidden;
  }

  .view[data-view="tariff"].active {
    grid-template-rows: auto auto minmax(118px, 1fr) auto;
    gap: 9px;
  }

  .view[data-view="tariff"] .tariff-strip {
    margin-inline: -18px;
    padding: 0 18px;
  }

  .view[data-view="tariff"] .tariff-card {
    min-height: 118px;
  }

  .tariff-bottom {
    gap: 12px;
    padding-bottom: 76px;
  }

  .view[data-view="details"].active {
    height: 100%;
  }

  .details-form {
    gap: 9px;
  }

  .settings-head strong {
    font-size: 18px;
  }

  .settings-head small {
    font-size: 12px;
  }

  .settings-tariff {
    grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
    text-align: left;
  }

  .settings-car {
    height: clamp(84px, 13dvh, 112px);
  }

  .settings-tariff strong {
    font-size: 26px;
  }

  .settings-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    border-radius: 16px;
  }

  .settings-icon {
    width: 22px;
    height: 22px;
  }

  .details-form > .checkout .submit,
  .view[data-view="tariff"] .checkout .submit {
    min-height: 64px;
  }
}

@media (max-width: 700px) and (max-height: 760px) {
  .taxi-workspace:has([data-view="details"].active) {
    padding-top: 96px;
  }

  .taxi-workspace:has([data-view="details"].active) .booking-card {
    max-height: calc(100dvh - 96px);
    min-height: calc(100dvh - 96px);
    padding-top: 14px;
  }

  .settings-head small,
  .settings-tariff small {
    display: none;
  }

  .settings-car {
    height: 72px;
  }

  .settings-row {
    padding-block: 8px;
  }

  .settings-row textarea {
    min-height: 56px;
    height: 56px;
  }
}

/* Balanced final composition for tariff selection and details. */
.view[data-view="tariff"].active {
  grid-template-rows: auto auto minmax(190px, 1fr) auto;
  gap: 16px;
}

.view[data-view="tariff"] .tariff-suggestions button {
  min-height: 58px;
  padding-block: 8px;
}

.view[data-view="tariff"] .tariff-strip {
  min-height: 190px;
}

.view[data-view="tariff"] .tariff-card {
  min-height: 190px;
  height: 100%;
}

.view[data-view="tariff"] .tariff-card img {
  height: 126px;
}

.view[data-view="tariff"] .checkout,
.details-form > .checkout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  height: 70px;
  min-height: 70px;
}

.view[data-view="tariff"] .checkout .submit,
.details-form > .checkout .submit {
  width: 100%;
  height: 70px;
  min-height: 70px;
}

.view[data-view="tariff"] .checkout-menu,
.details-form > .checkout .checkout-menu {
  width: 58px;
  height: 58px;
}

.view[data-view="details"] .settings-head {
  position: relative;
  display: block;
  padding-right: 62px;
}

.view[data-view="details"] .settings-info {
  position: fixed;
  top: 98px;
  right: 24px;
  z-index: 80;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-tariff {
  grid-template-columns: 1fr;
  gap: 6px;
  text-align: left;
}

.settings-car {
  width: 100%;
  height: clamp(138px, 20dvh, 190px);
}

.settings-tariff > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: baseline;
}

.settings-tariff span,
.settings-tariff strong,
.settings-tariff small {
  margin-top: 0;
}

.settings-tariff strong {
  font-size: 28px;
}

@media (max-width: 700px) {
  .taxi-workspace:has([data-view="tariff"].active) {
    padding-top: 82px;
  }

  .taxi-workspace:has([data-view="tariff"].active) .booking-card {
    max-height: calc(100dvh - 82px);
    min-height: calc(100dvh - 82px);
  }

  .view[data-view="tariff"].active {
    grid-template-rows: auto auto minmax(142px, 1fr) auto;
    gap: 11px;
  }

  .view[data-view="tariff"] .tariff-suggestions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .view[data-view="tariff"] .tariff-suggestions button {
    min-height: 48px;
    padding-block: 5px;
  }

  .view[data-view="tariff"] .tariff-strip {
    min-height: 142px;
  }

  .view[data-view="tariff"] .tariff-card {
    min-height: 142px;
  }

  .view[data-view="tariff"] .tariff-card img {
    height: 92px;
  }

  .view[data-view="tariff"] .checkout,
  .details-form > .checkout {
    position: fixed;
    right: 18px;
    bottom: 8px;
    left: 18px;
    z-index: 12;
    grid-template-columns: minmax(0, 1fr) 54px;
    height: 64px;
    min-height: 64px;
    margin: 0;
    transform: none;
  }

  .details-form > .checkout {
    background: #fff;
    box-shadow: 0 -12px 22px 10px #fff;
  }

  .view[data-view="tariff"] .checkout .submit,
  .details-form > .checkout .submit {
    height: 64px;
    min-height: 64px;
  }

  .view[data-view="tariff"] .checkout-menu,
  .details-form > .checkout .checkout-menu {
    width: 54px;
    height: 54px;
  }

  .details-form .ghost-menu {
    opacity: 1;
  }

  .details-form {
    display: block;
    height: 100%;
    padding-bottom: 92px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .details-form::-webkit-scrollbar {
    display: none;
  }

  .details-form .settings-tariff {
    margin-top: 10px;
  }

  .details-form .settings-options {
    margin-top: 14px;
  }

  .details-form .settings-options > * + * {
    margin-top: 10px;
  }

  .view[data-view="details"] .settings-head {
    padding-right: 54px;
  }

  .view[data-view="details"] .settings-info {
    top: 82px;
    right: 18px;
    width: 58px;
    height: 58px;
  }

  .settings-tariff {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .settings-car {
    height: 118px;
  }

  .settings-tariff > div {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .settings-row textarea {
    min-height: 42px;
    height: 42px;
  }
}

@media (max-width: 700px) {
  .trip-preferences {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .trip-preferences label {
    position: relative;
    grid-template-rows: 141px 40px;
    gap: 5px;
    padding: 8px;
    overflow: hidden;
    border: 1px solid rgba(35, 34, 31, 0.09);
    border-radius: 16px;
    background: #f7f7f5;
  }

  .trip-preferences .preference-image {
    grid-row: 1;
    width: 100%;
    height: 141px;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 11px;
    background: #fff;
    object-fit: contain;
  }

  .trip-preferences label > span:not(.preference-image):not(.preference-stepper) {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: block;
    width: calc(100% - 28px);
    min-height: 0;
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
  }

  .trip-preferences select {
    grid-row: 2;
    height: 40px;
    padding: 0 6px;
    border-radius: 10px;
    background: #fff;
    font-size: 11px;
  }

  .view[data-view="details"] .settings-head > div > strong {
    position: fixed;
    top: 82px;
    right: 82px;
    left: 82px;
    z-index: 81;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 17px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }
}

@media (max-width: 700px) and (max-height: 820px) {
  .view[data-view="tariff"] .tariff-suggestions button {
    min-height: 42px;
  }

  .view[data-view="tariff"] .tariff-suggestions small {
    display: none;
  }

  .view[data-view="tariff"] .tariff-strip,
  .view[data-view="tariff"] .tariff-card {
    min-height: 126px;
  }

  .settings-car {
    height: 86px;
  }

  .trip-preferences label > span:not(.preference-image):not(.preference-stepper) {
    min-height: 24px;
    font-size: 11px;
  }

  .trip-preferences select {
    height: 38px;
    padding-inline: 6px;
    font-size: 11px;
  }

  .settings-row textarea {
    min-height: 48px;
    height: 48px;
  }
}

/* Tariff card composition: label top-left, car centered, price bottom-right. */
.tariff-card {
  display: block;
  padding: 18px;
}

.tariff-card img {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 68%;
  height: 72%;
  object-fit: contain;
  opacity: 1;
  transform: translate3d(-42%, -50%, 0) scale(1);
  transition: transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
}

.tariff-card.active img {
  opacity: 1;
  transform: translate3d(-51%, -50%, 0) scale(1.15);
}

/* Unified neutral background for every tariff and the side-view settings card. */
.tariff-card,
.tariff-card.active,
.view[data-view="details"] .settings-tariff {
  background: #ededeb;
}

.tariff-card.active {
  border-color: rgba(35, 34, 31, 0.28);
  box-shadow: inset 0 0 0 1px rgba(35, 34, 31, 0.08);
}

.view[data-view="details"] .settings-tariff {
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.1);
  border-radius: 24px;
}

.view[data-view="details"] .details-form > .checkout {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell:has([data-view="details"].active) .left-site-tools {
  display: none;
}

.app-shell:has([data-view="details"].active) .app-back {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tariff-card span,
.tariff-card small,
.tariff-card strong {
  position: absolute;
  z-index: 2;
}

.tariff-card span {
  top: 16px;
  left: 18px;
  max-width: calc(100% - 36px);
  font-size: 22px;
}

.tariff-card small {
  top: 46px;
  left: 18px;
  margin: 0;
}

.tariff-card strong {
  right: 18px;
  bottom: 16px;
  margin: 0;
  font-size: 26px;
  text-align: right;
}

@media (max-width: 700px) {
  .tariff-card {
    padding: 14px;
  }

  .tariff-card img {
    width: 72%;
    height: 70%;
  }

  .tariff-card span {
    top: 12px;
    left: 14px;
    max-width: calc(100% - 28px);
    font-size: 19px;
  }

  .tariff-card small {
    top: 38px;
    left: 14px;
    font-size: 13px;
  }

  .tariff-card strong {
    right: 14px;
    bottom: 12px;
    font-size: 23px;
  }
}

/* Details header scrolls with content; two large extra-option cards. */
.view[data-view="details"] .settings-head {
  position: static;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 0;
}

.view[data-view="details"] .settings-head > div {
  min-width: 0;
  text-align: center;
}

.view[data-view="details"] .settings-head > div > strong,
.view[data-view="details"] .settings-head > div > small {
  position: static;
  display: block;
  width: auto;
  height: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view[data-view="details"] .app-back,
.view[data-view="details"] .settings-info {
  position: static;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.view[data-view="details"] .app-back {
  justify-self: start;
}

.view[data-view="details"] .settings-info {
  justify-self: end;
}

.view[data-view="details"] .trip-preferences {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 700px) {
  .view[data-view="details"] .settings-head {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .view[data-view="details"] .app-back,
  .view[data-view="details"] .settings-info {
    width: 48px;
    height: 48px;
  }

  .view[data-view="details"] .settings-head > div > strong {
    font-size: 17px;
    line-height: 1.1;
  }

  .view[data-view="details"] .settings-head > div > small {
    margin-top: 4px;
    font-size: 11px;
  }

  .view[data-view="details"] .trip-preferences {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .view[data-view="details"] .trip-preferences label {
    grid-template-rows: 164px 44px;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #f1f1ef;
    box-shadow: inset 0 0 0 1px rgba(35, 34, 31, 0.07);
  }

  .view[data-view="details"] .trip-preferences .preference-image {
    height: 164px;
    padding: 8px 10px 0;
    border-radius: 20px 20px 0 0;
    background: transparent;
    mix-blend-mode: multiply;
    filter: contrast(1.04);
  }

  .view[data-view="details"] .trip-preferences select {
    width: calc(100% - 16px);
    height: 38px;
    margin: 0 8px 6px;
    padding-inline: 12px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
  }

  .view[data-view="details"] .trip-preferences label > span:not(.preference-image):not(.preference-stepper) {
    top: 13px;
    left: 13px;
    width: calc(100% - 26px);
    padding: 0;
    background: transparent;
    font-size: 13px;
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.94);
  }

  .view[data-view="details"] .preference-stepper {
    position: static;
    z-index: 3;
    display: grid;
    width: calc(100% - 16px);
    height: 38px;
    min-height: 38px;
    grid-row: 2;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    justify-self: center;
    margin: 0 8px 6px;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
  }

  .view[data-view="details"] .preference-stepper button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease;
  }

  .view[data-view="details"] .preference-stepper button:active {
    background: #ededeb;
    transform: scale(0.92);
  }

  .view[data-view="details"] .preference-stepper output {
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view[data-view="details"] .trip-preferences label:last-child > span:not(.preference-image):not(.preference-stepper) {
    width: 92px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 1.08;
    text-shadow: none;
  }

  .view[data-view="details"] .trip-preferences label:last-child .preference-image {
    padding: 28px 2px 4px 22px;
    object-position: center bottom;
  }
}

@media (max-width: 700px) {
  .view[data-view="details"] .trip-preferences label {
    grid-template-rows: 44px 120px 44px;
  }

  .view[data-view="details"] .trip-preferences label > span:not(.preference-image):not(.preference-stepper),
  .view[data-view="details"] .trip-preferences label:last-child > span:not(.preference-image):not(.preference-stepper) {
    position: static;
    grid-row: 1;
    width: auto;
    padding: 11px 13px 0;
    text-shadow: none;
  }

  .view[data-view="details"] .trip-preferences .preference-image,
  .view[data-view="details"] .trip-preferences label:last-child .preference-image {
    grid-row: 2;
    height: 120px;
    padding: 0 10px 4px;
    object-position: center bottom;
  }

  .view[data-view="details"] .preference-stepper {
    grid-row: 3;
  }
}

.route-editor {
  display: grid;
  gap: 8px;
}

.route-point {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 64px;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 17px;
  background: #f7f7f5;
}

.route-point .route-dot {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 16px;
  height: 16px;
}

.route-point > span {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.route-point > input {
  grid-column: 2 / 4;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  outline: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-field .route-dot {
  background: #b9b8b4;
}

.remove-stop {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #e9e9e6;
  color: var(--ink);
  font-size: 21px;
  transform: translateY(-50%);
}

.stop-field > input {
  padding-right: 34px;
}

.route-stops {
  display: grid;
  gap: 8px;
}

.route-stop-entry {
  display: grid;
  min-width: 0;
  max-height: 520px;
  overflow: visible;
  transform-origin: top center;
  transition:
    max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.route-stop-entry.is-entering,
.route-stop-entry.is-removing {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
}

.route-stops:empty {
  display: none;
}

.add-stop {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  background: #f1f1ef;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.add-stop span {
  font-size: 19px;
  line-height: 1;
}

.add-stop:disabled {
  opacity: 0.42;
}

@media (max-width: 700px) {
  .view[data-view="tariff"].active {
    padding-bottom: 78px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .view[data-view="tariff"].active::-webkit-scrollbar {
    display: none;
  }

  .route-point {
    min-height: 58px;
    padding-block: 7px;
  }

  .route-editor:has(.stop-field) + .tariff-suggestions {
    display: grid;
  }

  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: auto minmax(126px, 1fr) auto;
  }

  .view[data-view="tariff"].active:has(.stop-field) .payment-panel {
    align-self: end;
  }
}

@keyframes view-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.view.active {
  animation: view-enter 0.34s ease both;
}

button,
.tariff-card,
.settings-row,
.payment-choice span,
.route-point,
.preference-stepper {
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    background-color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

button:active {
  transform: scale(0.97);
}

.remove-stop:active {
  transform: translateY(-50%) scale(0.94);
}

.route-point {
  max-height: 86px;
  overflow: hidden;
  transform-origin: top center;
  transition:
    max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    min-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease;
}

.route-point.is-entering,
.route-point.is-removing {
  min-height: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
}

.tariff-suggestions button {
  max-height: 64px;
  overflow: hidden;
  transform-origin: top center;
  transition:
    min-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.route-editor[data-stop-count="1"] + .tariff-suggestions button:nth-child(n + 5),
.route-editor[data-stop-count="2"] + .tariff-suggestions button:nth-child(n + 4),
.route-editor[data-stop-count="3"] + .tariff-suggestions button:nth-child(n + 3),
.route-editor[data-stop-count="4"] + .tariff-suggestions button:nth-child(n + 2) {
  min-height: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scaleY(0.96);
}

@media (max-width: 700px) {
  .view[data-view="tariff"] .tariff-strip {
    margin-top: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.settings-controls {
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 20px;
  background: #f5f5f3;
}

.settings-controls .settings-row {
  position: relative;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-controls .settings-row + .settings-row::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 62px;
  height: 1px;
  background: rgba(35, 34, 31, 0.08);
  content: "";
}

.settings-controls .settings-icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.settings-controls .settings-row strong {
  font-size: 15px;
  line-height: 1.2;
}

.settings-controls .settings-row input,
.settings-controls .settings-row textarea {
  margin-top: 9px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(35, 34, 31, 0.08);
}

.settings-controls .schedule-row input {
  height: 44px;
}

.settings-controls .payment-choice {
  gap: 6px;
  margin-top: 9px;
  padding: 4px;
  border-radius: 13px;
  background: #e9e9e6;
}

.settings-controls .payment-choice span {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
}

.settings-controls .payment-choice input:checked + span {
  background: #fff;
  box-shadow: 0 2px 8px rgba(35, 34, 31, 0.08);
}

.settings-controls .comment-row textarea {
  height: 60px;
  min-height: 60px;
  padding: 12px;
}

.comment-note {
  display: block;
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 700px) {
  .details-form {
    padding-bottom: 76px;
  }

  .details-form .settings-options {
    margin-top: 10px;
  }

  .details-form .settings-options > * + * {
    margin-top: 5px;
  }

  .settings-controls .settings-row input,
  .settings-controls .settings-row textarea,
  .settings-controls .payment-choice {
    margin-top: 7px;
  }
}

@media (max-width: 700px) {
  .view[data-view="assigned"].active {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .view[data-view="assigned"].active::-webkit-scrollbar {
    display: none;
  }

  .view[data-view="assigned"] .assigned-state {
    min-height: 100%;
    align-content: start;
    gap: 9px;
    padding: 16px 0 8px;
  }

  .view[data-view="assigned"] .car-color {
    width: 34px;
    height: 34px;
    border-width: 4px;
  }

  .view[data-view="assigned"] .assigned-car {
    width: min(320px, 82vw);
    height: 118px;
  }

  .view[data-view="assigned"] .assigned-heading h2 {
    max-width: 330px;
    font-size: 28px;
  }

  .view[data-view="assigned"] .assigned-car-card {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 132px);
    gap: 10px;
    padding: 13px;
  }

  .view[data-view="assigned"] .assigned-car-card strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view[data-view="assigned"] .license-plate {
    min-width: 0;
    padding-inline: 8px;
    font-size: 15px;
  }

  .view[data-view="waiting"].active {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .view[data-view="waiting"].active::-webkit-scrollbar {
    display: none;
  }

  .view[data-view="waiting"] .waiting-state {
    min-height: 100%;
    align-content: start;
    gap: 9px;
    padding: 22px 0 8px;
  }

  .view[data-view="waiting"] .car-color {
    width: 34px;
    height: 34px;
    border-width: 4px;
  }

  .view[data-view="waiting"] .waiting-car {
    width: min(320px, 82vw);
    height: 126px;
  }

  .view[data-view="waiting"] .waiting-state h2 {
    max-width: 330px;
    font-size: 32px;
    line-height: 1.12;
  }

  .view[data-view="waiting"] .waiting-state .waiting-eta {
    max-width: 330px;
    font-size: 15px;
    line-height: 1.3;
  }

  .view[data-view="waiting"] #waitCarText {
    font-size: 16px;
  }

  .tariff-footer {
    display: contents;
  }

  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 410px 167px 48px 0;
    gap: 13px;
    padding-bottom: 0;
    overflow: hidden;
  }

  .route-planner {
    height: 410px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .route-planner::-webkit-scrollbar {
    display: none;
  }

  .view[data-view="tariff"] .tariff-strip {
    align-self: start;
    margin-top: 0;
    min-height: 167px;
    padding-inline: 18px;
    isolation: isolate;
    overscroll-behavior-x: contain;
    scroll-behavior: auto;
  }

  .view[data-view="tariff"] .tariff-card {
    height: 167px;
    min-height: 167px;
  }

  .view[data-view="tariff"] .tariff-card img {
    width: 58%;
    height: 50%;
  }

  .view[data-view="tariff"] .tariff-card small {
    top: 38px;
  }

  .selected-rate {
    display: grid;
    width: 100%;
    height: 48px;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: baseline;
    column-gap: 12px;
    row-gap: 3px;
    justify-self: center;
    padding: 6px 16px;
    border: 1px solid rgba(35, 34, 31, 0.08);
    border-radius: 16px;
    background: #f2f2f0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.28s ease, opacity 0.28s ease;
  }

  .selected-rate span {
    color: var(--muted);
  }

  .selected-rate strong {
    font-size: 15px;
  }

  .selected-rate small {
    grid-column: 1 / -1;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view[data-view="tariff"] .tariff-suggestions button {
    min-height: 39px;
    max-height: 39px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .view[data-view="tariff"] .tariff-suggestions button + button {
    margin-top: 5px;
  }

  .view[data-view="tariff"] .route-editor[data-stop-count="1"] + .tariff-suggestions button:nth-child(n + 5),
  .view[data-view="tariff"] .route-editor[data-stop-count="2"] + .tariff-suggestions button:nth-child(n + 4),
  .view[data-view="tariff"] .route-editor[data-stop-count="3"] + .tariff-suggestions button:nth-child(n + 3),
  .view[data-view="tariff"] .route-editor[data-stop-count="4"] + .tariff-suggestions button:nth-child(n + 2) {
    margin-top: 0;
  }

  .view[data-view="tariff"] .tariff-bottom {
    height: 0;
    min-height: 0;
    padding: 0;
  }

  .view[data-view="tariff"] .route-editor + .tariff-suggestions {
    margin-top: 16px;
  }

  .view[data-view="tariff"] .route-editor,
  .view[data-view="tariff"] .route-stops {
    gap: 13px;
  }

  .view[data-view="tariff"] .checkout,
  .details-form > .checkout {
    bottom: 12px;
  }

  .settings-controls .settings-row {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .settings-controls .schedule-row input {
    height: 40px;
  }

  .settings-controls .payment-choice span {
    min-height: 36px;
  }

  .settings-controls .comment-row textarea {
    height: 52px;
    min-height: 52px;
  }
}

@media (min-width: 701px) {
  .taxi-workspace,
  .taxi-workspace:has([data-view="details"].active) {
    height: 100dvh;
    padding: 112px 24px 24px;
    place-items: center;
  }

  .booking-card,
  .taxi-workspace:has([data-view="details"].active) .booking-card {
    width: min(620px, 100%);
    height: min(760px, calc(100dvh - 136px));
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .view[data-view="tariff"].active {
    grid-template-rows: minmax(0, 1fr) 190px auto;
    gap: 12px;
  }

  .view[data-view="tariff"] .route-planner {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .view[data-view="tariff"] .route-planner::-webkit-scrollbar {
    display: none;
  }

  .tariff-footer {
    display: grid;
    grid-template-rows: 48px 70px;
    gap: 10px;
  }

  .selected-rate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: baseline;
    column-gap: 12px;
    row-gap: 3px;
    padding: 6px 16px;
    border: 1px solid rgba(35, 34, 31, 0.08);
    border-radius: 16px;
    background: #f2f2f0;
    font-size: 13px;
    font-weight: 900;
  }

  .selected-rate span,
  .selected-rate small {
    color: var(--muted);
  }

  .selected-rate strong {
    font-size: 15px;
  }

  .selected-rate small {
    grid-column: 1 / -1;
    font-size: 10px;
    line-height: 1.1;
  }

  .view[data-view="details"].active,
  .details-form {
    min-height: 0;
  }

  .details-form .settings-options {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .details-form .settings-options::-webkit-scrollbar {
    display: none;
  }
}

/* Compact rate summary above the fixed checkout. */
.selected-rate {
  min-height: 64px;
  height: 64px;
  grid-template-columns: minmax(86px, 0.75fr) minmax(190px, 1.25fr);
  grid-template-rows: 38px auto;
  align-items: center;
  column-gap: 14px;
  padding: 6px 10px 5px 14px;
}

.selected-rate .rate-copy,
.selected-rate .tariff-payment {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.selected-rate .rate-copy {
  grid-template-columns: 1fr;
  gap: 2px;
}

.selected-rate .rate-copy span,
.selected-rate .tariff-payment > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.selected-rate .rate-copy strong {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
}

.selected-rate .payment-choice {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}

.selected-rate .payment-choice span {
  min-height: 32px;
  padding: 0 4px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.selected-rate .payment-choice input:checked + span {
  background: var(--accent);
  color: var(--ink);
}

.selected-rate > small {
  grid-column: 1 / -1;
  align-self: end;
  font-size: 9px;
}

.active-order-return {
  position: fixed;
  top: 108px;
  right: 24px;
  z-index: 70;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(35, 34, 31, 0.12);
  border-radius: 14px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(35, 34, 31, 0.12);
  font-weight: 900;
  transition: transform 0.22s ease, opacity 0.22s ease, background-color 0.22s ease;
}

.active-order-return:hover {
  background: #ffde55;
}

@media (min-width: 701px) {
  .tariff-footer {
    grid-template-rows: 64px 70px;
  }
}

@media (max-width: 700px) {
  .active-order-return {
    top: 64px;
    right: 18px;
    min-height: 40px;
    padding-inline: 13px;
    font-size: 12px;
  }

  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 386px 167px 64px 0;
  }

  .selected-rate {
    width: 100%;
    height: 64px;
    min-height: 64px;
  }
}

/* Price summary is intentionally separate from payment in trip details. */
.selected-rate {
  display: grid;
  width: 100%;
  height: 48px;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 3px;
  padding: 6px 16px;
}

.selected-rate > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.selected-rate > strong {
  font-size: 15px;
  white-space: nowrap;
}

.selected-rate > small {
  grid-column: 1 / -1;
  font-size: 10px;
}

.tariff-payment-panel {
  display: grid;
  width: 100%;
  height: 48px;
  min-height: 48px;
  grid-template-columns: minmax(76px, 0.45fr) minmax(0, 1.55fr);
  gap: 10px;
  align-items: center;
  padding: 6px 10px 6px 16px;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 16px;
  background: #f2f2f0;
}

.tariff-payment-panel > strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tariff-payment-panel .payment-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.tariff-payment-panel .payment-choice span {
  min-height: 34px;
  padding: 0 6px;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.tariff-payment-panel .payment-choice input:checked + span {
  background: var(--accent);
  color: var(--ink);
}

.cancel-rule {
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f2f2f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.trip-info-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(35, 34, 31, 0.08);
  border-radius: 16px;
  background: #f5f5f3;
}

.trip-info-list p {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 12px 14px;
}

.trip-info-list p + p {
  border-top: 1px solid rgba(35, 34, 31, 0.08);
}

.trip-info-list strong {
  font-size: 14px;
}

.trip-info-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

@media (min-width: 701px) {
  .tariff-footer {
    grid-template-rows: 48px 70px;
  }
}

@media (max-width: 700px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 362px 167px 48px 0;
    gap: 10px;
  }

  .selected-rate {
    height: 48px;
    min-height: 48px;
  }

  .view[data-view="tariff"] .route-planner {
    height: 362px;
    min-height: 0;
    max-height: 362px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 700px) and (max-height: 740px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 210px 167px 48px 0;
  }

  .view[data-view="tariff"] .route-planner {
    height: 210px;
    max-height: 210px;
  }
}

/* Per-kilometre rates are shown inside the cards, so the repeated summary is no longer needed. */
.tariff-footer {
  grid-template-rows: 70px;
}

.tariff-bottom {
  grid-row: auto;
}

@media (min-width: 701px) {
  .tariff-bottom {
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 362px 167px 0;
  }
}

@media (max-width: 700px) and (max-height: 740px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: 210px 167px 0;
  }
}

.view[data-view="tariff"] .checkout {
  grid-template-columns: minmax(0, 1fr) 58px;
}

@media (max-width: 700px) {
  .view[data-view="tariff"].active,
  .view[data-view="tariff"].active:has(.stop-field) {
    grid-template-rows: auto 167px 0;
    align-content: start;
  }

  .view[data-view="tariff"] .checkout {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .view[data-view="tariff"] .route-editor {
    gap: 8px;
  }

  .view[data-view="tariff"] .add-stop {
    margin-top: 5px;
  }

  .view[data-view="tariff"] .route-planner {
    height: auto;
    max-height: max(0px, calc(100dvh - 394px));
  }

  .view[data-view="tariff"] .tariff-strip {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 11;
    width: auto;
    margin-inline: -18px;
    padding-inline: 18px;
  }
}

@media (max-width: 700px) and (min-height: 821px) {
  .view[data-view="tariff"] .tariff-suggestions button {
    min-height: 48px;
    max-height: 48px;
  }
}

.route-point-shell:has(.locate-button) .from-field > input {
  padding-right: 44px;
}

.locate-button {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  transform: translateY(-50%);
  transition: background-color 180ms ease, opacity 180ms ease;
}

.locate-button img { width: 24px; height: 24px; }
.locate-button:hover { background: #e8ece9; }
.locate-button:focus-visible { outline: 2px solid #28694f; outline-offset: 1px; }
.locate-button[aria-busy="true"] { opacity: 0.45; }

#routeStatus {
  margin: 10px 2px;
  min-height: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#routeStatus.minimum-distance-warning {
  min-height: 0;
  margin: 14px 2px 18px;
  color: var(--red);
  font-size: clamp(12px, 3.9vw, 20px);
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow-wrap: normal;
}

.route-point:has(input[aria-invalid="true"]) { border-color: #b44848; }
.checkout button:disabled { cursor: not-allowed; opacity: 0.55; }

.booking-card,
.view[data-view="tariff"].active,
.view[data-view="tariff"].active:has(.stop-field) {
  overflow: clip;
}

.mobile-suggestions[hidden] { display: none; }

.night-call-notice {
  margin: 6px 2px 12px;
  color: #565853;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.night-call-notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 700px) and (max-height: 600px) {
  .view[data-view="tariff"].active:has(.route-point input:focus) {
    grid-template-rows: minmax(0, 1fr) 0;
  }

  .view[data-view="tariff"]:has(.route-point input:focus) .route-planner {
    height: auto;
    max-height: max(0px, calc(100dvh - 210px));
  }

  .view[data-view="tariff"]:has(.route-point input:focus) .tariff-strip {
    display: none;
  }
}
