*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #e8eaed;
}

.map-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.map-root.leaflet-container {
  font: inherit;
}

/* Контейнер: плашка маршрута + кнопка под ней */
.panel-dock {
  position: fixed;
  z-index: 1000;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  width: min(500px, calc(100vw - 32px));
  min-width: min(500px, calc(100vw - 32px));
  max-width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 38px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 38px - env(safe-area-inset-bottom, 0px));
}

.panel-dock--collapsed {
  max-height: 60px;
  width: auto;
  min-width: 0;
  max-width: none;
  align-items: center;
}

.panel-dock__toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  margin: 0;
  padding: 6px 10px;
  cursor: pointer;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.1),
    0 1px 2px rgba(15, 23, 42, 0.06);
  align-self: stretch;
  min-height: 38px;
  max-height: 38px;
  font: inherit;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.panel-dock__toggle:hover {
  background: #f8fafc;
  color: #0f172a;
}

.panel-dock__toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.panel-dock:not(.panel-dock--collapsed) .panel-dock__toggle-icon--expand {
  display: none;
}

.panel-dock--collapsed .panel-dock__toggle-icon--collapse {
  display: none;
}

.panel-dock:not(.panel-dock--collapsed) .panel-dock__toggle-icon--collapse {
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-dock--collapsed .panel-dock__toggle-icon--expand {
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-dock--collapsed .panel-dock__toggle {
  min-height: 38px;
  max-height: 38px;
  border-radius: 12px;
  width: auto;
  min-width: 42px;
  padding: 6px 12px;
  align-self: center;
}

.panel {
  position: relative;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 38px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 38px - env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 12px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.08);
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.24s ease, max-height 0.24s ease, padding 0.2s ease;
}

.panel-dock:not(.panel-dock--ready) .panel {
  transition: none !important;
}

.panel-dock--collapsed .panel {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateY(-24px);
  padding: 0;
  margin: 0;
  min-height: 0;
  max-height: 0;
  border-width: 0;
  box-shadow: none;
}

.panel__title {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Всегда как полноценная кнопка (расширяет .btn-secondary). */
.panel__title .panel__title-btn {
  margin-bottom: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 8px 14px;
  text-align: left;
  flex: 1;
  width: auto;
  color: #172554;
  background: #dbeafe;
  border-color: #60a5fa;
}

.panel__title #my-location-btn {
  flex: 0 0 auto;
  width: auto;
  margin-bottom: 0;
  white-space: nowrap;
  color: #134e4a;
  background: #ccfbf1;
  border-color: #2dd4bf;
}

.panel__title .panel__title-btn:hover {
  background: #bfdbfe;
  border-color: #3b82f6;
  color: #1e3a8a;
}

.panel__title #my-location-btn:hover {
  background: #99f6e4;
  border-color: #14b8a6;
  color: #0f766e;
}

.panel__title-dropdown {
  margin-bottom: 0;
  width: 100%;
  position: relative;
}

.panel__title-dropdown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 8px 14px;
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
}

.panel__title-dropdown-summary::-webkit-details-marker {
  display: none;
}

.panel__title-chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.75;
}

.panel__title-dropdown[open] .panel__title-chevron {
  transform: rotate(0deg);
}

.panel__title-dropdown-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.1),
    0 1px 2px rgba(15, 23, 42, 0.06);
  z-index: 1001;
}

.panel__title-dropdown-item {
  margin: 0;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  color: #334155;
  background: #f8fafc;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.panel__title-dropdown-item:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.panel__title-dropdown-item:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Плашка выбора стиля Thunderforest: справа сверху */
.map-style-panel {
  position: fixed;
  z-index: 1000;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(200px, calc(100vw - 32px));
  padding: 12px 10px 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.08);
}

.map-style__section {
  transition: opacity 0.22s ease, transform 0.24s ease, max-height 0.24s ease, margin 0.2s ease;
}

.map-style__section + .map-style__section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}

.map-style-panel--collapsed .map-style__section {
  display: none;
}

.map-style__toolbar {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-bottom: 0;
}

.map-style__icon-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px;
  font: inherit;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.map-style__icon-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.map-style__icon-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-style__icon-btn svg {
  display: block;
  flex-shrink: 0;
}

.map-style__fx-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  margin-top: 0;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #052e16;
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
  border-radius: 10px;
  min-height: 40px;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.map-style__fx-btn .map-style__btn__row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.map-style__fx-btn:hover {
  background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
  border-color: #4ade80;
  color: #022c22;
}

.map-style__fx-btn--step-2 {
  border-color: #22c55e;
  background: linear-gradient(180deg, #86efac 0%, #4ade80 100%);
  color: #14532d;
}

.map-style__fx-btn--step-2:hover {
  border-color: #16a34a;
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
  color: #052e16;
}

.map-style__fx-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-fx-dialog {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  width: fit-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
}

.map-fx-dialog::backdrop {
  background: transparent;
}

.map-fx-dialog__inner {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

.map-fx-dialog__body {
  min-height: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  pointer-events: auto;
}

.map-fx-dialog__loading,
.map-fx-dialog__empty,
.map-fx-dialog__error {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  max-width: calc(100vw - 52px);
  text-align: center;
}

.map-fx-dialog__error {
  color: #b91c1c;
}

.map-fx-dialog__list {
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  overflow: visible;
}

.map-fx-dialog__row {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
}

.map-fx-dialog__row-main {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

.map-fx-dialog__row-rate {
  font-size: 0.8125rem;
  color: #334155;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: center;
  width: 100%;
}

.map-style__buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.map-style__buttons.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.map-style__collapse-toggle {
  width: calc(100% + 20px);
  margin: 8px -10px 0;
  min-height: 38px;
  max-height: 38px;
  padding: 6px 10px;
  font: inherit;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  cursor: pointer;
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.1),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.map-style__collapse-toggle:hover {
  background: #f8fafc;
}

.map-style__collapse-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-style-panel:not(.map-style-panel--collapsed) .map-style__collapse-icon--expand {
  display: none;
}

.map-style-panel--collapsed .map-style__collapse-icon--collapse {
  display: none;
}

.map-style-panel:not(.map-style-panel--collapsed) .map-style__collapse-icon--collapse {
  font-size: 1.1rem;
  font-weight: 600;
}

.map-style-panel--collapsed .map-style__collapse-icon--expand {
  font-size: 1.1rem;
  font-weight: 600;
}

.map-style-panel--collapsed {
  border-radius: 12px;
  padding-top: 0;
  padding-bottom: 0;
  background: transparent;
  box-shadow: none;
  width: auto;
  min-width: 0;
  max-width: calc(100vw - 32px);
  min-height: 38px;
  align-items: center;
}

.map-style-panel--collapsed .map-style__collapse-toggle {
  margin-top: 0;
  border-radius: 12px;
  width: auto;
  min-width: 42px;
  padding: 6px 12px;
  margin-left: 0;
  margin-right: 0;
  align-self: center;
}

.map-style__btn {
  width: 100%;
  padding: 8px 10px;
  min-height: 36px;
  font-size: 0.6875rem;
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  opacity: 0.82;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.map-style__btn:hover {
  opacity: 1;
  filter: brightness(1.08);
}

.map-style__btn.is-active {
  opacity: 1;
  transform: scale(1.02);
  box-shadow:
    0 0 0 2px #fff,
    0 4px 14px rgba(15, 23, 42, 0.28);
  filter: saturate(1.12) brightness(1.02);
}

.map-style__btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-style__btn--route,
.map-style__btn--hotels,
.map-style__btn--azs,
.map-style__btn--planning,
.map-style__btn--expenses {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding-top: 6px;
  padding-bottom: 6px;
  min-height: 40px;
}

.map-style__btn--route .map-style__btn__row,
.map-style__btn--hotels .map-style__btn__row,
.map-style__btn--azs .map-style__btn__row,
.map-style__btn--planning .map-style__btn__row,
.map-style__btn--expenses .map-style__btn__row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.map-style__btn--route {
  background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #eff6ff;
}

.map-style__btn--hotels {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  border-color: #d97706;
  color: #1f2937;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.map-style__btn--azs {
  background: linear-gradient(180deg, #6ee7b7 0%, #059669 100%);
  border-color: #047857;
  color: #ecfdf5;
}

.map-style__btn--azs:not(.is-active) {
  opacity: 0.72;
  filter: saturate(0.45) brightness(0.9);
}

.map-style__btn--azs.is-active {
  opacity: 1;
  filter: saturate(1.2) brightness(1.06);
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px rgba(16, 185, 129, 0.35),
    0 6px 16px rgba(4, 120, 87, 0.35);
}

.map-style__btn--planning {
  background: linear-gradient(180deg, #c4b5fd 0%, #7c3aed 100%);
  border-color: #6d28d9;
  color: #faf5ff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.map-style__btn--expenses {
  background: linear-gradient(180deg, #fda4af 0%, #e11d48 100%);
  border-color: #be123c;
  color: #fff1f2;
}

.map-style__btn-grand-total {
  display: block;
  max-width: 100%;
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-style__btn-grand-total[hidden] {
  display: none !important;
}

.map-style__btn-grand-total--dark {
  color: #1f2937;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Резерв строки под сумму у «Курсы» и «Маршруты», чтобы подписи и суммы в соседних кнопках были по центру. */
.map-style__btn-grand-total--spacer {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.map-style__fx-btn .map-style__btn-grand-total--spacer {
  color: #052e16;
  text-shadow: none;
}

.expenses-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#expenses-list.expenses-grid--sortable-planning .expenses-row {
  cursor: grab;
}

#expenses-list.expenses-grid--sortable-planning .expenses-row:active {
  cursor: grabbing;
}

.expenses-row--sortable-ghost {
  opacity: 0.45;
}

.expenses-row--sortable-chosen {
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
  position: relative;
  z-index: 2;
}

.expenses-row--sortable-drag {
  opacity: 0.96;
}

#expenses-dialog.expenses-dialog--expenses-lite .expenses-dialog__totals,
#expenses-dialog.expenses-dialog--expenses-lite #expenses-list,
#expenses-dialog.expenses-dialog--expenses-lite .hotels-dialog__top-actions {
  display: none !important;
}

/*
 * Сетка строк списков расходов (статья, общий список, бензин).
 * Новые списки с той же логикой: gap/padding/min-height и колонки через эти переменные.
 */
:root {
  --tp-exp-list-gap: 4px 8px;
  --tp-exp-list-pad: 0 4px 0 6px;
  --tp-exp-list-minh: 32px;
  /* Окно статьи / бензин: дата с секундами; общий список — своя сетка ниже. */
  --tp-exp-col-dt: minmax(10.5rem, 1.08fr);
  --tp-exp-col-cat: minmax(72px, 6.5rem);
  --tp-exp-col-lit: minmax(44px, 1fr);
  --tp-exp-col-amt: minmax(52px, 1fr);
  --tp-exp-col-ccy: minmax(52px, 1.05fr);
  --tp-exp-col-btn: 36px;
}

#expenses-dialog .expenses-mode-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0 0 12px;
  box-sizing: border-box;
}

#expenses-dialog .expenses-mode-stack[hidden] {
  display: none !important;
}

#expenses-dialog .expenses-mode-stack__row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Как у списка записей в окне статьи (Бензин): окно растёт по шапке и стопке, длинная лента — со внутренней прокруткой. */
#expenses-dialog .expenses-combined-lines {
  box-sizing: border-box;
  width: 100%;
  margin-top: 12px;
  max-height: min(58dvh, calc(100dvh - 220px));
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

#expenses-dialog .expenses-combined-lines[hidden] {
  display: none !important;
}

/* Дата — по ширине текста (без пустого «поля»); тип расхода — шире; сумма и валюта рядом ровнее. */
#expenses-dialog .expenses-combined-lines__line {
  display: grid;
  grid-template-columns: max-content minmax(6.5rem, 1.45fr) minmax(58px, 1.1fr) minmax(50px, 1fr);
  gap: var(--tp-exp-list-gap);
  align-items: center;
  padding: var(--tp-exp-list-pad);
  min-height: var(--tp-exp-list-minh);
  box-sizing: border-box;
  font-size: 0.68rem;
  line-height: 1.12;
  border-bottom: 1px solid #eef2f7;
}

#expenses-dialog .expenses-combined-lines__line:last-child {
  border-bottom: none;
}

#expenses-dialog .expenses-combined-lines__dt {
  min-width: 0;
  white-space: nowrap;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

#expenses-dialog .expenses-combined-lines__cat {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-weight: 600;
  color: #475569;
}

#expenses-dialog .expenses-combined-lines__cat-pill {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#expenses-dialog .expenses-combined-lines__amt {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#expenses-dialog .expenses-combined-lines__ccy {
  min-width: 0;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.25;
  hyphens: auto;
}

#expenses-dialog .expenses-mode-stack__btn {
  flex: 0 1 50%;
  max-width: 54%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
  padding: 8px 10px;
  min-height: 40px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  text-shadow: none;
  opacity: 1;
  transition: background 0.12s ease, border-color 0.12s ease;
}

#expenses-dialog .expenses-mode-stack__sum {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  user-select: none;
  pointer-events: none;
}

#expenses-dialog .expenses-mode-stack__sum--fuel {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.15;
  text-align: center;
}

#expenses-dialog .expenses-mode-stack__sum-liters {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0369a1;
  font-variant-numeric: tabular-nums;
}

#expenses-dialog .expenses-mode-stack__btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

#expenses-dialog .expenses-mode-stack__btn:active {
  background: #cbd5e1;
}

#expenses-dialog .expenses-mode-stack__btn:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}

/* Тона стопки: порядок видимых кнопок, затем по модулю 8 (любое число статей). */
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--0 {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--0:hover {
  background: #bae6fd;
  border-color: #38bdf8;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--0:active {
  background: #7dd3fc;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--0 {
  border-left: 3px solid #38bdf8;
  background: #f8fafc;
}
#expenses-dialog .expenses-stack-tone-pill--0 {
  color: #075985;
  background: rgba(224, 242, 254, 0.92);
  border-color: #38bdf8;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--1 {
  color: #5b21b6;
  background: #ede9fe;
  border-color: #c4b5fd;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--1:hover {
  background: #ddd6fe;
  border-color: #a78bfa;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--1:active {
  background: #c4b5fd;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--1 {
  border-left: 3px solid #8b5cf6;
  background: #fafaf9;
}
#expenses-dialog .expenses-stack-tone-pill--1 {
  color: #5b21b6;
  background: rgba(237, 233, 254, 0.95);
  border-color: #8b5cf6;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--2 {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--2:hover {
  background: #a7f3d0;
  border-color: #34d399;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--2:active {
  background: #6ee7b7;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--2 {
  border-left: 3px solid #10b981;
  background: #f8fafc;
}
#expenses-dialog .expenses-stack-tone-pill--2 {
  color: #065f46;
  background: rgba(209, 250, 229, 0.95);
  border-color: #10b981;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--3 {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fda4af;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--3:hover {
  background: #fecdd3;
  border-color: #fb7185;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--3:active {
  background: #fda4af;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--3 {
  border-left: 3px solid #f43f5e;
  background: #fafaf9;
}
#expenses-dialog .expenses-stack-tone-pill--3 {
  color: #9f1239;
  background: rgba(255, 228, 230, 0.95);
  border-color: #f43f5e;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--4 {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--4:hover {
  background: #fde68a;
  border-color: #fbbf24;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--4:active {
  background: #fcd34d;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--4 {
  border-left: 3px solid #f59e0b;
  background: #fafaf9;
}
#expenses-dialog .expenses-stack-tone-pill--4 {
  color: #92400e;
  background: rgba(254, 243, 199, 0.95);
  border-color: #f59e0b;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--5 {
  color: #155e75;
  background: #cffafe;
  border-color: #67e8f9;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--5:hover {
  background: #a5f3fc;
  border-color: #22d3ee;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--5:active {
  background: #67e8f9;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--5 {
  border-left: 3px solid #06b6d4;
  background: #f8fafc;
}
#expenses-dialog .expenses-stack-tone-pill--5 {
  color: #155e75;
  background: rgba(207, 250, 254, 0.95);
  border-color: #06b6d4;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--6 {
  color: #86198f;
  background: #fae8ff;
  border-color: #e879f9;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--6:hover {
  background: #f5d0fe;
  border-color: #d946ef;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--6:active {
  background: #e879f9;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--6 {
  border-left: 3px solid #c026d3;
  background: #fafaf9;
}
#expenses-dialog .expenses-stack-tone-pill--6 {
  color: #86198f;
  background: rgba(250, 232, 255, 0.95);
  border-color: #c026d3;
}

#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--7 {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--7:hover {
  background: #fed7aa;
  border-color: #fb923c;
}
#expenses-dialog .expenses-mode-stack__btn.expenses-stack-tone--7:active {
  background: #fdba74;
}
#expenses-dialog .expenses-mode-stack__sum.expenses-stack-sum-tone--7 {
  border-left: 3px solid #ea580c;
  background: #fafaf9;
}
#expenses-dialog .expenses-stack-tone-pill--7 {
  color: #9a3412;
  background: rgba(255, 237, 213, 0.95);
  border-color: #ea580c;
}

#expenses-dialog .expenses-mode-stack__btn[class*='expenses-stack-tone--']:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}

.expenses-dialog__title-row {
  align-items: center;
}

#expenses-dialog,
#expenses-item-dialog.expenses-item-dialog {
  width: min(456px, calc((100vw - 24px) * 0.6));
  max-width: min(456px, calc((100vw - 24px) * 0.6));
}

#expenses-item-dialog.expenses-item-dialog {
  z-index: 2400;
}

.expenses-item-dialog__title-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 14px;
  width: 100%;
  box-sizing: border-box;
}

#expenses-item-dialog .expenses-item-dialog__title-h {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.expenses-item-dialog__title-sums {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 72%);
  box-sizing: border-box;
}

.expenses-item-dialog__lines-sum {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-item-dialog__lines-sum:empty {
  display: none;
}

.expenses-item-dialog__lines-liters-sum {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-item-dialog__lines-liters-sum[hidden] {
  display: none !important;
}

.expenses-item-dialog__records-shell {
  margin-top: 10px;
}

.expenses-item-dialog__records-shell[hidden] {
  display: none !important;
}

.expenses-item-dialog__records {
  max-height: min(58dvh, calc(100dvh - 220px));
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.expenses-item-dialog__records[hidden] {
  display: none !important;
}

.expenses-item-dialog__record {
  display: grid;
  grid-template-columns: var(--tp-exp-col-dt) var(--tp-exp-col-amt) var(--tp-exp-col-ccy) var(--tp-exp-col-btn);
  gap: var(--tp-exp-list-gap);
  align-items: center;
  padding: var(--tp-exp-list-pad);
  min-height: var(--tp-exp-list-minh);
  box-sizing: border-box;
  font-size: 0.68rem;
  line-height: 1.12;
  border-bottom: 1px solid #eef2f7;
}

.expenses-item-dialog__record--fuel {
  grid-template-columns: var(--tp-exp-col-dt) var(--tp-exp-col-lit) var(--tp-exp-col-amt) minmax(58px, 1.12fr)
    var(--tp-exp-col-btn);
}

.expenses-item-dialog__record:last-child {
  border-bottom: none;
}

.expenses-item-dialog__record-dt {
  min-width: 0;
  white-space: nowrap;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.expenses-item-dialog__record-liters {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0369a1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-item-dialog__record-amt {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-item-dialog__record-ccy {
  min-width: 0;
  text-align: center;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.62rem;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.2;
  hyphens: auto;
}

.expenses-item-dialog__record--fuel .expenses-item-dialog__record-ccy {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  hyphens: none;
}

.expenses-item-dialog__record-remove {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.expenses-item-dialog__record-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.expenses-item-dialog__record-remove:active {
  background: #fecaca;
}

.expenses-item-dialog__entry-row {
  box-sizing: border-box;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.expenses-item-dialog__amount {
  flex: 1 1 96px;
  min-width: 72px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.875rem;
}

/* Валюта: без фикс. height — иначе нативный select обрезает текст снизу (~треть строки). */
.expenses-item-dialog__currency-slot {
  flex: 1 1 120px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px 5px 9px;
  background: #e5e5ea;
  border: none;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: visible;
}

.expenses-item-dialog__currency-select {
  box-sizing: border-box;
  width: 100%;
  min-height: 1.5em;
  height: auto;
  margin: 0;
  padding: 4px 26px 4px 3px;
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: #1c1c1e;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6l5-4.5' stroke='%233C3C43' stroke-opacity='0.45' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 10px 6px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.expenses-item-dialog__currency-select:focus {
  outline: none;
}

.expenses-item-dialog__currency-select:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: 6px;
}

.expenses-item-dialog__currency-select option {
  font-weight: 500;
  color: #1c1c1e;
  background: #fff;
}

/* Перебить глобальные .field__input / select.field__select */
#expenses-item-dialog .expenses-item-dialog__currency-select.field__input.field__select {
  border: none;
  background-color: transparent;
  min-height: 0;
}

#expenses-item-dialog .expenses-item-dialog__currency-select.field__input.field__select:hover {
  border: none;
  background-color: transparent;
}

#expenses-item-dialog .expenses-item-dialog__currency-select.field__input.field__select:focus {
  border: none;
  background-color: transparent;
  box-shadow: none;
}

.expenses-item-dialog__liters {
  flex: 1 1 88px;
  min-width: 72px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.expenses-item-dialog__liters[hidden] {
  display: none !important;
}

.expenses-item-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.expenses-item-dialog__actions .btn-primary,
.expenses-item-dialog__actions .btn-secondary {
  flex: 1 1 auto;
  min-width: 0;
}

#expenses-dialog .expenses-dialog__totals .hotels-dialog__total--paid,
#expenses-dialog .expenses-dialog__totals .hotels-dialog__total--unpaid {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

#expenses-dialog.expenses-dialog--planning #expenses-total-paid {
  display: none !important;
}

/* Планирование: без «Скрыть» (в т.ч. Бензин, Отели) — приглушено; свои и Отели со «Скрыть» — светлая плашка. */
#expenses-dialog.expenses-dialog--planning .expenses-row--plan-normal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

#expenses-dialog.expenses-dialog--planning .expenses-row--plan-normal .expenses-view-name,
#expenses-dialog.expenses-dialog--planning .expenses-row--plan-normal .expenses-view-amount {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
}

#expenses-dialog.expenses-dialog--planning .expenses-row--plan-normal .expenses-row__name,
#expenses-dialog.expenses-dialog--planning .expenses-row--plan-normal .expenses-row__amount {
  background: #ffffff;
  border-color: #e2e8f0;
}

#expenses-dialog.expenses-dialog--planning .expenses-row--plan-muted {
  background: #e8edf4;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #64748b;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
}

#expenses-dialog.expenses-dialog--planning .expenses-row--plan-muted .expenses-view-name,
#expenses-dialog.expenses-dialog--planning .expenses-row--plan-muted .expenses-view-amount {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

#expenses-dialog.expenses-dialog--planning .expenses-row--plan-muted .expenses-row__name,
#expenses-dialog.expenses-dialog--planning .expenses-row--plan-muted .expenses-row__amount {
  background: #f8fafc;
  border-color: #cbd5e1;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__view {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 116px) minmax(96px, auto);
}

#expenses-dialog.expenses-dialog--planning .expenses-row__edit {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 116px) minmax(132px, auto);
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-hide-wrap {
  grid-column: 1 / span 2;
  align-self: center;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-hide-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-hide {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-to-expenses-wrap {
  grid-column: 1 / span 2;
  align-self: center;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-to-expenses-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

#expenses-dialog.expenses-dialog--planning .expenses-row__plan-to-expenses {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  #expenses-dialog.expenses-dialog--planning .expenses-row__plan-hide-wrap {
    grid-column: auto;
  }

  #expenses-dialog.expenses-dialog--planning .expenses-row__plan-to-expenses-wrap {
    grid-column: auto;
  }
}

#expenses-dialog .map-settings-dialog__actions {
  margin-top: 14px;
}

.expenses-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
}

.expenses-row .field__input {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.expenses-row__view,
.expenses-row__edit {
  display: grid;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.expenses-row__view {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 116px) minmax(92px, 116px) minmax(96px, auto);
}

.expenses-row__edit {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 116px) minmax(92px, 116px) minmax(132px, auto);
}

.expenses-row__view[hidden],
.expenses-row__edit[hidden] {
  display: none !important;
}

.expenses-view-name,
.expenses-view-amount,
.expenses-view-paid {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  font-size: 0.8rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expenses-view-name {
  justify-content: flex-start;
}

.expenses-view-amount,
.expenses-view-paid {
  justify-content: flex-end;
  font-weight: 600;
}

.expenses-view-paid-input {
  min-width: 0;
  text-align: right;
}

.expenses-view-actions,
.expenses-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  flex-wrap: nowrap;
}

.expenses-row__remove-btn,
.expenses-row__edit-btn,
.expenses-row__save,
.expenses-row__cancel {
  min-width: 64px;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.72rem;
  text-align: center;
  border-radius: 8px;
}

.expenses-row__remove-btn {
  min-width: 30px;
  width: 30px;
  min-height: 28px;
  padding: 0;
  color: #fff;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: #b91c1c;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .expenses-row__view,
  .expenses-row__edit {
    grid-template-columns: 1fr;
  }

  .expenses-view-actions,
  .expenses-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .expenses-row__remove-btn,
  .expenses-row__edit-btn,
  .expenses-row__save,
  .expenses-row__cancel {
    min-width: 0;
    width: 100%;
  }
}

.map-azs-marker-wrap {
  background: none !important;
  border: none !important;
}

.map-azs-marker-hit {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.map-azs-marker {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.45));
}

.map-azs-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
}

.map-azs-popup-wrap .leaflet-popup-content {
  margin: 18px 14px 8px;
  min-width: 200px;
}

.map-azs-popup {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: 118px;
  padding-top: 8px;
  padding-bottom: 6px;
}

.map-azs-popup__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 5px;
  line-height: 1.25;
}

.map-azs-popup__addr {
  font-size: 12px;
  color: #334155;
  line-height: 1.35;
  margin-bottom: 10px;
}

.map-azs-popup__addr.map-azs-popup__muted {
  color: #94a3b8;
}

.map-azs-popup__copy {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  border: 1px solid #047857;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.map-azs-popup__copy:active {
  filter: brightness(0.95);
}

.map-azs-popup-wrap .leaflet-popup-tip-container {
  margin-top: -1px;
}

.map-poi-popup__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.map-poi-popup__photo-wrap {
  margin: -2px -2px 6px;
}

.map-poi-popup__photo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.map-poi-popup__addr,
.map-poi-popup__type {
  font-size: 12px;
  color: #334155;
  margin-bottom: 3px;
}

.map-settings-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  max-width: min(520px, calc(100vw - 32px));
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 48px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border: none;
  border-radius: 16px;
  z-index: 2000;
  transform: translate(-50%, -50%);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.08);
}

.google-maps-settings-dialog {
  z-index: 3000;
}

.google-maps-settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.route-editor-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  width: min(1120px, calc(100vw - 24px));
  max-width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 40px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 40px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border: none;
  border-radius: 16px;
  z-index: 2200;
  transform: translate(-50%, -50%);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.12),
    0 1px 3px rgba(15, 23, 42, 0.08);
}

.route-editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.route-editor-dialog__form {
  padding: 18px;
  background: #fff;
  border-radius: 16px;
}

.route-editor-dialog__title {
  margin: 0 0 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.route-editor-dialog__name-field {
  margin-bottom: 10px;
}

.route-editor-dialog__name-status {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.route-editor-dialog__name-status.is-saved {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.route-editor-dialog__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.route-editor-dialog__name-row .field__input {
  flex: 1 1 260px;
  min-width: 180px;
}

.route-editor-dialog__name-row .route-editor-dialog__name-btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  margin-bottom: 0;
  white-space: nowrap;
}

.route-editor-dialog__build-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.route-editor-dialog__build-actions .btn-primary,
.route-editor-dialog__build-actions .btn-secondary {
  flex: 1 1 160px;
  margin-bottom: 0;
  min-width: 0;
}

.route-editor-dialog__actions {
  margin-top: 10px;
}

#hotels-dialog {
  width: calc(100vw - 12px);
  max-width: calc(100vw - 12px);
  background: rgba(255, 255, 255, 0.01) !important;
}

#hotels-dialog {
  width: calc(100vw - 6px);
  max-width: calc(100vw - 6px);
  background: rgba(255, 255, 255, 0.01) !important;
}

/* Без backdrop-filter: иначе в Safari/Chrome текст сумм в шапке не перерисовывается до закрытия <dialog>. */
#hotels-dialog .map-settings-dialog__form {
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#hotels-dialog .hotel-card {
  background: rgba(255, 251, 235, 0.2) !important;
  border-color: rgba(253, 230, 138, 0.32) !important;
}

.map-settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.map-settings-dialog__form {
  padding: 22px 22px 20px;
  background: #fff;
  border-radius: 16px;
}

.map-settings-dialog__title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

/* Подписи полей, подсказки, селекты и короткий ввод — по центру в окнах настроек и формах карт. */
.map-settings-dialog .map-settings-dialog__section-title {
  text-align: center;
}

.map-settings-dialog .field__label,
.map-settings-dialog .field__label-hint {
  text-align: center;
}

.map-settings-dialog .map-settings-dialog__section-hint {
  text-align: center;
}

.map-settings-dialog .field__input,
.map-settings-dialog textarea.field__input {
  text-align: center;
}

.map-settings-dialog select.field__input,
.map-settings-dialog select.field__select {
  text-align: center;
  text-align-last: center;
}

.route-editor-dialog .field__label,
.route-editor-dialog .field__label-hint {
  text-align: center;
}

.route-editor-dialog .field .field__input,
.route-editor-dialog .field textarea.field__input,
.route-editor-dialog .field select.field__input {
  text-align: center;
}

.route-editor-dialog select.field__input {
  text-align-last: center;
}

.route-editor-dialog .panel__pick-hint,
.route-editor-dialog .panel-block__summary .panel-block__title {
  text-align: center;
}

.map-settings-dialog__feedback {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  font-weight: 500;
  border-radius: 10px;
  text-align: center;
}

.map-settings-dialog__feedback[hidden] {
  display: none !important;
}

.map-settings-dialog__feedback--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.map-settings-dialog__feedback--err {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.map-settings-dialog__block {
  margin: 0;
  padding: 12px 0;
}

.map-settings-dialog__block + .map-settings-dialog__block {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.map-settings-route-fuel-wrap {
  margin-bottom: 0;
}

.map-settings-route-fuel-intro {
  margin-top: -4px;
}

.map-settings-route-fuel-filter-btn {
  width: 100%;
  margin: 0 0 8px;
}

.map-settings-route-fuel-filter-btn.is-active {
  color: #ecfdf5;
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  border-color: #047857;
}

.map-settings-route-fuel-wrap[hidden] {
  display: none !important;
}

#settings-route-fuel-wrap:not([hidden]) ~ .map-settings-vehicles-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.map-settings-vehicles-block {
  margin-top: 0;
}

.map-settings-dialog__section-title {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
}

.map-settings-dialog__section-title--center {
  text-align: center;
}

.map-settings-dialog__section-hint {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.map-settings-dialog__google-traffic-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.map-settings-dialog__google-traffic-check input {
  margin-top: 2px;
  flex-shrink: 0;
}

.map-settings-dialog__google-setup-btn {
  width: 100%;
  margin-top: 6px;
}

.map-settings-dialog__map-provider-field {
  margin-bottom: 12px;
}

.map-settings-dialog__map-layer-field {
  margin-bottom: 12px;
}

.map-settings-dialog__provider-select {
  font-weight: 500;
}

.map-layer-dropdown {
  position: relative;
  width: 100%;
}

.map-layer-dropdown__trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  margin: 0;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #1e3a5f;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #7dd3fc;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.map-layer-dropdown__trigger:hover:not(:disabled) {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #38bdf8;
}

.map-layer-dropdown__trigger:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-layer-dropdown__trigger--disabled,
.map-layer-dropdown__trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.map-layer-dropdown__trigger-text {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.map-layer-dropdown__chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  opacity: 0.75;
}

.map-layer-dropdown__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.18),
    0 4px 12px rgba(15, 23, 42, 0.08);
  max-height: min(60vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.map-layer-dropdown__menu--open {
  animation: map-layer-dropdown-in 0.18s ease;
}

@keyframes map-layer-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-layer-dropdown__option {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 9px 10px;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  transition:
    filter 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.map-layer-dropdown__option:last-child {
  margin-bottom: 0;
}

.map-layer-dropdown__option:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: scale(1.01);
}

.map-layer-dropdown__option:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-layer-dropdown__option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-layer-dropdown__option.is-selected {
  box-shadow:
    0 0 0 2px #fff,
    0 4px 12px rgba(15, 23, 42, 0.25);
}

/* Thunderforest */
.map-layer-dropdown__option--tf-atlas {
  background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #eff6ff;
}
.map-layer-dropdown__option--tf-night {
  background: linear-gradient(180deg, #4c1d95 0%, #1e1b4b 100%);
  border-color: #312e81;
  color: #ede9fe;
}
.map-layer-dropdown__option--tf-mobile {
  background: linear-gradient(180deg, #5eead4 0%, #0d9488 100%);
  border-color: #0f766e;
  color: #042f2e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.map-layer-dropdown__option--tf-pioneer {
  background: linear-gradient(180deg, #86efac 0%, #16a34a 100%);
  border-color: #15803d;
  color: #052e16;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.map-layer-dropdown__option--tf-outdoors {
  background: linear-gradient(180deg, #a3e635 0%, #4d7c0f 100%);
  border-color: #3f6212;
  color: #14532d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}
.map-layer-dropdown__option--tf-neighbourhood {
  background: linear-gradient(180deg, #fda4af 0%, #e11d48 100%);
  border-color: #be123c;
  color: #fff5f7;
}
.map-layer-dropdown__option--tf-transport {
  background: linear-gradient(180deg, #fdba74 0%, #ea580c 100%);
  border-color: #c2410c;
  color: #431407;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Google map types */
.map-layer-dropdown__option--g-roadmap {
  background: linear-gradient(180deg, #93c5fd 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #eff6ff;
}
.map-layer-dropdown__option--g-satellite {
  background: linear-gradient(180deg, #334155 0%, #0f172a 100%);
  border-color: #1e293b;
  color: #e2e8f0;
}
.map-layer-dropdown__option--g-hybrid {
  background: linear-gradient(180deg, #c4b5fd 0%, #5b21b6 100%);
  border-color: #6d28d9;
  color: #f5f3ff;
}
.map-layer-dropdown__option--g-terrain {
  background: linear-gradient(180deg, #d6d3d1 0%, #78716c 100%);
  border-color: #57534e;
  color: #1c1917;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.map-settings-dialog__radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #334155;
}

.map-settings-dialog__radio-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.map-settings-dialog__buttons--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.map-settings-dialog__section-hint--center {
  text-align: center;
}

.map-settings-dialog__section-hint[hidden] {
  display: none !important;
}

.map-settings-route-fuel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-settings-route-fuel-list[hidden] {
  display: none !important;
}

.map-settings-route-fuel-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-settings-route-fuel-country-btn {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.map-settings-route-fuel-country-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.map-settings-route-fuel-country-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-settings-route-fuel-panel {
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-settings-route-fuel-panel[hidden] {
  display: none !important;
}

.map-settings-route-fuel-currency {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #334155;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.map-settings-route-fuel-rec {
  margin: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.map-settings-route-fuel-rec__title {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.map-settings-route-fuel-rec__body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #334155;
}

.map-settings-route-fuel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

@media (max-width: 400px) {
  .map-settings-route-fuel-grid {
    grid-template-columns: 1fr;
  }
}

.map-settings-route-fuel-price-cell .field__label {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.map-settings-route-fuel-save {
  width: 100%;
  align-self: stretch;
  margin-top: 2px;
}

.map-settings-vehicles-actions {
  margin-top: 0;
}

.map-settings-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-settings-dialog__vehicle-list {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-settings-dialog__vehicle-list[hidden] {
  display: none !important;
}

.map-settings-dialog__vehicle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.map-settings-dialog__vehicle-item-text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.map-settings-dialog__vehicle-item-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  cursor: pointer;
}

.map-settings-dialog__vehicle-item-btn--edit {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.map-settings-dialog__vehicle-item-btn--edit:hover {
  background: #dbeafe;
}

.map-settings-dialog__vehicle-item-btn--remove {
  width: 30px;
  padding: 4px 0;
  font-size: 1.15rem;
  line-height: 1;
  color: #b91c1c;
  background: #fff;
  border: 1px solid #fecaca;
}

.map-settings-dialog__vehicle-item-btn--remove:hover {
  background: #fef2f2;
}

.map-settings-dialog__vehicle-item-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.map-settings-dialog__saved-routes-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.map-settings-dialog__saved-route-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
}

.map-settings-dialog__saved-route-text {
  min-width: 0;
  color: #0f172a;
  font-size: 0.8125rem;
  line-height: 1.25;
}

.map-settings-dialog__saved-route-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.map-settings-dialog__saved-route-time {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.75rem;
}

.map-settings-dialog__saved-route-btn {
  width: auto;
  margin: 0;
  margin-bottom: 0;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.map-settings-dialog__add-car {
  width: 100%;
}

.map-settings-dialog__save-vehicle {
  width: 100%;
  margin-top: 2px;
}

.map-settings-dialog__vehicle-fields {
  width: 100%;
  padding: 4px 0 2px;
}

.map-settings-dialog__vehicle-fields[hidden] {
  display: none !important;
}

.map-settings-dialog__vehicle-fields .field {
  margin-bottom: 12px;
}

.map-settings-dialog__vehicle-fields .field:last-child {
  margin-bottom: 0;
}

.map-settings-vehicle-fuel-range {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.map-settings-vehicle-fuel-range .field__input {
  flex: 1;
  min-width: 0;
}

.map-settings-vehicle-fuel-range__sep {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #64748b;
}

.field__label-hint {
  font-weight: 400;
  color: #94a3b8;
}

.map-settings-dialog__close {
  width: 100%;
}

.waypoints-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  overflow: visible;
}

.waypoints-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.waypoints-actions .btn-secondary {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

#add-waypoint {
  color: #fff;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

#add-waypoint:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

#pick-on-map {
  color: #1e3a8a;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

#pick-on-map:hover {
  background: #bfdbfe;
  border-color: #60a5fa;
}

.panel__pick-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #4338ca;
}

/*
 * POI (перевёрнутая капля) в режиме «На карте».
 * Hotspot — нижнее острие; fallback crosshair для сред без SVG-курсоров.
 */
.map-root.map--pick-point,
.map-root.map--pick-point .leaflet-grab,
.map-root.map--pick-point .leaflet-dragging .leaflet-grab {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='40' viewBox='0 0 32 40'%3E%3Cpath fill='%232563eb' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round' d='M16 2C9.4 2 4.2 7.2 4.2 13.8c0 5.2 8.5 15.6 11.8 23.2.2.4.4.6.6 0 3.3-7.6 11.8-18 11.8-23.2C27.8 7.2 22.6 2 16 2z'/%3E%3Ccircle cx='16' cy='14' r='4.5' fill='%23ffffff'/%3E%3C/svg%3E")
      16 36,
    crosshair !important;
}

.btn-secondary.is-armed {
  background: #eef2ff;
  border-color: #6366f1;
  border-style: solid;
  color: #312e81;
}

.waypoint-row {
  position: relative;
  margin-bottom: 0;
  overflow: visible;
}

.waypoint-row--pinned .waypoint-row__line {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  padding: 2px 4px 2px 2px;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  opacity: 0.82;
}

.waypoint-row__line {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow: visible;
}

.waypoint-row__poi {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
}

.waypoint-row__poi:focus {
  outline: none;
}

.waypoint-row__poi:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.waypoint-row__poi:hover svg {
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.3));
}

.waypoint-row__poi svg {
  display: block;
  width: 22px;
  height: 28px;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.2));
}

.waypoint-row__poi-shape {
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.1px;
}

.waypoint-row__poi--start {
  color: #16a34a;
}

.waypoint-row__poi--end {
  color: #dc2626;
}

.waypoint-row__poi--via {
  color: #2563eb;
}

.waypoint-row__grip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  cursor: grab;
  user-select: none;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}

.waypoint-row__type {
  flex-shrink: 0;
  align-self: stretch;
  width: 34px;
  min-width: 34px;
  padding: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.waypoint-row__vis {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.waypoint-row__visible {
  margin: 0;
}

.waypoint-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.waypoint-info__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  min-width: min(100%, max-content);
}

.waypoint-info__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #334155;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.waypoint-info__flag {
  flex: none;
  font-size: 0.9rem;
  line-height: 1;
}

.waypoint-info__label {
  flex: none;
  width: 14ch;
  max-width: 14ch;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px 5px;
  box-sizing: border-box;
}

.waypoint-info__label--clickable {
  cursor: pointer;
}

.waypoint-info__label--clickable:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15) inset;
}

.waypoint-info__label--clickable:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.waypoint-info__trail {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.waypoint-info__dist {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.waypoint-info__dist-km {
  flex: none;
  min-width: 0;
  width: 9ch;
  max-width: 9ch;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px 4px;
  box-sizing: border-box;
}

.waypoint-info__dist-time {
  flex: none;
  min-width: 0;
  width: 9ch;
  max-width: 9ch;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px 4px;
  box-sizing: border-box;
}

.waypoint-info__weather {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}

.waypoint-info__weather .map-wp-weather-badge,
.waypoint-info__weather .map-wp-weather-badge--loading,
.waypoint-info__weather .map-wp-weather-badge--na {
  box-shadow: none;
  backdrop-filter: none;
  font-size: 10px;
  padding: 2px 6px;
  min-height: 20px;
}

.waypoint-info__sub {
  display: none;
}

.waypoint-row__type:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.waypoint-row__type:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.waypoint-row__grip:hover {
  background: #e2e8f0;
  color: #64748b;
}

.waypoint-row__grip:active {
  cursor: grabbing;
}

.waypoint-row__grip--disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.waypoint-row__pin {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  align-self: flex-start;
  width: 42px;
  height: 38px;
  margin: -6px 2px 0 6px;
  padding: 0 2px 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  overflow: visible;
}

.waypoint-row__pin svg {
  overflow: visible;
  display: block;
}

.waypoint-row__pin:focus {
  outline: none;
}

.waypoint-row__pin:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 8px;
}

.waypoint-row__pin-visual {
  display: block;
  pointer-events: none;
  transform-origin: 50% 92%;
  transition: transform 0.15s ease;
}

.waypoint-row__pin:hover .waypoint-row__pin-visual {
  transform: scale(1.06);
}

.waypoint-row__pin--active .waypoint-row__pin-visual {
  transform: rotate(-4deg) scale(1.08);
  filter: drop-shadow(0 3px 5px rgba(22, 163, 74, 0.35));
}

.waypoint-row__pin-figure {
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.2));
}

.waypoint-row__pin--active .waypoint-row__pin-figure circle {
  fill: #16a34a !important;
}

.waypoint-row__pin--active .waypoint-row__pin-figure ellipse {
  fill: #bbf7d0 !important;
}

.waypoint-row--dragging {
  opacity: 0.65;
}

.waypoint-row__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

.waypoint-row__input-wrap .field__input {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.875rem;
}

.waypoint-row__input-wrap .waypoint-display-name {
  margin-top: 0;
  font-size: 0.78rem;
}

.waypoint-row__input-wrap .waypoint-input,
.waypoint-row__input-wrap .waypoint-display-name {
  flex: 1;
}

.waypoint-row__extra-wrap {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.waypoint-row__extra-checkbox {
  margin: 0;
}

.waypoint-row__input-wrap .field__input:disabled {
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  border-color: #cbd5e1;
}

.waypoint-row__input-wrap .suggest {
  margin-top: 4px;
}

.waypoint-row__remove {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  width: 30px;
  min-height: 36px;
  align-self: stretch;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.waypoint-row__remove:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.waypoint-row__remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.field {
  position: relative;
  margin-bottom: 14px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
}

.field__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  outline: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: #94a3b8;
}

.field__input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.field__input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select.field__input.field__select {
  cursor: pointer;
  min-height: 42px;
  padding-right: 10px;
}

#settings-vehicle-octane-wrap[hidden] {
  display: none !important;
}

.suggest {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  z-index: 2;
}

.suggest[hidden] {
  display: none !important;
}

.suggest__item {
  padding: 10px 12px;
  font-size: 0.875rem;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.35;
  border-bottom: 1px solid #f1f5f9;
}

.suggest__item:last-child {
  border-bottom: none;
}

.suggest__item:hover,
.suggest__item:focus {
  background: #f1f5f9;
  outline: none;
}

.suggest__title {
  font-weight: 500;
}

.suggest__sub {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #64748b;
}

.btn-secondary {
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #64748b;
  color: #0f172a;
}

.btn-primary {
  width: 100%;
  margin-top: 0;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.route-alternatives {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.route-alternatives[hidden] {
  display: none !important;
}

.route-alt__row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.route-alt__btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.35;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.route-alt__btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.route-alt__btn.is-active {
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.route-alt__dismiss {
  flex-shrink: 0;
  width: 32px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 600;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.route-alt__dismiss:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.route-alt__dismiss:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.panel-block {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.panel-block:first-of-type {
  margin-top: 0;
}

.panel-block__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.panel-block__summary::-webkit-details-marker {
  display: none;
}

.panel-block__summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748b;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

details.panel-block:not([open]) .panel-block__summary::before {
  transform: rotate(-90deg);
}

.panel-block__title {
  flex: 1;
}

.panel-block__hint {
  margin: 0 0 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
  font-weight: 500;
}

.stops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.stops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.stops-actions .btn-secondary {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

.hotel-card {
  padding: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  overflow: visible;
}

#hotels-dialog .hotel-card.hotel-card--tone-a {
  background: rgba(255, 251, 235, 0.32) !important;
  border-color: rgba(253, 230, 138, 0.48) !important;
}

#hotels-dialog .hotel-card.hotel-card--tone-b {
  background: rgba(241, 245, 249, 0.36) !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
}

.hotels-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.hotels-dialog__title-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.hotels-dialog__title-row .map-settings-dialog__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.hotels-dialog__totals {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 52%);
  isolation: isolate;
  position: relative;
  z-index: 1;
}

.hotels-dialog__total {
  flex: 1 1 calc(50% - 8px);
  min-width: min(140px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}

.hotels-dialog__total--paid {
  color: #166534;
  background: #ecfdf5;
  border-color: #86efac;
}

.hotels-dialog__total--unpaid {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}

.hotels-dialog__top-actions {
  display: flex;
  gap: 8px;
}

.hotels-dialog__top-actions .btn-primary {
  flex: 1;
  width: auto;
  margin-bottom: 0;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.hotels-grid--v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Отели: не сжимать зелёную/красную суммы (общий .hotels-dialog__totals даёт max-width 52% + min-width:0 ломал строку). */
#hotels-dialog .hotels-dialog__totals {
  flex-wrap: nowrap;
  max-width: min(100%, 86%);
  flex: 1 1 auto;
}

#hotels-dialog .hotels-dialog__total {
  flex: 1 1 calc(50% - 4px);
  min-width: min(7.25rem, 48%);
  max-width: calc(50% - 4px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  padding: 7px 10px;
}

.hotels2-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 2px solid #4b5563;
  border-radius: 8px;
  background: #e5e7eb;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.15);
}

.hotels2-row--tone-b {
  background: #e7d4bc;
  border-color: #7c2d12;
}

.hotels2-row .field__input {
  min-height: 30px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.hotels2-row__view,
.hotels2-row__edit {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.hotels2-row__view {
  grid-template-columns: 34px 34px minmax(104px, 124px) minmax(120px, 160px) minmax(86px, 1fr) minmax(86px, 1fr) minmax(86px, 112px) minmax(104px, 124px) minmax(122px, 146px) auto;
}

.hotels2-row__edit {
  grid-template-columns: 34px 34px minmax(104px, 124px) minmax(120px, 160px) minmax(86px, 1fr) minmax(86px, 1fr) minmax(86px, 112px) minmax(104px, 124px) minmax(122px, 146px) minmax(88px, 120px) auto;
}

.hotels2-row__view[hidden],
.hotels2-row__edit[hidden] {
  display: none !important;
}

.hotels2-view-name,
.hotels2-view-date,
.hotels2-view-breakfast,
.hotels2-view-city,
.hotels2-view-price,
.hotels2-view-paid,
.hotels2-view-booking {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.8rem;
  color: #1f2937;
}

.hotels2-view-date,
.hotels2-view-price,
.hotels2-view-booking {
  justify-content: center;
  text-align: center;
}

.hotels2-view-city {
  justify-content: center;
  text-align: center;
}

.hotels2-view-date,
.hotels2-view-booking {
  font-weight: 600;
}

.hotels2-view-breakfast {
  justify-content: center;
  text-align: center;
  font-weight: 700;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.hotels2-view-breakfast--yes {
  color: #166534;
}

.hotels2-view-breakfast--no {
  color: #991b1b;
}

.hotels2-view-booking--dot {
  position: relative;
}

.hotels2-view-booking--dot::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #dc2626;
  display: inline-block;
}

.hotels2-view-name-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 1px 5px;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1d4ed8;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 600;
  cursor: default;
  box-shadow: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.hotels2-show-address {
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hotels2-view-name-btn--link {
  cursor: pointer;
  color: #1d4ed8;
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
}

.hotels2-view-name-btn--link:hover {
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  box-shadow: none;
}

.hotels2-view-name-btn--link:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.16),
    inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

.hotels2-view-name-btn--link:focus,
.hotels2-view-name-btn--link:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.hotels2-view-city {
  font-weight: 600;
}

.hotels2-view-date--sunday {
  color: #b91c1c;
  font-weight: 700;
}

.hotels2-view-price--paid {
  color: #166534;
  background: #ecfdf5;
  border-color: #86efac;
}

.hotels2-view-price--unpaid {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}

.hotels2-view-idx,
.hotels2-edit-idx {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
}

.hotels2-view-actions,
.hotels2-edit-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.hotels2-row .hotels2-paid-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.hotels2-row .hotels2-remove {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 8px;
}

.hotels2-row .hotels2-save,
.hotels2-row .hotels2-cancel,
.hotels2-row .hotels2-edit {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.72rem;
  border-radius: 8px;
}

.hotels2-show-on-map {
  min-height: 32px;
  padding: 2px 8px;
  font-size: 0.86rem;
  border-radius: 8px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .hotels2-row__view,
  .hotels2-row__edit {
    grid-template-columns: 1fr;
  }

  .hotels2-view-actions,
  .hotels2-edit-actions {
    justify-content: stretch;
  }

  .hotels2-show-on-map,
  .hotels2-show-address,
  .hotels2-view-name-btn {
    width: 100% !important;
    min-height: 34px !important;
    height: 34px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    align-self: stretch;
    justify-content: center !important;
    font-size: 0.86rem;
  }
}

#add-hotel {
  flex: 1 1 auto;
}

.hotel-card__line {
  display: grid;
  grid-template-columns: 34px 34px 90px 132px 132px 92px 186px 16ch 7ch 330px 82px 52px 52px 1fr 74px 74px;
  gap: 3px;
  align-items: center;
  min-width: 1674px;
}

.hotel-card__city-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
}

.hotel-card__city-wrap .field__input {
  width: 100%;
}

.hotel-card__city-wrap .suggest {
  z-index: 20;
}

.hotel-card__btn {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 0.68rem;
  border-radius: 6px;
}

.hotel-card__edit .field__input {
  min-height: 24px;
  padding: 4px 6px;
  font-size: 0.74rem;
  border-radius: 7px;
}

.hotel-card__edit .hotel-card__booking-url {
  font-size: 0.7rem;
}

.hotel-card__edit .hotel-card__phone {
  margin-right: -4px;
}

.hotel-card__edit .hotel-card__price {
  margin-left: -4px;
  padding-left: 1px !important;
  padding-right: 1px !important;
}

.hotel-card__phone {
  -webkit-appearance: none;
  appearance: none;
  background-image: none !important;
  padding-right: 0 !important;
  padding-left: 4px !important;
}

.hotel-card__edit .hotel-card__phone {
  width: 16ch !important;
  min-width: 16ch !important;
  max-width: 16ch !important;
  justify-self: start;
  font-variant-numeric: tabular-nums;
}

.hotel-card__phone::-webkit-contacts-auto-fill-button,
.hotel-card__phone::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  margin: 0;
  width: 0;
}

.hotel-card__edit .hotel-card__idx {
  text-align: center;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
}

.hotel-card__edit .hotel-card__btn {
  min-height: 16px;
  padding: 1px 5px;
  font-size: 0.64rem;
}

.hotel-card__edit .hotel-row__save,
.hotel-card__edit .hotel-row__cancel {
  justify-self: end;
}

.hotel-card__view-actions .hotel-card__btn.stop-row__map-btn {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 0.68rem;
  border-radius: 6px;
  line-height: 1.15;
}

.hotel-card__view-line > .hotel-row__remove {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 0.68rem;
  border-radius: 6px;
  line-height: 1.15;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fca5a5;
  justify-content: center;
}

.hotel-card__view-line > .hotel-row__remove:hover {
  color: #ffffff;
  background: #dc2626;
  border-color: #b91c1c;
}

.hotel-card__view-line > .hotel-row__duplicate,
.hotel-card__view-line > .hotel-row__edit,
.hotel-card__view-line > .hotel-row__remove {
  justify-self: end;
  margin-left: 0;
  overflow: visible;
}

.hotel-card__view-line > .hotel-row__edit {
  margin-left: 0;
  margin-right: 0;
}

.hotel-card__view-line > .hotel-row__remove {
  margin-left: 0;
}

.hotel-card__flag {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.68rem;
  color: #334155;
  white-space: nowrap;
}

.hotel-card__flag input[type='checkbox'] {
  margin: 0 1px 0 0;
}

.hotel-card__paid {
  margin-left: 10px;
}

.hotel-card__breakfast {
  margin-left: 10px;
}

.hotel-card__flag--paid {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #cbd5e1;
}

.hotel-card__flag--breakfast {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #cbd5e1;
}

.hotel-card__flag--paid,
.hotel-card__flag--breakfast {
  font-size: 0.76rem;
  font-weight: 700;
}

.hotel-card__view {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: auto;
  overflow-y: visible;
}

.hotel-card__view[hidden],
.hotel-card__edit[hidden] {
  display: none !important;
}

.hotel-card--editing .hotel-card__view {
  display: none !important;
}

.hotel-card:not(.hotel-card--editing) .hotel-card__edit {
  display: none !important;
}

.hotel-card__view-line {
  display: grid;
  grid-template-columns: 34px 32px 82px 118px 118px 82px 132px 66px 72px 118px 88px 84px 1fr 92px 92px 92px;
  gap: 2px;
  align-items: center;
  padding: 0;
  min-width: 1548px;
  font-size: 0.8rem;
  color: #334155;
  border: 1px solid #f3e8c0;
  border-radius: 8px;
  background: #fffdf5;
}

#hotels-dialog .hotel-card.hotel-card--tone-a .hotel-card__view-line {
  background: #fffdf5;
  border-color: #f3e8c0;
}

#hotels-dialog .hotel-card.hotel-card--tone-b .hotel-card__view-line {
  background: #eaf2ff;
  border-color: #a5b4fc;
}

.hotel-card__view-line > .hotel-view-meals {
  grid-column: 12;
  overflow: visible;
  text-overflow: clip;
}

.hotel-card__view-line > .hotel-view-note {
  grid-column: 13;
  justify-self: stretch;
}

.hotel-card__view-line > .hotel-row__duplicate {
  grid-column: 14;
}

.hotel-card__view-line > .hotel-row__edit {
  grid-column: 15;
}

.hotel-card__view-line > .hotel-row__remove {
  grid-column: 16;
}

.hotel-view-departure-city {
  font-size: 0.735rem;
  font-weight: 600;
}

.hotel-view-arrival-city {
  font-size: 0.86rem;
  font-weight: 600;
}

.hotel-view-cancel {
  font-size: 0.86rem;
  font-weight: 600;
}

.hotel-view-price {
  font-size: 0.86rem;
  font-weight: 600;
}

.hotel-view-price--paid {
  color: #15803d;
}

.hotel-view-price--unpaid {
  color: #b91c1c;
}

.hotel-view-map-icon {
  min-height: 18px;
  padding: 1px 4px;
  font-size: 0.78rem;
}

.hotel-view-idx {
  justify-content: center;
  font-weight: 600;
  font-size: 0.74rem;
}

.hotel-view-arrival-date {
  justify-content: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: #1e293b;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.hotel-view-arrival-date--sunday {
  color: #b91c1c;
}

.hotel-view-distance {
  justify-content: center;
  font-weight: 600;
}

.hotel-view-booked {
  justify-content: center;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}

.hotel-view-booked-label {
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
}

.hotel-view-booked-dot {
  font-size: 0.88rem;
  line-height: 1;
}

.hotel-view-booked--none {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}

.hotel-view-booked-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
}

.hotel-view-breakfast-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
}

.hotel-view-meals {
  font-size: 0.86rem;
  font-weight: 600;
}

.hotel-view-meals--yes {
  color: #15803d;
}

.hotel-view-meals--no {
  color: #b91c1c;
}

.hotel-view-note {
  min-height: 24px;
  padding: 3px 6px !important;
  font-size: 0.73rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hotel-card__view-line > * {
  min-height: 30px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border-right: 1px solid #f7f0d6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hotel-view-cell--ghost {
  visibility: hidden !important;
  pointer-events: none !important;
}

.hotel-card__view-line > *:last-child {
  border-right: none;
}

.hotel-view-name--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1d4ed8;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.hotel-view-name--btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  box-shadow: none;
}

.hotel-view-name--btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.16),
    inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

.hotel-view-name--btn:focus {
  outline: none !important;
  box-shadow: none !important;
}

.hotel-view-name--btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.hotel-card__view-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.hotel-address-dialog__text {
  margin: 0 0 40px;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
  text-align: center;
}

.stop-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.06);
}

.stop-row__line {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.stop-row__badge {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  border: 1px solid #d97706;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.stop-row__badge:hover {
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

.stop-row__badge:focus {
  outline: none;
}

.stop-row__badge:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.stop-row__badge--muted {
  opacity: 0.55;
  cursor: default;
}

.stop-row__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
}

.stop-row__note {
  margin: 0;
  font-size: 0.8125rem;
}

.stop-row__map-btn {
  flex-shrink: 0;
  align-self: stretch;
  padding: 0 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.stop-row__map-btn:hover {
  background: #fde68a;
  border-color: #fbbf24;
}

.stop-row__map-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.stop-row__map-btn.is-armed {
  background: #fef08a;
  border-color: #ca8a04;
  color: #713f12;
}

.stop-row__remove {
  flex-shrink: 0;
  width: 32px;
  min-height: 36px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.stop-row__remove:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.panel__pick-hint--stop {
  color: #b45308;
}

.map-root.map--pick-stop,
.map-root.map--pick-stop .leaflet-grab,
.map-root.map--pick-stop .leaflet-dragging .leaflet-grab {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='40' viewBox='0 0 32 40'%3E%3Cpath fill='%23f59e0b' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round' d='M16 2C9.4 2 4.2 7.2 4.2 13.8c0 5.2 8.5 15.6 11.8 23.2.2.4.4.6.6 0 3.3-7.6 11.8-18 11.8-23.2C27.8 7.2 22.6 2 16 2z'/%3E%3Ccircle cx='16' cy='14' r='4.5' fill='%23ffffff'/%3E%3C/svg%3E")
      16 36,
    crosshair !important;
}

.panel-block__content {
  padding: 8px 10px 10px;
  border-top: 1px solid #e2e8f0;
}

.panel-block__content--fuel {
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 500;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.route-fuel-estimate__hint {
  margin: 0;
  color: #64748b;
  font-style: italic;
  font-weight: 400;
}

.route-fuel-estimate__vehicle {
  margin-bottom: 12px;
}

.route-fuel-estimate__vehicle:last-child {
  margin-bottom: 0;
}

.route-fuel-estimate__vehicle-title {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.route-fuel-estimate__row {
  margin-bottom: 0;
  padding-left: 0;
  font-weight: 600;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(64px, 1fr) minmax(72px, 1fr) minmax(72px, 1.05fr);
  align-items: start;
  border: 1px solid #e5e7eb;
  border-top: 0;
  background: #ffffff;
}

.route-fuel-estimate__total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
}

.route-fuel-estimate__vehicle .route-fuel-estimate__row:first-of-type {
  border-top: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
}

.route-fuel-estimate__vehicle .route-fuel-estimate__row:last-of-type {
  border-radius: 0 0 8px 8px;
}

.route-fuel-estimate__col {
  min-height: 28px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid #e5e7eb;
  min-width: 0;
}

.route-fuel-estimate__col:last-child {
  border-right: none;
}

.route-fuel-estimate__col--country {
  color: #1f2937;
  font-weight: 600;
}

.route-fuel-estimate__col--liters,
.route-fuel-estimate__col--rub,
.route-fuel-estimate__col--nat {
  color: #334155;
  justify-content: center;
  text-align: center;
}

.route-fuel-estimate__col--nat {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.3;
  min-height: auto;
  padding-top: 5px;
  padding-bottom: 5px;
}

.route-countries {
  margin-top: 0;
  padding: 10px 10px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  /* Как .panel-block__content--fuel + строки топлива — явно, без расхождений с inherit */
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.route-countries[hidden] {
  display: none !important;
}

.route-countries__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  color: #1e293b;
}

.route-countries__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.route-countries__item:last-child {
  margin-bottom: 0;
}

.route-countries__flag {
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1.35;
}

.route-countries__body {
  flex: 1;
  min-width: 0;
}

.route-countries__label {
  margin-bottom: 4px;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  color: #1e293b;
}

.route-countries__bar-bg {
  height: 6px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.route-countries__bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.route-countries__total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 700;
  color: #0f172a;
}

.route-countries__warn {
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 400;
  color: #b45309;
  font-style: italic;
}

.panel__hint {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: #b45309;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.panel__hint--ok {
  color: #15803d;
}

.panel__hint--pending {
  color: #475569;
  font-style: italic;
}

.panel__hint.panel__hint--pending {
  animation: panel-hint-pulse 1.1s ease-in-out infinite;
}

@keyframes panel-hint-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

/* Маркеры точек маршрута (DivIcon) */
.map-wp-poi-icon {
  background: transparent !important;
  border: none !important;
}

.map-wp-poi-icon .map-wp-poi {
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.28));
  position: relative;
}

.map-wp-poi-icon .map-wp-poi svg {
  display: block;
}

.map-wp-poi--via-emoji {
  position: relative;
}

.map-wp-poi__emoji {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.map-wp-weather-icon {
  background: transparent !important;
  border: none !important;
}

.map-wp-weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
}

.map-wp-weather-badge__emoji {
  line-height: 1;
}

.map-wp-weather-badge__temp {
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.map-wp-weather-badge--loading,
.map-wp-weather-badge--na {
  color: #64748b;
}

/* Подписи точек на карте — не теряются на фоне линии маршрута */
.leaflet-tooltip.wp-marker-label {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 2px 8px rgba(15, 23, 42, 0.18);
  z-index: 800 !important;
}

/* -------------------------------------------------------------------------- */
/* iPhone и узкие телефоны: плашки не перекрывают друг друга (iPad не трогаем) */
/* -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .panel-dock {
    top: max(4px, env(safe-area-inset-top, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(
      50vh,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 356px)
    );
  }

  .panel {
    max-height: min(
      50vh,
      calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 356px)
    );
  }

  /* Верхняя панель развернута, нижняя свернута (только стрелка): маршрут почти на весь экран с зазором над стрелкой. */
  .panel-dock:not(.panel-dock--collapsed) {
    transition: max-height 0.24s ease;
  }

  /* Нижняя панель свернулась (только стрелка): класс ставит script.js — см. syncMapStyleCollapsedAttributes */
  body.map-style-bottom-collapsed .panel-dock:not(.panel-dock--collapsed),
  html.map-style-bottom-collapsed .panel-dock:not(.panel-dock--collapsed) {
    max-height: calc(
      100dvh - max(4px, env(safe-area-inset-top, 0px)) - max(10px, env(safe-area-inset-bottom, 0px)) - 38px -
        6px - 19px
    );
  }

  body.map-style-bottom-collapsed .panel-dock:not(.panel-dock--collapsed) .panel,
  html.map-style-bottom-collapsed .panel-dock:not(.panel-dock--collapsed) .panel {
    max-height: calc(
      100dvh - max(4px, env(safe-area-inset-top, 0px)) - max(10px, env(safe-area-inset-bottom, 0px)) - 38px -
        6px - 19px - 38px
    );
  }

  /* Как на ПК / iPad: колонка; 1-я строка — три равные иконки, остальное на всю ширину */
  .map-style-panel {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 12px 10px 0;
    border-radius: 16px 16px 0 0;
  }

  .map-style-panel .map-style__section {
    width: 100%;
    box-sizing: border-box;
  }

  .map-style-panel .map-style__toolbar {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
    margin-bottom: 0;
  }

  .map-style-panel .map-style__icon-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .map-style-panel .map-style__fx-btn {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    padding: 8px 10px;
  }

  .map-style-panel .map-style__btn {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 0.6875rem;
  }

  .map-style-panel .map-style__collapse-toggle {
    width: calc(100% + 20px);
    margin: 8px -10px 0;
    flex: 0 0 auto;
    align-self: center;
    border-radius: 0 0 12px 12px;
  }

  .map-style-panel--collapsed {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    padding-bottom: 0;
  }

  .map-style-panel--collapsed .map-style__collapse-toggle {
    width: auto;
    min-width: 42px;
    padding: 6px 12px;
    margin: 0;
    border-radius: 12px;
  }

  /* Для нижней панели в мобильной версии: направление стрелки = ожидаемое действие. */
  .map-style-panel:not(.map-style-panel--collapsed) .map-style__collapse-icon--collapse {
    display: none;
  }
  .map-style-panel:not(.map-style-panel--collapsed) .map-style__collapse-icon--expand {
    display: inline;
  }
  .map-style-panel--collapsed .map-style__collapse-icon--expand {
    display: none;
  }
  .map-style-panel--collapsed .map-style__collapse-icon--collapse {
    display: inline;
  }

  /* Панель карты стала выше (столбик кнопок) — zoom ниже */
  .map-root .leaflet-top.leaflet-left {
    top: auto !important;
    bottom: calc(360px + env(safe-area-inset-bottom, 0px)) !important;
    left: max(10px, env(safe-area-inset-left, 0px)) !important;
  }

  /* Плашки точек: сетка — город забирает свободное место, справа погода+км+время без «дыры» и без обрезки по ch */
  .waypoint-info-list {
    overflow-x: hidden;
    touch-action: pan-y;
  }

  .waypoint-info__item {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) minmax(0, max-content);
    align-items: center;
    column-gap: 4px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
  }

  .waypoint-info__num {
    width: 19px;
    height: 19px;
    font-size: 0.65rem;
  }

  .waypoint-info__flag {
    font-size: 0.85rem;
  }

  .waypoint-info__label {
    min-width: 0;
    width: auto;
    max-width: none;
    font-size: 0.75rem;
    padding: 3px 5px;
    border-radius: 7px;
  }

  .waypoint-info__trail {
    margin-left: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    justify-self: end;
    justify-content: flex-end;
    min-width: 0;
    width: max-content;
    max-width: 100%;
  }

  .waypoint-info__dist {
    font-size: 0.72rem;
    gap: 2px;
  }

  .waypoint-info__dist-km,
  .waypoint-info__dist-time {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 2px 4px;
    font-size: 0.72rem;
    border-radius: 7px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .waypoint-info__weather .map-wp-weather-badge,
  .waypoint-info__weather .map-wp-weather-badge--loading,
  .waypoint-info__weather .map-wp-weather-badge--na {
    font-size: 9px;
    padding: 2px 5px;
    min-height: 18px;
    border-radius: 6px;
  }

  .route-fuel-estimate__vehicle-title {
    font-size: 0.8rem;
  }

  .route-fuel-estimate__row {
    grid-template-columns: minmax(0, 1.05fr) minmax(52px, 1fr) minmax(56px, 1fr) minmax(56px, 1fr);
    font-size: 0.7rem;
  }

  .route-fuel-estimate__col {
    padding: 3px 4px;
    min-height: 24px;
  }

  .route-fuel-estimate__total {
    font-size: 0.72rem;
  }

  .route-editor-dialog,
  .map-settings-dialog,
  .google-maps-settings-dialog {
    width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    max-height: calc(
      100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    );
  }

  /* Отели: снизу оставляем полосу под тап по подложке (закрытие по клику вне формы). */
  #hotels-dialog {
    top: max(12px, env(safe-area-inset-top, 0px)) !important;
    bottom: calc(52px + max(12px, env(safe-area-inset-bottom, 0px))) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  }

  .route-editor-dialog__form,
  .map-settings-dialog__form {
    padding: 14px 14px 12px;
  }

  .waypoint-row__line {
    flex-wrap: wrap;
  }

  .waypoint-row__input-wrap {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Отели: форма редактирования — столбик и крупная зона касания «Готово» (узкая сетка 1600+ px ломала тап на телефоне) */
  .hotel-card__line.hotel-card__edit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    box-sizing: border-box;
  }

  .hotel-card__line.hotel-card__edit > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
  }

  .hotel-card__line.hotel-card__edit .hotel-card__city-wrap {
    width: 100%;
  }

  .hotel-card__line.hotel-card__edit .hotel-row__save,
  .hotel-card__line.hotel-card__edit .hotel-row__cancel {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.88rem;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
  }

  .map-layer-dropdown__menu {
    max-height: min(40vh, 220px);
    overflow-y: auto;
  }

  /* Курсы: по центру экрана, столбик, компактнее шрифт (ПК / iPad без этого блока) */
  .map-fx-dialog {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(
      100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    );
  }

  .map-fx-dialog__inner {
    padding: 10px 12px;
  }

  .map-fx-dialog__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .map-fx-dialog__row {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    align-items: center;
    text-align: center;
  }

  .map-fx-dialog__row-main {
    font-size: 0.78rem;
    line-height: 1.25;
    width: 100%;
    text-align: center;
  }

  .map-fx-dialog__row-rate {
    font-size: 0.72rem;
    line-height: 1.3;
    width: 100%;
    text-align: center;
  }

  .map-fx-dialog__loading,
  .map-fx-dialog__empty,
  .map-fx-dialog__error {
    font-size: 0.78rem;
    max-width: 100%;
    text-align: center;
  }
}
