:root {
  --app-bg: #f5f8fb;
  --app-text: #10233d;
  --app-muted: #68778a;
  --app-card: #fff;
  --app-blue: #176fd1;
  --app-blue-soft: #eef6ff;
  --app-green: #158452;
  --app-green-dark: #0f6c42;
  --app-green-soft: #eef9f3;
  --app-border: #dce5ed;
  --surface-color: #fff;
  --border-color: #dce5ed;
  --text-secondary: #68778a;
}

.impersonation-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid #e3b341; border-radius: 12px; background: #fff6d8; color: #573f00; font-size: 13px; font-weight: 700; }
.impersonation-banner[hidden] { display: none; }
[data-theme="dark"] .impersonation-banner { border-color: #80671f; background: #352c12; color: #ffe596; }

@media (max-width: 520px) {
  .impersonation-banner { align-items: stretch; flex-direction: column; }
}

[data-theme="dark"] {
  --app-bg: #08111f;
  --app-text: #edf4ff;
  --app-muted: #9eafc3;
  --app-card: #101c2d;
  --app-blue: #4295ee;
  --app-blue-soft: #152b45;
  --app-green: #39bd7c;
  --app-green-dark: #83ddb0;
  --app-green-soft: #102d25;
  --app-border: #2a3b50;
  --surface-color: #101c2d;
  --border-color: #2a3b50;
  --text-secondary: #9eafc3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom));
  background: var(--app-card);
}

.avatar-editor__preview { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 16px; border-radius: 50%; overflow: hidden; background: var(--app-blue-soft); color: var(--app-text); }
.avatar-editor__preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-editor__preview .app-icon { width: 40px; height: 40px; }

.avatar-cropper-modal > .modal-wide {
  width: min(400px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}
.avatar-cropper-modal > .modal-wide > h3 { padding: 16px 20px 12px; }
.avatar-cropper-modal > .modal-wide > .modal-body {
  padding: 0 16px 12px;
  overflow: hidden;
}
.avatar-cropper-modal .msweb-image-cropper { gap: 10px; }
.avatar-cropper-modal .msweb-image-cropper__stage {
  max-width: min(320px, 42dvh) !important;
}
.avatar-cropper-modal > .modal-wide > .buttons {
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px 16px;
}
.avatar-cropper-modal > .modal-wide > .buttons > .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 42px;
}

.app-icon, .action-card__icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-icon { width: 22px; height: 22px; flex: none; }
.app-button-with-icon { display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; }
.app-button-with-icon--left { flex-direction: column; }

.region-control { position: relative; margin: 0; }
.region-control > .app-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 16px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  color: #0c5cab;
  pointer-events: none;
}
.region-control .select-component-wrapper { width: 100%; }
.region-control .select-component,
.region-control .select2-container .select2-selection--single {
  width: 100%;
  height: 60px !important;
  padding-left: 58px !important;
  padding-right: 48px !important;
  border: 1px solid #cdddec !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--app-text) !important;
  font-size: 1.05rem;
  font-weight: 650;
}
.region-control .select2-selection__rendered { line-height: 58px !important; color: var(--app-text) !important; }
.region-control .select2-selection__arrow {
  top: 0 !important;
  right: 6px !important;
  width: 42px !important;
  border-left: 0 !important;
  background: transparent !important;
}
.region-control .select2-selection__arrow b {
  width: 10px !important;
  height: 10px !important;
  margin: -7px 0 0 -6px !important;
  border: 0 !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: rotate(45deg);
}
.region-control .select2-container--open .select2-selection__arrow b {
  margin-top: -2px !important;
  transform: rotate(225deg);
}

.actions { display: grid; gap: 12px; padding-top: 18px; }
.home-mode-switch { display: flex; justify-content: center; margin-bottom: 2px; }
.home-mode-switch .home-mode-segments { display: flex; width: min(100%, 360px); }
.home-mode-switch .segmented-control-btn { flex: 1 1 0; min-height: 42px; font-size: .95rem; }
.actions[hidden], .action-card[hidden], .upcoming[hidden] { display: none !important; }
.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 104px;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
}
.action-card__icon { width: 42px; height: 42px; color: var(--app-green); }
.action-card--passenger .action-card__icon { color: #fff; }
.action-card--driver { border-color: #d5ebdf; background: var(--app-green-soft); }
.action-card--passenger { background: var(--app-blue); color: #fff; }
.action-card__copy { min-width: 0; padding-right: 44px; }
.action-card__label {
  display: block;
  margin-bottom: 6px;
  color: var(--app-green);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.action-card--passenger .action-card__label { color: #cfe6ff; }
.action-card h2 { margin: 0; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.025em; }
.action-card p { margin: 7px 0 0; color: var(--app-muted); font-size: .92rem; line-height: 1.4; }
.action-card--passenger p { color: #dfedfc; }
.action-card__action { position: absolute; inset: 0; z-index: 2; }
.action-card__button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.action-card__button:hover { background: rgba(255, 255, 255, .12) !important; }
.action-card--driver .action-card__button:hover { background: rgba(21, 132, 82, .06) !important; }
.action-card__button:focus-visible { outline: 3px solid #75aef0; outline-offset: 2px; }
.action-card__button .app-icon {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
}
.action-card--driver .action-card__button { color: var(--app-green) !important; }
.action-card--passenger .action-card__button { color: #fff !important; }

.upcoming { margin-top: 22px; }
.upcoming > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.upcoming h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.025em; }
.upcoming__all { padding: 4px !important; border: 0 !important; background: transparent !important; color: var(--app-green) !important; box-shadow: none !important; }
.upcoming__all.app-button-with-icon { flex-direction: row; }
.upcoming__list { display: grid; gap: 12px; }
.upcoming-card { position: relative; padding: 18px 58px 18px 18px; border: 1px solid #cdddec; border-radius: 12px; background: #fff; }
.upcoming-card h3 { margin: 0 0 10px; font-size: 1.15rem; letter-spacing: -.015em; }
.upcoming-card p { display: flex; align-items: center; gap: 9px; margin: 6px 0 0; color: var(--app-text); font-size: .9rem; }
.upcoming-card p .app-icon { width: 18px; height: 18px; color: #0c4a91; }
.upcoming-card > .msweb-ui.upcoming-card__open,
.upcoming-card > .msweb-ui.upcoming-card__open:hover,
.upcoming-card > .msweb-ui.upcoming-card__open:active {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 8px !important;
  transform: translateY(-50%);
  border: 0 !important;
  background: transparent !important;
  color: #0c4a91 !important;
  box-shadow: none !important;
}
.upcoming__empty { margin: 0; padding: 22px; border: 1px solid var(--app-border); border-radius: 12px; color: var(--app-muted); text-align: center; }
.trip-history { display: grid; gap: 12px; margin-top: 14px; }
.trip-history__toggle { justify-self: center; }

.app-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-evenly;
  width: min(100%, 680px);
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-border);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}
.app-nav:empty { display: none; }
.app-nav .app-nav__item {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 54px;
  padding: 6px 3px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #52657a !important;
  font-size: clamp(.66rem, 2.6vw, .77rem);
  white-space: normal;
}
.app-nav .app-nav__item--active { color: var(--app-blue) !important; }
.app-nav .app-nav__item .app-icon { width: 24px; height: 24px; }
.app-nav__avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; object-fit: cover; }
.profile-mode-menu { display: grid; gap: 4px; min-width: 170px; }
.profile-mode-menu__item {
  width: 100%;
  justify-content: flex-start !important;
  flex-direction: row !important;
  padding: 10px 12px !important;
  border: 0 !important;
  box-shadow: none !important;
}
.profile-mode-menu__item.is-active { background: var(--app-blue-soft) !important; color: var(--app-blue) !important; }
.app-shell.profile-page { background: var(--app-bg); }
.profile-workspace { gap: 12px; }
.profile-workspace > .workspace__header { padding: 0 2px 8px; border-bottom: 0; }
.profile-workspace > .workspace__header h2 { margin: 0; font-size: clamp(1.65rem, 7vw, 2rem); }
.profile-header { display: flex; align-items: center; justify-content: space-between; }
.profile-section { padding: 18px; border-radius: 18px; }
.profile-section > h3 { margin-bottom: 14px; font-size: 1.2rem; }
.profile-summary {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 14px 18px;
  padding: 20px;
  border-color: #c9dced;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(23, 84, 145, .08);
}
.profile-summary__avatar {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  overflow: visible;
  border-radius: 50%;
  background: var(--app-blue-soft);
  color: var(--app-blue);
}
.profile-summary__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-summary__avatar.is-clickable { cursor: pointer; }
.profile-summary__avatar.is-clickable:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-blue) 35%, transparent); outline-offset: 3px; }
.profile-summary__avatar .app-icon { width: 48px; height: 48px; }
.profile-summary__avatar > .profile-summary__camera {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 8px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--app-card) !important;
  color: var(--app-blue) !important;
  box-shadow: 0 4px 12px rgba(20, 63, 105, .18) !important;
}
.profile-summary__avatar > .profile-summary__camera .app-icon { width: 20px; height: 20px; }
.profile-summary__info { display: grid; min-width: 0; gap: 6px; }
.profile-summary__info > strong { font-size: 1.35rem; overflow-wrap: anywhere; }
.profile-summary__rating { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.profile-summary__rating > strong { font-size: 2rem; line-height: 1; }
.profile-summary__rating > span:not(.profile-summary__rating-count) { color: #f2a900; font-size: 1.35rem; letter-spacing: 1px; }
.profile-summary__rating-count { flex-basis: 100%; color: var(--app-muted); font-size: .9rem; }
.profile-region__row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; }
.profile-region__row > .app-icon { width: 28px; height: 28px; color: var(--app-blue); }
.profile-region__control { min-width: 0; }
.profile-region__control .select-component,
.profile-region__control .select2-container,
.profile-region__control .select2-selection--single { width: 100% !important; }
.profile-region__control .select2-selection--single { height: 48px !important; }
.profile-region__control .select2-selection__rendered { font-weight: 700; line-height: 46px !important; }
.profile-region__control .select2-selection__arrow { height: 46px !important; }
.profile-account { padding: 18px; }
.profile-account > h3 { padding: 0; }
.profile-setting-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px;
  border-right: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
  border-left: 1px solid var(--app-border);
}
.profile-setting-row:first-of-type { border-top: 1px solid var(--app-border); border-radius: 12px 12px 0 0; }
.profile-setting-row:last-child { border-radius: 0 0 12px 12px; }
.profile-setting-row__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--app-blue-soft);
  color: var(--app-blue);
}
.profile-setting-row__icon .app-icon { width: 25px; height: 25px; }
.profile-setting-row__text { display: grid; min-width: 0; gap: 4px; }
.profile-setting-row__text > strong,
.profile-setting-row__text > a { color: var(--app-text); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; text-underline-offset: 3px; }
.profile-setting-row__text > p { margin: 0; color: var(--app-muted); font-size: .9rem; line-height: 1.35; }
.profile-setting-row > .btn { margin: 0; }
.avatar-preview-modal .buttons:empty { display: none; }
.avatar-preview-modal .modal-body { padding: 0; }
.avatar-preview { position: relative; display: grid; max-height: min(82vh, 760px); place-items: center; overflow: hidden; border-radius: inherit; background: #05080c; }
.avatar-preview img { display: block; max-width: 100%; max-height: min(82vh, 760px); object-fit: contain; }
.avatar-preview__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}
.avatar-preview__actions > .avatar-preview__action {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px;
  padding: 10px !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, #16191f 78%, transparent) !important;
  backdrop-filter: blur(8px);
}
.avatar-preview__replace { border-color: color-mix(in srgb, #4f7cff 45%, transparent) !important; color: #8fb0ff !important; }
.avatar-preview__delete { border-color: color-mix(in srgb, #e12c45 45%, transparent) !important; color: #ff7185 !important; }
.avatar-preview__action .app-icon { width: 22px; height: 22px; }
.avatar-delete-confirm { display: grid; gap: 12px; min-width: 240px; padding: 4px; }
.avatar-delete-confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }
.avatar-delete-confirm__submit { background: #e12c45 !important; color: #fff !important; }
.profile-vehicles .profile-vehicle {
  grid-template-areas:
    'title details'
    'edit remove';
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
}
.profile-vehicle > strong { grid-area: title; align-self: center; }
.profile-vehicle > span { grid-area: details; align-self: center; text-align: right; overflow-wrap: anywhere; }
.profile-vehicle__edit { grid-area: edit; }
.profile-vehicle__edit { color: var(--app-blue) !important; }
.profile-vehicle__remove { grid-area: remove; background: #fff0f2 !important; color: #e12c45 !important; }
.profile-vehicle__edit .app-icon,
.profile-vehicle__remove .app-icon { width: 18px; height: 18px; }
.profile-vehicle__add { width: 100%; }
.profile-vehicle__add .app-icon { width: 22px; height: 22px; }
.profile-notification-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 14px; }
.profile-notifications .toggle-wrapper { justify-content: space-between; width: 100%; }
.profile-administration > .btn {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--app-text) !important;
  text-align: left;
  box-shadow: none !important;
}
.profile-administration > .btn > .app-icon:first-child { width: 48px; height: 48px; padding: 11px; border-radius: 50%; background: var(--app-blue-soft); color: var(--app-blue); }
.profile-administration > .btn > .app-icon:last-child { width: 22px; height: 22px; color: var(--app-muted); }
#status { min-height: 24px; margin-top: 16px; color: var(--app-muted); text-align: center; }
.legal-gate { margin: 24px 0 0; padding: 20px; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-card); }
.legal-gate h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 6vw, 2rem); }
.legal-gate > p { color: var(--app-muted); line-height: 1.55; }
.legal-gate__links { display: grid; gap: 8px; margin: 20px 0; }
.legal-gate__links a { color: var(--app-blue); text-underline-offset: 3px; }
.legal-gate__document { display: grid; gap: 4px; }
.legal-gate__document span { color: var(--app-muted); font-size: .9rem; line-height: 1.45; }
.legal-gate .checkbox-wrapper { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; line-height: 1.45; }
.legal-gate > .btn { width: 100%; margin-top: 16px; }

.sso-auth-modal .modal-full {
  width: min(720px, calc(100vw - 24px));
  height: min(760px, calc(100dvh - 24px));
  overflow: hidden;
}
.sso-auth-modal .modal-body { display: flex; min-height: 0; padding: 0; }
.sso-auth-modal .buttons:empty { display: none; }
.sso-auth { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.sso-auth__frame { display: block; flex: 1; width: 100%; min-height: 560px; border: 0; }
.sso-auth__error { margin: 0; padding: 8px 16px; color: #a13333; font-size: 13px; }
.sso-auth__error:empty { display: none; }

@media (max-width: 720px) {
  .sso-auth-modal { align-items: stretch; justify-content: flex-start; }
  .sso-auth-modal .modal-full { width: 100vw; height: 100dvh; max-width: none; max-height: none; }
  .sso-auth__frame { min-height: 0; }
  .profile-account__link-row { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
  .profile-account__link-row > .profile-setting-row__icon { grid-row: 1 / span 2; }
  .profile-account__link-row > .btn { grid-column: 2; width: fit-content; max-width: 100%; white-space: normal; }
}

@media (max-width: 520px) {
  .profile-workspace { gap: 10px; }
  .profile-section { padding: 16px; border-radius: 16px; }
  .profile-summary { grid-template-columns: 86px minmax(0, 1fr); gap: 12px 14px; padding: 16px; }
  .profile-summary__avatar { width: 86px; height: 86px; }
  .profile-summary__info > strong { font-size: 1.15rem; }
  .profile-summary__rating > strong { font-size: 1.75rem; }
  .profile-summary__rating > span:not(.profile-summary__rating-count) { font-size: 1.2rem; letter-spacing: 0; }
  .profile-setting-row { align-items: center; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
  .profile-setting-row__icon { width: 42px; height: 42px; }
  .profile-setting-row > .btn { max-width: 45%; white-space: normal; }
  .profile-account__link-row > .btn { max-width: 100%; }
  .profile-vehicle > span { font-size: .82rem; }
}

.workspace { display: grid; gap: 14px; }
.workspace__header { padding-bottom: 14px; border-bottom: 1px solid var(--app-border); }
.workspace__header h2, .panel h3 { margin: 0 0 6px; }
.workspace__header p, .empty { margin: 0; color: var(--app-muted); }
.panel { padding: 18px; border: 1px solid var(--app-border); border-radius: 14px; background: var(--app-card); }
.panel.trip-form { padding: 0; border: 0; border-radius: 0; }
.panel > .btn { margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.locality-coverage-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin: 0 0 16px; }
.locality-coverage-fields > h3 { grid-column: 1 / -1; margin: 0; }
.locality-coverage { min-width: 0; }
.locality-coverage__result { margin: 6px 0 0; color: var(--app-muted); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.route-fields, .recurring-fields { display: grid; gap: 12px; margin-bottom: 14px; }
.address-field { position: relative; min-width: 0; }
.address-field__map-hint {
  margin: 6px 0 0;
  color: #8f2525;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
[data-theme="dark"] .address-field__map-hint { color: #f08b8b; }
.address-field.has-location-action .autocomplete input { padding-right: 112px; }
.address-field__location {
  position: absolute !important;
  z-index: 3;
  top: 30px;
  right: 5px;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 7px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
  box-shadow: 0 2px 6px rgba(34, 88, 150, .18) !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.address-field__location:hover { background: rgba(47, 111, 237, .18) !important; }
.address-field__location:active { transform: scale(.92); }
.address-field__location .app-icon { width: 20px; height: 20px; }
.route-address-field .address-field__location { top: 7px; right: 46px; }
.route-address-field.has-location-action .autocomplete input { padding-right: 112px; }
.route-address-field.has-location-action .route-address-field__search { right: 86px; }
.route-address-field.has-location-action .route-address-field__clear { right: 6px; }
.address-location-popover { max-width: min(280px, calc(100vw - 24px)); }
.route-editor { display: grid; gap: 0; margin-bottom: 14px; }
.route-editor__controls {
  position: relative;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-card);
}
.route-editor .route-sortable { position: relative; width: 100%; padding-right: 0; }
.route-editor.is-simple .route-sortable { padding-right: 46px; }
.route-editor.is-simple .sortable-list__handle { display: none; }
.route-editor .sortable-list__items { gap: 12px; }
.route-editor .msweb-ui.route-sortable .sortable-list__item {
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.route-editor .msweb-ui.route-sortable .sortable-list__content { order: 1; }
.route-editor .msweb-ui.route-sortable .sortable-list__handle {
  order: 2;
  flex-basis: 28px;
  width: 28px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  font-size: 22px;
}
.route-editor .sortable-list__handle > span { display: none; }
.route-editor .sortable-list__handle::before { content: '≡'; font-size: 21px; font-weight: 500; }
.route-point { display: grid; width: 100%; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.route-point__indicator {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--route-point-color, #515356);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.route-point.is-waypoint { grid-template-columns: 16px minmax(0, 1fr) 30px; }
.route-point.is-waypoint .route-point__indicator { border-radius: 4px; }
.route-point__remove {
  width: 30px !important;
  min-width: 30px !important;
  height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--app-muted) !important;
  box-shadow: none !important;
}
.route-point__remove[hidden] { display: none !important; }
.route-address-field { position: relative; width: 100%; }
.route-address-field .autocomplete input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #f3f3f5;
  color: var(--app-text);
  font-weight: 650;
  box-shadow: none;
  padding-right: 84px;
}
.route-address-field .autocomplete input:focus {
  outline: 2px solid var(--app-blue);
  outline-offset: 0;
  background: var(--app-card);
}
.route-address-field .autocomplete__list { z-index: 12; }
.route-address-field__search {
  position: absolute !important;
  z-index: 2;
  top: 7px;
  right: 46px;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 8px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
  box-shadow: 0 2px 6px rgba(34, 88, 150, .18) !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.route-address-field__search:disabled { background: rgba(82, 101, 122, .1) !important; color: var(--app-muted) !important; opacity: 1; }
.route-address-field__search:not(:disabled):hover { background: var(--app-blue-soft) !important; }
.route-address-field__search:not(:disabled):active { transform: scale(.92); }
.route-address-field__clear {
  position: absolute !important;
  z-index: 2;
  top: 7px;
  right: 6px;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 9px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(34, 88, 150, .18) !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.route-address-field__clear:disabled { background: rgba(82, 101, 122, .1) !important; color: var(--app-muted) !important; opacity: 1; }
.route-address-field__clear:not(:disabled):hover { background: rgba(47, 111, 237, .18) !important; color: var(--app-blue) !important; }
.route-address-field__clear:not(:disabled):active { transform: scale(.92); }
.route-editor__swap {
  position: absolute !important;
  top: 35px;
  right: 0;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 7px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--app-blue-soft) !important;
  color: var(--app-blue) !important;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(34, 88, 150, .18) !important;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.route-editor__swap:hover { background: rgba(82, 101, 122, .16) !important; color: var(--app-text) !important; }
.route-editor__swap:active { transform: scale(.92); }
.route-editor__actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; }
.route-editor__action { padding: 4px 0 !important; border: 0 !important; background: transparent !important; color: var(--app-blue) !important; box-shadow: none !important; }
.route-reset-confirm { display: grid; gap: 12px; min-width: 220px; padding: 4px; }
.route-reset-confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }
.route-map-marker {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 30px;
  height: 36px;
  padding-top: 11px;
  box-sizing: border-box;
  place-items: start center;
  border: 0;
  background: transparent;
  color: #fff;
  font: 800 10px/1 system-ui, sans-serif;
}
.route-map-marker::before {
  position: absolute;
  z-index: -1;
  top: 6px;
  left: 3px;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--route-point-color, #515356);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .28);
  content: '';
  transform: rotate(-45deg);
}
.route-map-shell { position: relative; margin-top: 8px; }
.address-picker-map { width: 100%; height: 260px; border: 1px solid var(--app-border); border-radius: 10px; overflow: hidden; background: #e7edf2; }
.route-map-shell > .msweb-toast-container {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: auto;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 20px);
  transform: translateX(-50%);
}
.route-map-shell .msweb-toast {
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}
.trip-datetime-fields { margin-bottom: 14px; }
.trip-regular-toggle { margin-bottom: 14px; }
.trip-auto-accept { margin-top: 18px; }
.trip-publish-button {
  display: flex !important;
  width: fit-content;
  margin: 18px 0 0 auto;
}
.vehicle-picker, .weekdays { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.vehicle-picker__text { margin: 0; color: var(--app-text); font-weight: 700; }
.vehicle-picker__current {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--app-text) !important;
  font-weight: 700;
  text-align: left;
  box-shadow: none !important;
}
.vehicle-picker__menu { display: grid; gap: 4px; }
.vehicle-picker__option { justify-content: flex-start; width: 100%; border: 0 !important; box-shadow: none !important; }
.vehicle-picker__option.is-active { background: var(--app-blue-soft) !important; color: var(--app-blue) !important; }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--app-border); }
.result-card:last-child { border-bottom: 0; }
.result-card span { color: var(--app-muted); }
.result-card__comment { grid-column: 1 / -1; white-space: pre-wrap; }
.upcoming .result-card:not(.trip-card) {
  grid-template-areas:
    'route time'
    'status meta'
    'comment comment';
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-card);
}
.upcoming .result-card:not(.trip-card):last-child { border-bottom: 1px solid var(--app-border); }
.upcoming .result-card:not(.trip-card) > strong { grid-area: route; line-height: 1.35; }
.upcoming .result-card:not(.trip-card) > span:nth-of-type(1) { grid-area: time; align-self: start; white-space: nowrap; }
.upcoming .result-card:not(.trip-card) > span:nth-of-type(2) {
  grid-area: status;
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--app-blue-soft);
  color: var(--app-blue);
  font-size: .85rem;
}
.upcoming .result-card:not(.trip-card) > span:nth-of-type(3) { grid-area: meta; text-align: right; }
.upcoming .result-card:not(.trip-card) > .result-card__comment { grid-area: comment; }
.upcoming .trip-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-card);
  font-size: .9rem;
}
.upcoming .trip-card:last-child { border-bottom: 1px solid var(--app-border); }
.trip-card__route { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.trip-card__route-points {
  position: relative;
  min-height: 64px;
  background: repeating-linear-gradient(to bottom, var(--app-muted) 0 3px, transparent 3px 8px) center 17px / 2px calc(100% - 34px) no-repeat;
}
.trip-card__route-points::before {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 3px solid var(--app-blue);
  border-radius: 50%;
  content: '';
  transform: translateX(-50%);
}
.trip-card__route-points::before { top: 4px; background: var(--app-card); }
.trip-card__route-points > .app-icon { position: absolute; bottom: 1px; left: 50%; width: 18px; height: 18px; color: var(--app-blue); transform: translateX(-50%); }
.trip-card__route-labels { display: grid; gap: 12px; min-width: 0; }
.trip-card__route-labels strong { overflow-wrap: anywhere; line-height: 1.35; }
.trip-card__time { display: flex; align-items: center; gap: 10px; color: var(--app-muted); }
.trip-card__time .app-icon { width: 22px; height: 22px; flex: none; }
.trip-card__summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--app-border);
}
.trip-card__status { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--app-blue-soft); color: var(--app-blue); }
.trip-card__status.is-success { background: var(--app-green-soft); color: var(--app-green-dark); }
.trip-card__meta { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--app-muted); font-size: 1rem; white-space: nowrap; }
.trip-card__meta .app-icon { width: 22px; height: 22px; flex: none; }
.trip-card__companion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--app-border);
}
.trip-card__avatar { display: grid; width: 46px; min-width: 46px; height: 46px; padding: 0; place-items: center; overflow: hidden; border: 0; border-radius: 50%; background: var(--app-blue-soft); color: var(--app-blue); cursor: pointer; }
.trip-card__avatar:disabled { cursor: default; }
.trip-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.trip-card__avatar .app-icon { width: 25px; height: 25px; }
.trip-card__identity { display: grid; gap: 2px; min-width: 0; }
.trip-card__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-card__identity span { color: var(--app-muted); font-size: .86rem; }
.trip-card > .result-card__comment { color: var(--app-muted); }
.trip-card__action { width: 44px !important; min-width: 44px; height: 44px; padding: 0 !important; border-radius: 12px !important; }
.trip-card__action .app-icon { width: 22px; height: 22px; }
.trip-card__action--contact {
  border-color: color-mix(in srgb, var(--app-blue) 45%, var(--app-border)) !important;
  background: color-mix(in srgb, var(--app-blue) 16%, var(--app-card)) !important;
  color: var(--app-blue) !important;
}
.trip-card__action--menu {
  border-color: var(--app-border) !important;
  background: color-mix(in srgb, var(--app-muted) 12%, var(--app-card)) !important;
  color: var(--app-muted) !important;
  font-size: 1.45rem;
  line-height: 1;
}
.trip-contact-menu { display: grid; gap: 4px; min-width: 190px; }
.trip-contact-menu > .msweb-ui.btn { width: 100%; justify-content: flex-start; box-shadow: none !important; }
.trip-companion-menu { display: grid; gap: 4px; min-width: 190px; }
.trip-companion-menu__item { width: 100%; justify-content: flex-start !important; border: 0 !important; box-shadow: none !important; }
.trip-card__rating { color: #e7aa22 !important; font-weight: 700; }
.trip-rating-dialog { display: grid; gap: 16px; text-align: center; }
.trip-rating-dialog p { margin: 0; }
.trip-rating-dialog__stars { display: flex; justify-content: center; gap: 4px; }
.trip-rating-dialog__star {
  width: 52px !important;
  min-width: 52px;
  height: 52px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--app-muted) !important;
  font-size: 2.75rem !important;
  line-height: 1;
}
.trip-rating-dialog__star.is-selected { color: #e7aa22 !important; }
.offer-card { position: relative; grid-template-columns: minmax(0, 1fr); align-items: stretch; padding-right: 42px; }
.offer-card > strong,
.offer-card > span { min-width: 0; overflow-wrap: anywhere; }
.offer-card > .msweb-ui.btn,
.offer-card > .form-field,
.offer-card > .input-component { width: 100%; min-width: 0; }
.offer-card > .offer-card__safety {
  position: absolute;
  top: 12px;
  right: 0;
  width: 30px !important;
  min-width: 30px;
  min-height: 30px;
  padding: 0 !important;
  border-radius: 50%;
  font-weight: 800;
}
.offer-safety { display: grid; gap: 12px; }
.offer-safety > .msweb-ui.btn { width: 100%; }
.contact-privacy-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--app-muted);
  font-size: .86rem;
  line-height: 1.4;
}
.match-points__map { width: 100%; height: min(56vh, 440px); border-radius: 12px; overflow: hidden; }
.address-report-form { display: grid; gap: 12px; }
.manual-address { margin-top: 8px; }
.manual-address__toggle,
.optional-comment__toggle {
  width: auto !important;
  min-height: 0 !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--app-blue) !important;
}
.manual-address__fields { display: grid; grid-template-columns: 1fr 1fr minmax(90px, .5fr); gap: 10px; margin-top: 8px; }
.manual-address__save { align-self: end; }
.optional-comment { margin-top: 10px; }
.optional-comment > div { margin-top: 8px; }
.optional-comment .textarea-component textarea { min-height: 112px; resize: vertical; }
.status { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; }
.status:not(:empty) { padding: 11px 14px; border: 1px solid #cbdff5; border-radius: 10px; background: var(--app-blue-soft); color: #174f88; }
.status--error:not(:empty) { border-color: #edcccc; background: #fff1f1; color: #982727; }
.status--success:not(:empty) { border-color: #cce1d4; background: var(--app-green-soft); color: var(--app-green-dark); }
.route-preview { margin-top: 16px; }
.route-preview__summary { margin: 0 0 10px; color: var(--app-muted); font-weight: 650; }
.route-map-shell + .route-preview__summary { margin: 10px 0 0; }
.route-preview__map { width: 100%; height: 320px; border: 1px solid var(--app-border); border-radius: 10px; overflow: hidden; background: #e7edf2; }

@media (max-width: 520px) {
  .app-shell { padding-right: 15px; padding-left: 15px; }
  .action-card { padding: 18px 16px; gap: 12px; }
  .action-card p { max-width: 210px; }
  .form-grid, .result-card, .locality-coverage-fields { grid-template-columns: 1fr; }
  .upcoming .result-card:not(.trip-card) {
    grid-template-areas:
      'route route'
      'time time'
      'status meta'
      'comment comment';
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
  }
  .upcoming .result-card:not(.trip-card) > span:nth-of-type(1) { white-space: normal; }
  .upcoming .trip-card { gap: 14px; padding: 16px; }
  .trip-card__summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
  .trip-card__status { padding: 7px 10px; }
  .trip-card__meta { gap: 5px; min-width: 0; padding: 0; font-size: clamp(.72rem, 3.25vw, .82rem); line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .trip-card__meta .app-icon { width: 18px; height: 18px; }
  .trip-card__companion { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .trip-card__avatar { width: 42px; height: 42px; }
  .manual-address__fields { grid-template-columns: 1fr; }
  .trip-publish-button { margin-right: auto; margin-left: auto; }
  .route-preview__map { height: 240px; }
}

@media (max-width: 360px) {
  .action-card { grid-template-columns: minmax(0, 1fr) auto; }
  .action-card__icon { display: none; }
}

@media (min-width: 760px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border: 1px solid var(--app-border); border-radius: 22px; box-shadow: 0 18px 50px rgba(23, 52, 78, .08); }
  .app-nav { bottom: 0; border: 1px solid var(--app-border); border-radius: 0 0 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

[data-theme="dark"] .region-control > .app-icon { color: #69adf4; }
[data-theme="dark"] .region-control .select-component,
[data-theme="dark"] .region-control .select2-container .select2-selection--single {
  border-color: var(--app-border) !important;
  background: #132238 !important;
}
[data-theme="dark"] .action-card--driver { border-color: #24523f; }
[data-theme="dark"] .action-card--passenger { background: #155fae; }
[data-theme="dark"] .upcoming-card { border-color: var(--app-border); background: #132238; }
[data-theme="dark"] .upcoming-card p .app-icon,
[data-theme="dark"] .upcoming-card__open { color: #69adf4 !important; }
[data-theme="dark"] .app-nav { background: rgba(16, 28, 45, .97); }
[data-theme="dark"] .app-nav .app-nav__item { color: #9eafc3 !important; }
[data-theme="dark"] .app-nav .app-nav__item--active { color: #69adf4 !important; }
[data-theme="dark"] .status:not(:empty) { border-color: #315a85; color: #cfe6ff; }
[data-theme="dark"] .status--error:not(:empty) { border-color: #743b45; background: #381c24; color: #ffb8c1; }
[data-theme="dark"] .status--success:not(:empty) { border-color: #285b45; color: #a7ebc8; }
[data-theme="dark"] .address-picker-map,
[data-theme="dark"] .route-preview__map { background: #172334; }
[data-theme="dark"] .route-address-field .autocomplete input { background: #242c3c; }
[data-theme="dark"] .route-address-field .autocomplete input:focus { background: #182235; }
[data-theme="dark"] .app-shell { box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
