:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #687382;
  --line: #d9e0e8;
  --panel: #ffffff;
  --page: #f3f6f8;
  --accent: #14746f;
  --accent-strong: #0b5956;
  --warn: #a85b13;
  --danger: #b92d20;
  --ok: #247a3d;
  --shadow: 0 16px 36px rgba(24, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

/* Запрет горизонтальной прокрутки. clip (в отличие от hidden) не ломает position: sticky. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.mobile-only {
  display: none;
}

.nav-overlay {
  display: none;
}

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  background-position: -40% 0;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

body.is-loading .page-loader {
  opacity: 1;
  animation: page-loader-slide 1s linear infinite;
}

/* Крутящийся кружок по центру экрана при сохранении (скрыть/изменить/закрыть и т.д.).
   Появляется плавно и только если сохранение длится дольше ~0.35 с — короткие не мигают. */
.action-spinner {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

body.is-loading .action-spinner {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease 0.35s, visibility 0s linear 0.35s;
}

.action-spinner::after {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(15, 90, 80, 0.15);
  border-top-color: var(--accent);
  animation: action-spinner-spin 0.8s linear infinite;
}

@keyframes action-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Модальные окна рисуются поверх оверлея, поэтому кружок дублируем внутри открытой модалки */
body.is-loading dialog[open] {
  pointer-events: none;
}

body.is-loading dialog[open]::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  border: 3px solid rgba(15, 90, 80, 0.15);
  border-top-color: var(--accent);
  opacity: 0;
  animation: action-spinner-spin 0.8s linear infinite, action-spinner-fade 0.25s ease 0.35s forwards;
  z-index: 10;
}

@keyframes action-spinner-fade {
  to {
    opacity: 1;
  }
}

@keyframes page-loader-slide {
  0% {
    background-position: -40% 0;
  }
  100% {
    background-position: 140% 0;
  }
}

.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.profile-danger-zone {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-delete-account-button {
  appearance: none;
  cursor: pointer;
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
}

.profile-delete-account-button:hover {
  background: var(--danger);
  color: #fff;
}

.profile-delete-account-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted, #6b7785);
  line-height: 1.4;
}

.user-moderation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ghost-button.report-link,
.ghost-button.block-link {
  appearance: none;
  cursor: pointer;
  width: auto;
  flex: 0 0 auto;
  text-align: center;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* «Пожаловаться» — заметная, но второстепенная по отношению к оранжевому CTA */
.ghost-button.report-link {
  background: #fdecea;
  border: 1px solid #f1b4ad;
  color: var(--danger);
}

.ghost-button.block-link {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted, #687382);
}

.ghost-button.report-link:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.ghost-button.block-link:hover { background: #f3f6f8; }

.report-form .report-target-summary {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--ink);
}

.preferred-routes-page {
  display: grid;
  gap: 16px;
}

.preferred-routes {
  display: grid;
  gap: 12px;
  width: min(100%, 760px);
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.preferred-routes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.preferred-routes-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.preferred-routes-head small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.preferred-routes-counter {
  border-radius: 999px;
  background: #eef3f6;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.preferred-routes-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preferred-route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 8px 12px;
}

.preferred-route-text {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.icon-button.preferred-route-remove {
  width: 32px;
  min-height: 32px;
  background: #fdecea;
  border: 1px solid #f3b4ae;
  color: #d93025;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.icon-button.preferred-route-remove:hover {
  background: #d93025;
  border-color: #d93025;
  color: #fff;
}

.preferred-routes-empty,
.preferred-routes-limit {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.preferred-route-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.preferred-route-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.preferred-route-form button {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .preferred-route-form {
    grid-template-columns: 1fr;
  }
}

.secondary-button.profile-logout-button {
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 38px;
  border-color: #ff4d4f;
  background: #ff4d4f;
  color: #fff;
  font-weight: 850;
  line-height: 1;
}

.secondary-button.profile-logout-button:hover {
  border-color: #ff2d30;
  background: #ff2d30;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  background: #18202a;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: 110px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 3px 6px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.brand > div {
  flex: 1 1 auto;
  min-width: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 22px;
  line-height: 1.15;
  white-space: nowrap;
}

.brand span {
  color: #b8c2cf;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link,
.ghost-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: #dce4ed;
  text-align: left;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link.active,
.nav-link:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-notification-link .notification-count {
  margin-left: auto;
}

/* Иконки в пунктах меню */
.nav-link-icon {
  display: block;
  flex: 0 0 auto;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  color: #c5cfda;
}

.mini-stat strong {
  color: #fff;
  font-size: 24px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 28px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar h1,
.auth-copy h2,
.modal h2,
.empty-state h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 750;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button[data-create="load"] {
  background: #d64541;
}

.primary-button[data-create="load"]:hover {
  background: #c13632;
}

.primary-button.btn-vehicle {
  background: #1f3a6e;
}

.primary-button.btn-vehicle:hover {
  background: #182e57;
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #abb7c4;
}

.secondary-button[data-action="open-vehicle-form"] {
  background: #1f3a6e;
  border-color: #1f3a6e;
  color: #fff;
}

.secondary-button[data-action="open-vehicle-form"]:hover {
  background: #182e57;
  border-color: #182e57;
}

/* Кнопка «Скрыть с биржи» — мягкий янтарный (пауза, не опасно) */
button[data-action="pause-load"],
button[data-action="pause-vehicle-ad"] {
  background: #fff7e6;
  border-color: #f0d9a8;
  color: var(--warn);
}

button[data-action="pause-load"]:hover,
button[data-action="pause-vehicle-ad"]:hover {
  background: #fdeecb;
  border-color: #e3c27e;
}

/* Кнопка «Показать на бирже» — зелёная (вернуть объявление) */
button[data-action="resume-load"],
button[data-action="resume-vehicle-ad"] {
  background: var(--ok);
  border-color: transparent;
  color: #fff;
}

button[data-action="resume-load"]:hover,
button[data-action="resume-vehicle-ad"]:hover {
  background: #1c6332;
}

/* Кнопки «Закрыть груз» / «Снять объявление» — мягкий красный (необратимое действие) */
button[data-action="close-load"],
button[data-action="close-vehicle-ad"] {
  background: #fdecea;
  border-color: #f3c2bc;
  color: var(--danger);
}

button[data-action="close-load"]:hover,
button[data-action="close-vehicle-ad"]:hover {
  background: #fadbd7;
  border-color: #e8a59d;
}

.notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notification-count {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
  place-items: center;
}

.icon-button {
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
  background: #eef3f6;
  color: var(--ink);
}

.wide {
  width: 100%;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(340px, 420px);
  gap: 28px;
  align-items: stretch;
  max-width: 1120px;
}

.auth-copy {
  display: flex;
  min-height: 440px;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(24, 32, 42, 0.16), rgba(24, 32, 42, 0.84)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.auth-copy .eyebrow {
  color: #f5c568;
}

.auth-copy h2 {
  max-width: 680px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.02;
}

.auth-copy p:last-child {
  max-width: 640px;
  color: #e8edf2;
  font-size: 17px;
  line-height: 1.55;
}

.auth-form,
.modal-body,
.filters,
.vehicle-search,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
}

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

.auth-provider {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  font-weight: 850;
}

.auth-provider.active {
  border-color: var(--accent);
  background: #edf7f6;
  color: var(--accent-strong);
}

.auth-provider.telegram-option {
  border-color: #2aabee;
  background: #eef9ff;
  color: #147fb3;
}

.auth-provider.whatsapp-option {
  border-color: #25d366;
  background: #effff5;
  color: #128c4a;
}

.auth-provider.telegram-option.active {
  background: #2aabee;
  color: #fff;
}

.auth-provider.whatsapp-option.active {
  background: #25d366;
  color: #053b20;
}

.provider-mount {
  display: grid;
  gap: 8px;
}

.dev-login {
  display: grid;
  gap: 12px;
}

.dev-login-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.segment {
  border: 0;
  padding: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.segment.active {
  background: #fff;
  color: var(--ink);
}

label {
  display: grid;
  gap: 7px;
  color: #344150;
  font-size: 14px;
  font-weight: 700;
}

.messenger-fieldset {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.messenger-fieldset legend {
  padding: 0 5px;
  color: #344150;
  font-size: 14px;
  font-weight: 800;
}

.messenger-hint {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
}

.check-option input {
  width: auto;
}

.messenger-option {
  color: #fff;
  font-weight: 850;
}

.messenger-option.whatsapp-option {
  border-color: #25d366;
  background: #25d366;
}

.messenger-option.telegram-option {
  border-color: #2aabee;
  background: #2aabee;
}

.messenger-option.max-option {
  border-color: #6a5bff;
  background: linear-gradient(135deg, #3d7bff, #8a4bff);
}

.messenger-option input {
  accent-color: #0f3d39;
  width: 22px;
  height: 22px;
  transform: scale(1.2);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.country-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.country-filter legend {
  color: #344150;
  font-size: 14px;
  font-weight: 700;
}

.country-dropdown {
  position: relative;
}

.country-dropdown summary {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 44px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.country-dropdown summary::before,
.country-dropdown summary::after {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
  pointer-events: none;
}

.country-dropdown summary::before {
  right: 21px;
  transform: translateY(-50%) rotate(42deg);
}

.country-dropdown summary::after {
  right: 13px;
  transform: translateY(-50%) rotate(-42deg);
}

.country-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: min(280px, 90vw);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.country-options {
  display: grid;
  max-height: 320px;
  gap: 8px;
  overflow-y: auto;
}

.country-options .check-option {
  justify-content: start;
  width: 100%;
  box-shadow: none;
}

.country-options .check-option.disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.country-options .check-option.search-hidden {
  display: none;
}

.country-options .check-option-all {
  font-weight: 700;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12' fill='none'%3E%3Cpath d='M3 3.5L9 8.5L15 3.5' stroke='%23687382' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 14px) 50%;
  background-repeat: no-repeat;
  background-size: 18px 12px;
}

.city-input-control {
  position: relative;
  display: block;
  min-width: 0;
}

.clearable-input-control {
  position: relative;
  display: block;
  min-width: 0;
}

.city-input-control input {
  padding-right: 40px;
  scroll-margin-top: 16px;
}

.clearable-input-control input {
  padding-right: 40px;
}

.city-clear-button,
.field-clear-button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.city-input-control.has-value .city-clear-button,
.clearable-input-control.has-value .field-clear-button {
  opacity: 1;
  pointer-events: auto;
}

.city-clear-button:hover,
.field-clear-button:hover {
  background: #dfe8ef;
  color: var(--ink);
}

.city-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.city-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.city-suggestion:hover {
  background: #edf7f6;
}

.city-suggestion span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-suggestion small {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.price-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr);
  gap: 8px;
}

.currency-pill {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--accent-strong);
  font-weight: 850;
}

textarea {
  resize: vertical;
}

.photo-upload {
  cursor: pointer;
}

.photo-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-upload-box {
  display: grid;
  min-height: 112px;
  place-items: center;
  gap: 4px;
  border: 1px dashed #abb7c4;
  border-radius: 8px;
  background: #f7fafb;
  color: var(--ink);
  padding: 18px;
  text-align: center;
}

.photo-upload:hover .photo-upload-box {
  border-color: var(--accent);
  background: #edf7f6;
}

.photo-upload-title,
.photo-upload-hint {
  display: block;
}

.photo-upload-title {
  font-weight: 850;
}

.photo-upload-hint {
  color: var(--muted);
  font-size: 13px;
}

.photo-upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.photo-upload-btn:hover {
  background: #edf7f6;
}

.photo-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

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

.photo-preview-grid img {
  aspect-ratio: 4 / 3;
  max-height: none;
  border-radius: 6px;
}

.photo-preview-item {
  position: relative;
  display: block;
}

.photo-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 28, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
}

.photo-preview-remove:hover {
  background: rgba(17, 24, 28, 0.9);
}

.content-grid {
  display: grid;
  gap: 18px;
}

.filters {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 14px;
  align-items: end;
}

/* Когда 5 полей в ряд уже не помещаются: «Страны рейса» занимает всю строку,
   а «Откуда / Куда / Вес / Тип кузова» переносятся на следующий ряд и при
   нехватке места сами переносят «Тип кузова» ниже. */
@media (max-width: 1199px) {
  .filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .filters-grid .country-filter {
    grid-column: 1 / -1;
  }
}

.range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cargo-reset-button {
  min-height: 42px;
  align-self: end;
}

.cargo-filters-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Плашки выбранных стран. На десктопе — по центру в свободном месте
   строки поиска (между «Найдено» и «Сбросить»). На мобильном — отдельной
   строкой по центру под блоком фильтров (как было раньше). */
.cargo-country-badge {
  flex: 1;
  display: flex;
  justify-content: center;
}

.cargo-country-badge:empty {
  display: none;
}

.cargo-country-badge .country-badge-row {
  margin: 0 !important;
}

/* Мобильная копия плашек (внутри viewRoot) — на десктопе скрыта. */
.cargo-country-badge-mobile {
  display: none;
}

@media (max-width: 900px) {
  /* На мобильном прячем вариант внутри строки поиска... */
  .cargo-country-badge {
    display: none;
  }

  /* ...и показываем вариант под фильтрами. */
  .cargo-country-badge-mobile {
    display: block;
  }
}

@media (min-width: 901px) {
  .filters,
  .vehicle-search {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--page);
    padding-top: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
}

.stand-location-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

/* Сетка формы поиска. Контейнеры полей и действий «растворяются»
   (display: contents), поэтому поля, счётчик и кнопка становятся
   прямыми ячейками одной сетки — это даёт точное размещение по рядам. */
.vehicle-search {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

/* Поля переносятся по фактической ширине области (как фильтры на бирже грузов),
   а не по ширине окна — поэтому при узком контенте они не сжимаются. */
.vehicle-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
}

/* Вторая строка: «Найдено» слева, чип «Все страны» рядом, «Сбросить» справа. */
.vehicle-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.vehicle-search .search-count {
  align-self: center;
}

/* Чип «Все страны» — рядом со счётчиком «Найдено»; авто-отступ толкает
   «Сбросить» к правому краю. Пустой чип не ломает выравнивание. */
.vehicle-search #vehicleCountryBadge {
  margin-right: auto;
  align-self: center;
}

.vehicle-search #vehicleCountryBadge:empty {
  margin-right: auto;
}

#vehicleCountryBadge .country-badge-row {
  margin: 0 !important;
  justify-content: flex-start !important;
}

.search-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.vehicle-results {
  display: grid;
  gap: 14px;
}

.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view {
  display: grid;
  /* minmax(0, 1fr) не даёт длинному тексту растянуть колонку шире экрана */
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

body[data-view="notifications"] .site-footer {
  display: none;
}

.footer-brand,
.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-icon-group {
  display: inline-grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
}

.footer-icon-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.footer-icon-group > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-icon-link {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(24, 32, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(24, 32, 42, 0.08);
}

.footer-icon-link img {
  display: block;
  width: 120%;
  height: 120%;
  object-fit: cover;
}

.footer-icon-link svg {
  display: block;
  width: 100%;
  height: 100%;
}

.footer-icon-link.instagram {
  border: 0;
  background: transparent;
}

.footer-icon-link.facebook {
  border: 0;
  background: transparent;
}

.footer-icon-link.email {
  border: 0;
  background: transparent;
}

.footer-brand strong {
  color: var(--ink);
}

.site-footer a {
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-strong);
}

.market-section {
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.load-card,
.offer-card,
.vehicle-card,
.profile-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.load-card,
.vehicle-card {
  overflow: hidden;
  padding: 0;
}

.load-card-button,
.vehicle-card-button {
  display: grid;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  color: inherit;
  padding: 0;
  text-align: left;
}

.load-card-button:hover,
.vehicle-card-button:hover {
  background: #fbfdfe;
}

.load-thumb,
.vehicle-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f7fafb;
}

.load-thumb img,
.vehicle-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.load-compact-body,
.vehicle-compact-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.vehicle-compact-meta {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.load-compact-specs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.load-compact-specs span {
  border-radius: 999px;
  background: #edf4f3;
  color: var(--accent-strong);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.offer-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.load-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  align-items: start;
}

.load-summary {
  display: grid;
  gap: 6px;
}

.load-photo {
  display: grid;
  position: relative;
  overflow: hidden;
  width: 116px;
  aspect-ratio: 4 / 3;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 0;
}

.load-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.load-photo-placeholder {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.route {
  margin: 0;
  font-size: 20px;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.meta,
.description,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.load-card .route {
  font-size: 19px;
}

.load-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.photo-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  background: rgba(24, 32, 42, 0.72);
  color: #fff;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
}

.badge-row,
.card-actions,
.offer-actions,
.stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Статус объявления (Открыт / Скрыт и т.д.) */
.load-status-chip {
  display: inline-block;
  width: fit-content;
  border-radius: 999px;
  background: #eef1f4;
  color: #5b6470;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.load-status-chip.status-ok {
  background: #e6f4ea;
  color: #1e7a44;
}

.load-status-chip.status-warn {
  background: #fff4d6;
  color: #8a6100;
}

.load-status-chip.status-blocked {
  background: #fde2e2;
  color: #b42318;
}

.modal-head .load-status-chip {
  margin-top: 6px;
}

/* На десктопе кнопки в карточке объявления — в один ряд */
@media (min-width: 721px) {
  .load-detail-info .card-actions {
    flex-wrap: nowrap;
  }

  .load-detail-info .card-actions > .primary-button:not(:only-child),
  .load-detail-info .card-actions > .secondary-button:not(:only-child) {
    flex: 1 1 0;
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
  }

  /* Если в ряду есть кнопка «Пожаловаться», не растягиваем основную кнопку
     во всю ширину — она становится по содержимому, ряд выравнивается влево. */
  .load-detail-info .card-actions:has(.report-link) {
    justify-content: flex-start;
  }
  .load-detail-info .card-actions:has(.report-link) > .primary-button,
  .load-detail-info .card-actions:has(.report-link) > .secondary-button {
    flex: 0 1 auto;
    min-width: 220px;
  }
}

.badge {
  border-radius: 999px;
  background: #edf4f3;
  color: var(--accent-strong);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff1dd;
  color: var(--warn);
}

.badge.ok {
  background: #e8f5ec;
  color: var(--ok);
}

.price {
  white-space: nowrap;
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 850;
}

.offer-card {
  display: grid;
  gap: 12px;
}

.offer-vehicle-photos {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.offer-vehicle-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #e9eef3;
  flex-shrink: 0;
}

.offer-vehicle-label {
  font-size: 0.85em;
  color: var(--muted);
}

.vehicle-photo {
  min-height: 0;
  background: #e9eef3;
}

.vehicle-detail-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  aspect-ratio: 16 / 10;
}

.vehicle-photo img,
.vehicle-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #e71486 0%, #7c22b8 100%);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.vehicle-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.vehicle-body header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.contact-strip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 10px 12px;
}

.contact-strip strong {
  overflow-wrap: anywhere;
}

.contact-strip span {
  color: var(--muted);
  font-size: 13px;
}

.contact-strip strong {
  min-width: 0;
}

.contact-strip a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.locked-contact {
  background: #fff8e8;
  border-color: #f0c46a;
}

.locked-contact strong {
  color: #6f5520;
}

.locked-contact .secondary-button {
  min-height: 36px;
  padding: 8px 12px;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phone-links {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.phone-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
}

.phone-link.muted {
  color: var(--muted);
  font-weight: 800;
}

.messenger-links {
  display: inline-flex;
  gap: 6px;
}

.user-link {
  cursor: pointer;
}

.contact-strip .user-link,
.vehicle-compact-meta .user-link {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.user-public-contacts {
  display: grid;
  gap: 12px;
}

.user-profile-vehicles {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}

.user-profile-vehicle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f7fafb;
}

.user-profile-vehicle-photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vehicle-photo-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  display: block;
}

.user-public-locked {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.messenger-link {
  display: inline-grid;
  overflow: hidden;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(24, 32, 42, 0.08);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(24, 32, 42, 0.12);
  text-decoration: none;
}

.messenger-link img {
  display: block;
  width: 118%;
  height: 118%;
  object-fit: cover;
}

.primary-button[data-action="offer"] {
  background: linear-gradient(135deg, #ff8a00 0%, #f05a28 100%);
  box-shadow: 0 10px 20px rgba(240, 90, 40, 0.24);
}

.primary-button[data-action="offer"]:hover {
  background: linear-gradient(135deg, #ff9a18 0%, #e94f20 100%);
}

.vehicle-card .contact-strip {
  grid-template-columns: 1fr;
}

.load-card .contact-strip {
  grid-template-columns: 1fr;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.status-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.status-cell span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.status-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}

.profile-panel {
  display: grid;
  gap: 18px;
}

.notifications-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.notifications-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.notifications-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.notifications-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.notifications-head > span {
  border-radius: 999px;
  background: #edf7f6;
  color: var(--accent-strong);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.notifications-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 12px;
  padding-right: 48px;
}

.icon-button.notification-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  min-height: 28px;
  background: #fdecea;
  border: 1px solid #f3b4ae;
  color: #d93025;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.icon-button.notification-delete:hover {
  background: #d93025;
  border-color: #d93025;
  color: #fff;
}

.chat-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-alerts-head h3 {
  margin: 0;
}

.secondary-button.chat-alerts-clear {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
  color: #d93025;
  border-color: #f3b4ae;
}

.secondary-button.chat-alerts-clear:hover {
  background: #fdecea;
  border-color: #e8a59d;
}

.notification-card.unread {
  border-color: #b7dfdb;
  background: #f0fbfa;
}

.notification-card span {
  display: block;
  color: var(--ink);
  font-weight: 900;
}

.notification-card p {
  margin: 5px 0;
  color: #344150;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-card,
.conversation-card {
  min-width: 0;
  max-width: 100%;
}

.notification-card small {
  color: var(--muted);
}

.profile-user-form {
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.profile-user-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 560px;
}

.profile-phone-manager {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.profile-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-phone-head span {
  display: block;
  color: #344150;
  font-size: 14px;
  font-weight: 850;
}

.profile-phone-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.profile-extra-phones {
  display: grid;
  gap: 8px;
}

.profile-phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
}

.profile-phone-remove {
  border-color: #f1c3bd;
  background: #fff3f1;
  color: var(--danger);
}

.profile-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.profile-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 800;
}

.profile-tab.active {
  border-color: var(--accent);
  background: #edf7f6;
  color: var(--accent-strong);
}

.profile-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-subtab {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}

.profile-subtab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.profile-subtab strong {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  background: #eef3f6;
  color: var(--muted);
  font-size: 13px;
  place-items: center;
}

.profile-subtab.active {
  border-color: var(--accent);
  background: #edf7f6;
  color: var(--accent-strong);
}

.profile-subtab.active strong {
  background: var(--accent);
  color: #fff;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 560px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.stat span,
.profile-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.profile-line {
  display: grid;
  gap: 3px;
}

.profile-line strong {
  font-size: 17px;
}

.profile-registration-date {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.profile-messenger-form {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.profile-user-form .messenger-fieldset {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  background: #fff;
}

.profile-messenger-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.profile-messenger-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.profile-messenger-row .messenger-option {
  min-height: 42px;
  justify-content: center;
}

.profile-messenger-phone {
  min-width: 0;
}

.profile-user-form .profile-save-button {
  border-color: #339cff;
  background: #339cff;
  color: #fff;
  justify-self: start;
  min-height: 52px;
  padding: 14px 30px;
  font-size: 17px;
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(51, 156, 255, 0.22);
}

.profile-user-form .profile-save-button:hover {
  border-color: #1f86e6;
  background: #1f86e6;
}

.profile-add-phone-button {
  border-color: #14746f;
  background: #14746f;
  color: #fff;
  justify-self: start;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(20, 116, 111, 0.18);
}

.profile-add-phone-button:hover {
  border-color: #0f5b57;
  background: #0f5b57;
}

.profile-section {
  display: grid;
  gap: 12px;
}

.profile-section + .profile-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-section-head h2 {
  margin: 0;
  font-size: 20px;
}

.profile-section-head span {
  display: inline-grid;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  background: #edf7f6;
  color: var(--accent-strong);
  font-weight: 900;
  place-items: center;
}

.rating-badge,
.load-compact-specs span.rating-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  background: #fff4d6;
  color: #e6a700;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
}

.rating-badge-new,
.load-compact-specs span.rating-badge-new {
  background: #eef1f4;
  color: #5b6470;
}

.rating-badge-frozen,
.load-compact-specs span.rating-badge-frozen {
  background: #fff0f0;
  color: #c0392b;
}

.load-compact-specs span.load-status-chip {
  margin-left: auto;
  background: #eef1f4;
  color: #5b6470;
}

.load-compact-specs span.load-status-chip.status-ok {
  background: #e6f4ea;
  color: #1e7a44;
}

.load-compact-specs span.load-status-chip.status-warn {
  background: #fff4d6;
  color: #8a6100;
}

.review-sent {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.review-target {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 11px 12px;
  color: var(--accent-strong);
  font-weight: 850;
}

.form-message {
  margin: 0;
  border: 1px solid #cfe0e5;
  border-radius: 8px;
  background: #f3faf9;
  color: var(--accent-strong);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.form-message.error {
  border-color: #f0c46a;
  background: #fff8e8;
  color: #6f5520;
}

.review-tags-fieldset {
  align-items: center;
}

.profile-reviews {
  display: grid;
  gap: 12px;
  max-width: 560px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.profile-reviews-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-reviews-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-reviews-head strong {
  color: #e6a700;
  font-size: 18px;
}

.review-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.review-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-card-head strong {
  color: #e6a700;
}

.stat-rating strong {
  color: #e6a700;
}

.review-card-head span,
.review-card small {
  color: var(--muted);
  font-size: 12px;
}

.review-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-tags span {
  border-radius: 999px;
  background: #edf4f3;
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
}

.modal {
  width: min(720px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(24, 32, 42, 0.48);
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.photo-viewer {
  width: min(920px, calc(100% - 24px));
}

.load-detail-modal {
  width: min(920px, calc(100% - 24px));
}

.load-detail-body {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.load-detail-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.load-detail-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 0;
  aspect-ratio: 4 / 3;
}

.load-detail-photo:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
}

.load-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.load-detail-info {
  display: grid;
  gap: 14px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-fact {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  padding: 10px 12px;
}

.detail-fact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-fact strong {
  overflow-wrap: anywhere;
}

.load-detail-description {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.photo-viewer-body {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.photo-viewer-frame {
  display: grid;
  min-height: 320px;
  max-height: 68vh;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.photo-viewer-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.photo-viewer-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.empty-state.compact {
  padding: 16px;
}

.empty-state.compact h2 {
  font-size: 18px;
}

@media (max-width: 900px) {
  .app-shell,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .mobile-only {
    display: flex;
  }

  .nav [data-view="marketplace"],
  .nav [data-view="vehicles"],
  .nav [data-view="notifications"],
  .nav [data-view="profile"] {
    display: none;
  }

  .bottom-nav.mobile-only {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    gap: 4px;
    background: #18202a;
    padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.3);
  }

  .bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #a8b2bf;
    padding: 6px 2px;
    min-height: 56px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
  }

  .bottom-nav-btn.active {
    color: #fff;
  }

  .bottom-nav-btn.active svg {
    stroke: var(--accent);
  }

  .bottom-nav-icon-wrap {
    position: relative;
    display: inline-flex;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    min-width: 16px;
    text-align: center;
  }

  .bottom-nav-plus-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bottom-nav-plus {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid #18202a;
    background: var(--accent);
    color: #fff;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    display: grid;
    place-items: center;
    margin-top: -22px;
    box-shadow: 0 8px 20px rgba(20, 116, 111, 0.4);
    cursor: pointer;
    padding: 0;
  }

  .bottom-nav-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 70;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 230px;
    max-width: 80vw;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  }

  body.bottom-create-open .bottom-nav-menu {
    display: flex;
  }

  .bottom-nav-menu button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .bottom-nav-menu button:hover {
    background: #eef3f6;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    overflow: visible;
    gap: 12px;
    padding: 10px 16px;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar-actions {
    display: none;
  }

  .menu-toggle {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 0;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  body.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  body.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .header-search-toggle {
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
  }

  .header-search-toggle svg {
    flex: 0 0 auto;
  }

  .header-search-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.search-open .header-search-toggle {
    border-color: var(--accent);
    background: var(--accent);
  }

  .header-create {
    position: relative;
    align-items: center;
  }

  .header-plus {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 0;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
  }

  .header-create-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 70;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  }

  body.create-open .header-create-menu {
    display: flex;
  }

  .header-create-menu button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .header-create-menu button:hover {
    background: #eef3f6;
  }

  .filters,
  .vehicle-search {
    display: none;
  }

  body.search-open .filters {
    display: grid;
  }

  body.search-open .vehicle-search {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 78%;
    max-width: 300px;
    z-index: 46;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #18202a;
    padding: calc(28px + env(safe-area-inset-top)) 14px calc(80px + env(safe-area-inset-bottom));
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  body.nav-open .nav {
    transform: translateX(0);
  }

  /* Блок «Связь с нами» — внизу бургер-меню. */
  .nav-contact {
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding: 16px 6px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-contact-title {
    color: #b8c2cf;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
  }

  .nav-contact-links {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .nav-contact .footer-icon-link {
    width: 36px;
    height: 36px;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 4px 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-brand .brand-logo {
    height: 46px;
    max-width: 130px;
  }

  .nav-brand > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav-brand strong,
  .nav-brand span {
    display: block;
  }

  .nav-brand strong {
    color: #fff;
    font-size: 20px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .nav-brand span {
    color: #b8c2cf;
    font-size: 11px;
    white-space: nowrap;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 10px;
  }

  .nav-link-icon {
    display: block;
  }

  .nav-link.active {
    background: var(--accent);
    color: #fff;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: none;
    background: rgba(0, 0, 0, 0.5);
  }

  body.nav-open .nav-overlay {
    display: block;
  }

  .main {
    padding-bottom: 92px;
  }

  .auth-copy {
    display: none;
  }

  /* Узкий контент: поля сами переносятся (auto-fit), строка действий
     переносится по flex-wrap — спец-правила по рядам больше не нужны. */
  .vehicle-search .vehicle-route-filter {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px;
    padding-bottom: 92px;
  }

  .sidebar {
    padding: 10px 14px;
  }

  .topbar,
  .offer-card header,
  .vehicle-body header,
  .section-head,
  .notifications-head,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .footer-brand,
  .footer-links {
    gap: 10px;
  }

  .load-card-head {
    grid-template-columns: 1fr;
  }

  .load-photo {
    width: 100%;
  }

  .topbar-actions,
  .modal-actions {
    justify-content: stretch;
  }

  .topbar-actions > *,
  .modal-actions > * {
    flex: 1;
  }

  .notification-card {
    grid-template-columns: 1fr;
  }

  .filters-grid,
  .form-grid,
  .profile-messenger-grid,
  .profile-messenger-row,
  .profile-user-grid,
  .stats-row,
  .dev-login-actions,
  .review-list,
  .status-board {
    grid-template-columns: 1fr;
  }

  .load-cards-grid,
  .vehicle-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .load-card .route,
  .vehicle-card .route {
    font-size: 15px;
  }

  .load-card .price,
  .vehicle-card .price {
    font-size: 16px;
  }

  .load-compact-body,
  .vehicle-compact-body {
    gap: 6px;
    padding: 10px;
  }

  .load-compact-specs span {
    padding: 4px 7px;
    font-size: 11px;
  }

  .load-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-facts {
    grid-template-columns: 1fr;
  }

  .contact-strip {
    grid-template-columns: 1fr;
  }

  .profile-subtabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .profile-subtab {
    flex: 1 1 0;
    min-height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 6px;
    text-align: center;
  }

  .profile-subtab span {
    width: 100%;
    font-size: 10px;
    line-height: 1.1;
    white-space: normal;
  }

  .profile-subtab strong {
    min-width: 20px;
    min-height: 20px;
    border-radius: 6px;
    font-size: 10px;
  }
}

/* Вход через Telegram/Google — блок внизу + фирменные цвета */
.auth-login-divider { margin-top: 4px; }
.auth-login-buttons { display: grid; gap: 10px; }
.auth-login-buttons .provider-mount { display: grid; gap: 8px; justify-items: stretch; }
.auth-redirect-button { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-weight: 800; font-size: 15px; }
.auth-redirect-button.telegram-option { background: #229ed9; border: 1px solid #229ed9; color: #fff; }
.auth-redirect-button.telegram-option:hover { background: #1b8dc2; }
.auth-redirect-button:not(.telegram-option) { background: #fff; border: 1px solid #dadce0; color: #3c4043; }
.auth-redirect-button:not(.telegram-option):hover { background: #f7f8f8; }

/* Google — красная, чтобы выделялась; разделитель «или» */
.auth-redirect-button:not(.telegram-option) { background: #db4437; border: 1px solid #db4437; color: #fff; }
.auth-redirect-button:not(.telegram-option):hover { background: #c63c30; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
EOFcat >> /var/www/transasia/styles.css <<'EOF'

/* Google — красная, чтобы выделялась; разделитель «или» */
.auth-redirect-button:not(.telegram-option) { background: #db4437; border: 1px solid #db4437; color: #fff; }
.auth-redirect-button:not(.telegram-option):hover { background: #c63c30; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* Карточки груза/авто: окно скроллится внутри, фон не двигается */
.modal { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
body.modal-open { overflow: hidden; }

/* Заметный крестик закрытия (×) */
.icon-button[data-action="close-load-detail"],
.icon-button[data-action="close-vehicle-detail"],
.icon-button[data-action="close-user-profile"] { background: #fdecea; color: #d93025; border: 1px solid #f3b4ae; font-size: 20px; font-weight: 900; line-height: 1; }
.icon-button[data-action="close-load-detail"]:hover,
.icon-button[data-action="close-vehicle-detail"]:hover,
.icon-button[data-action="close-user-profile"]:hover { background: #d93025; color: #fff; border-color: #d93025; }

/* Слой-перекрытие: тап вне меню «+» закрывает меню */
.create-overlay { display: none; position: fixed; inset: 0; z-index: 49; background: transparent; }
body.create-open .create-overlay,
body.bottom-create-open .create-overlay { display: block; }

/* ===== App splash screen (shown on launch) ===== */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
  opacity: 1;
  transition: opacity 0.45s ease;
}

.app-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: app-splash-pop 0.5s ease;
}

.app-splash-logo {
  width: min(60vw, 220px);
  height: auto;
  object-fit: contain;
}

.app-splash-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(20, 116, 111, 0.2);
  border-top-color: var(--accent);
  animation: app-splash-spin 0.8s linear infinite;
}

@keyframes app-splash-spin {
  to { transform: rotate(360deg); }
}

@keyframes app-splash-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Skeleton loading cards ===== */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #e9eef2 25%, #f4f7f9 37%, #e9eef2 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-thumb {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #e9eef2 25%, #f4f7f9 37%, #e9eef2 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.chip { width: 30%; height: 22px; border-radius: 11px; display: inline-block; margin-right: 8px; }

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ===== Pull-to-refresh indicator ===== */
.ptr-indicator {
  position: fixed;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(24, 32, 42, 0.18);
  opacity: 0;
  pointer-events: none;
}

.ptr-indicator.animating {
  transition: transform 0.26s ease, opacity 0.26s ease;
}

.ptr-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(20, 116, 111, 0.25);
  border-top-color: var(--accent);
  transition: border-top-color 0.15s ease;
}

.ptr-indicator.ready .ptr-spinner {
  border-top-color: #16a34a;
}

.ptr-indicator.refreshing .ptr-spinner {
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* ===== Чат ===== */
.chat-panel { display: flex; flex-direction: column; gap: 14px; }
.chat-alerts { display: flex; flex-direction: column; gap: 8px; }
.chat-alerts h3 { margin: 0 0 2px; font-size: 0.95rem; color: var(--muted); }
.chat-list { display: flex; flex-direction: column; gap: 10px; }

.conversation-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-row .conversation-card {
  flex: 1 1 auto;
  min-width: 0;
}

/* Десктоп: ненавязчивый серый крестик, краснеет при наведении.
   Мобильный: крестик скрыт — там удаление через долгое нажатие. */
.icon-button.conversation-delete {
  flex: 0 0 auto;
  width: 30px;
  min-height: 30px;
  background: transparent;
  border: 1px solid transparent;
  color: #97a3b0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.icon-button.conversation-delete:hover {
  background: #fdecea;
  border-color: #f3b4ae;
  color: #d93025;
}

@media (max-width: 900px) {
  .icon-button.conversation-delete {
    display: none;
  }

  /* ── Чат-тред на мобильном: position:fixed чтобы внешняя страница
     гарантированно не скроллилась и кнопка "Отправить" всегда была видна ── */

  body[data-chat-thread="true"] .chat-thread {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 72px; /* высота нижнего нава */
    height: auto;
    min-height: unset;
    max-height: unset;
    overflow: hidden;
    background: var(--bg, #fff);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px 8px;
  }

  body[data-chat-thread="true"] .chat-thread-body {
    flex: 1;
    min-height: 0;
  }

  body[data-chat-thread="true"] {
    /* В открытом чате гасим pull-to-refresh всей страницы. */
    overscroll-behavior-y: contain;
  }

  body[data-chat-thread="true"] .chat-messages {
    max-height: none;
    flex: 1;
    min-height: 0;
  }

  .chat-offer-bar { flex-shrink: 0; }
  .chat-input-row  { flex-shrink: 0; }
}

/* Режим выбора чатов (долгое нажатие) */
.chat-checkbox {
  flex: 0 0 auto;
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #b9c4cf;
  display: inline-grid;
  place-items: center;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.chat-checkbox.checked::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.conversation-row.selected .conversation-card {
  border-color: var(--accent);
  background: #f0fbfa;
}

.chat-select-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.08);
}

.chat-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.chat-select-count {
  margin-left: auto;
  font-weight: 900;
  color: var(--accent-strong);
}

.icon-button.chat-select-trash {
  width: 38px;
  min-height: 38px;
  background: #fdecea;
  border: 1px solid #f3b4ae;
  color: #d93025;
}

.icon-button.chat-select-trash:hover {
  background: #d93025;
  border-color: #d93025;
  color: #fff;
}

.icon-button.chat-select-cancel {
  width: 38px;
  min-height: 38px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.conversation-card {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.conversation-card {
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px; width: 100%;
  text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; padding: 12px 14px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.conversation-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.conversation-card.unread { border-color: var(--accent); background: rgba(20,116,111,0.04); }
.conversation-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.conversation-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.chat-avatar-wrap { position: relative; flex: 0 0 auto; display: inline-flex; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.3px;
}
.chat-avatar.sm { width: 34px; height: 34px; font-size: 0.82rem; }
.online-dot {
  position: absolute; right: 0; bottom: 0; width: 11px; height: 11px;
  border-radius: 50%; background: #22c55e; border: 2px solid #fff;
}

/* Статус присутствия */
.chat-presence { font-size: 0.78rem; color: var(--muted); }
.chat-presence.online { color: #16a34a; }

/* Галочки прочтения */
.chat-ticks { margin-left: 5px; font-size: 0.72rem; }
.chat-bubble.mine .chat-ticks { color: rgba(255,255,255,0.7); }
.chat-bubble.mine .chat-ticks.read { color: #9be7ff; }

/* Разделитель по дням */
.chat-day {
  align-self: center; font-size: 0.74rem; color: var(--muted);
  background: rgba(104,115,130,0.12); border-radius: 8px; padding: 3px 12px; margin: 6px 0;
}
.conversation-top strong { font-size: 1rem; }
.conversation-unread {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.conversation-route { color: var(--muted); font-size: 0.9rem; }
.conversation-preview { color: var(--ink); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.conversation-meta small { color: var(--muted); }

/* Тред переписки */
.chat-thread { display: flex; flex-direction: column; gap: 10px; min-height: 60vh; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Заметная кнопка «Назад» в чате */
.icon-button.chat-back-button {
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: #eef3f6;
  border: 1px solid var(--line);
  color: var(--accent-strong);
}

.icon-button.chat-back-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chat-thread-title { display: flex; flex-direction: column; gap: 2px; }
.chat-thread-title strong { font-size: 1.05rem; }
.chat-thread-route {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent-strong); font-size: 0.88rem; text-align: left; text-decoration: underline;
}
.chat-offer-bar {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(20,116,111,0.05);
}
.chat-offer-status { font-size: 0.92rem; color: var(--ink); }
.chat-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-offer-actions button { padding: 7px 12px; font-size: 0.85rem; }

.chat-vehicle-bar {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: #f7fafb;
}
.chat-vehicle-photos {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.chat-thread-body { position: relative; flex: 1; display: flex; }
.chat-messages {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px;
  max-height: 52vh; overflow-y: auto; flex: 1;
  /* Не даём «пробросить» оверскролл на страницу → внутри чата
     pull-to-refresh не срабатывает и страница не перезагружается. */
  overscroll-behavior: contain;
  /* Узорчатый фон в стиле Telegram/WhatsApp: мягкий тон + ненавязчивый
     повторяющийся SVG-паттерн (тайл 40×40, легко тайлится). */
  background-color: #cfe0ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%239cbdd9' fill-opacity='0.5'%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3Cpath d='M20 4l2 2-2 2-2-2z'/%3E%3Cpath d='M0 24l2 2-2 2-2-2z'/%3E%3Cpath d='M40 24l2 2-2 2-2-2z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  /* scroll-behavior: smooth убран — при авто-опросе каждую секунду
     анимация делает чат дёрганым. Плавный скролл только по кнопке ↓. */
}
.chat-newmsg {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5;
  border: none; cursor: pointer; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.82rem; font-weight: 600;
  padding: 6px 14px; box-shadow: var(--shadow);
}
.chat-newmsg.hidden { display: none; }
.chat-empty { color: var(--muted); text-align: center; margin: auto; }
.chat-system {
  align-self: center; max-width: 90%; text-align: center;
  font-size: 0.82rem; color: var(--muted);
  background: rgba(104,115,130,0.1); border-radius: 10px; padding: 5px 10px;
}
.chat-bubble {
  max-width: 78%; padding: 8px 11px; border-radius: 14px;
  font-size: 0.92rem; line-height: 1.35; word-wrap: break-word;
}
.chat-bubble p { margin: 0; }
.chat-bubble small { display: block; margin-top: 3px; font-size: 0.68rem; opacity: 0.7; }
.chat-bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: #dcebf7; border: 1px solid #c3dbee; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble.offer { font-weight: 600; }

.chat-input-row { display: flex; gap: 8px; align-items: center; }
.chat-input-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 0.95rem; color: var(--ink); background: #fff;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row button { white-space: nowrap; }

/* Заявки, импортированные из Telegram-групп */
.status-telegram { background: #e8f2ff; color: #1c6fd6; }
.load-tg-badge { display: inline-block; font-size: 10px; font-weight: 800; background: #e8f2ff; color: #1c6fd6; border-radius: 999px; padding: 1px 6px; letter-spacing: .3px; }
.telegram-contact { border: 1px dashed #9ec8ff; border-radius: 10px; padding: 8px 10px; }
