*,
*::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: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  padding: 8px 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: 36px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.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-style__fx-btn svg {
  flex-shrink: 0;
}

.map-style__fx-btn-label {
  line-height: 1.2;
}

.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);
}

.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: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.map-fx-dialog__row-main {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

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

.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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.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-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__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__provider-select {
  font-weight: 500;
}

.map-style__section--map-layer {
  position: relative;
  z-index: 2;
}

.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: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.hotels-dialog__title-row .map-settings-dialog__title {
  margin: 0;
  text-align: center;
  align-self: center;
}

.hotels-dialog__totals {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  width: 100%;
  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 .hotels-dialog__totals {
  flex-wrap: nowrap;
}

#hotels-dialog .hotels-dialog__total {
  flex: 1 1 50%;
  min-width: 0;
}

.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(130px, 1.7fr) minmax(72px, 0.9fr) minmax(96px, 1.1fr) minmax(90px, 1.1fr);
  align-items: stretch;
  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;
}

.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-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(10px, 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) - 140px)
    );
  }

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

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

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

  body:has(#map-style-wrap.map-style-panel--collapsed)
    .panel-dock:not(.panel-dock--collapsed)
    .panel {
    max-height: calc(
      100dvh - max(10px, env(safe-area-inset-top, 0px)) - max(10px, env(safe-area-inset-bottom, 0px)) - 38px -
        6px - 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__section--map-layer {
    width: 100%;
    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(268px + 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(78px, 1.15fr) minmax(46px, 0.62fr) minmax(58px, 0.88fr) minmax(58px, 0.88fr);
    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;
  }
}
