/* styles.css — оформление калькулятора доставки.
   Концепт «Trustworthy Minimal»: светлая база, один точный градиент, мягкие тени,
   крупные тач-цели, читаемость на улице. Тёмная тема — опция того же бренда. */

/* ---------- Темы ---------- */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --border: #e6eaf0;
  --text: #0e1726;
  --text-2: #5b6577;
  --accent: #2563eb;
  --accent-2: #4f8cff;
  --gradient: linear-gradient(135deg, #2563eb 0%, #4f8cff 100%);
  --success: #16a34a;
  --warn: #d97706;
  --warn-text: #b45309; /* затемнённый янтарь для текста: контраст на белом ≥ 4.5:1 */
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(16, 23, 38, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 23, 38, 0.08);
  --shadow-cta: 0 8px 24px rgba(37, 99, 235, 0.28);
  --radius: 16px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #141c2b;
    --surface-2: #1b2536;
    --border: #243047;
    --text: #eaf0fa;
    --text-2: #9aa7bd;
    --accent: #4f8cff;
    --accent-2: #6ea3ff;
    --warn-text: #fbbf24; /* светлый янтарь для текста на тёмном фоне */
    --gradient: linear-gradient(135deg, #2f6df0 0%, #6ea3ff 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-cta: 0 10px 30px rgba(47, 109, 240, 0.4);
  }
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #141c2b;
  --surface-2: #1b2536;
  --border: #243047;
  --text: #eaf0fa;
  --text-2: #9aa7bd;
  --accent: #4f8cff;
  --accent-2: #6ea3ff;
  --gradient: linear-gradient(135deg, #2f6df0 0%, #6ea3ff 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-cta: 0 10px 30px rgba(47, 109, 240, 0.4);
}

/* ---------- База ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Атрибут hidden всегда побеждает любой display из классов (skeleton, overlay и т.д.).
   Без этого .skeleton-card{display:flex}/.overlay{display:flex} игнорируют hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

body.no-scroll { overflow: hidden; }

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ---------- Шапка ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { font-size: 22px; }
.brand-accent { color: var(--accent); }
.header-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.95); }

/* переключатель темы: показываем иконку текущей темы */
.theme-icon-dark { display: none; }
.theme-icon-light { display: inline; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
}

/* ---------- Баннер ---------- */
.banner {
  /* фоллбэки полупрозрачным цветом — работают и в светлой, и в тёмной теме,
     если браузер не знает color-mix (Safari < 16.2, старые WebView) */
  background: rgba(217, 119, 6, 0.14);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}
.banner-hidden { display: none; }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}

/* ---------- Ввод ---------- */
.origin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.origin-chip strong { color: var(--text); font-weight: 600; }

.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute; left: 14px;
  font-size: 16px; pointer-events: none; opacity: 0.7;
}
.text-input {
  width: 100%;
  height: 52px;
  padding: 0 44px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input::placeholder { color: var(--text-2); opacity: 0.7; }
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.text-input.input-error { border-color: var(--danger); }
.clear-btn {
  position: absolute; right: 10px;
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}

/* выпадающий список автоподсказок адреса */
.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  z-index: 40;
  -webkit-overflow-scrolling: touch;
}
.suggest-item {
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.suggest-item:hover,
.suggest-item.active { background: var(--surface-2); }
.suggest-title { font-size: 15px; font-weight: 500; color: var(--text); }
.suggest-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }

/* ---------- Параметр (подпись + поле, используется в блоке габаритов) ---------- */
.param { display: flex; flex-direction: column; gap: 8px; }
.param-label { font-size: 13px; font-weight: 500; color: var(--text-2); }

/* габариты */
.dims-row { margin-top: 14px; }
.dims-inputs { display: flex; align-items: center; gap: 8px; }
.dim-input {
  width: 100%; height: 44px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text); font-size: 16px;
}
.dim-input:focus { outline: none; border-color: var(--accent); }
.dim-x { color: var(--text-2); font-weight: 600; }

/* ---------- Скелетон ---------- */
.skeleton-card { display: flex; flex-direction: column; gap: 12px; }
.sk-map { height: 150px; border-radius: 12px; }
.sk-total { height: 48px; width: 60%; border-radius: 10px; }
.sk-row { height: 18px; border-radius: 6px; }
.sk-row:nth-child(4) { width: 80%; }
.sk-row:nth-child(5) { width: 65%; }
.sk-hint { text-align: center; color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 4px; }
.shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Ошибка ---------- */
.error-box {
  background: rgba(239, 68, 68, 0.12);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 14px;
}

/* ---------- Результат ---------- */
.result { animation: fadeUp 0.4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.map-card { padding: 0; overflow: hidden; position: relative; }
.map { width: 100%; height: 200px; background: var(--surface-2); }
.distance-badge {
  /* верхний-левый угол: не перекрывает копирайт Яндекса (низ-лево) и зум (верх-право) */
  position: absolute; left: 12px; top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  z-index: 1;
}

.total-card { text-align: center; padding: 24px 18px; }
.total-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.total-value {
  font-size: 46px; font-weight: 800; letter-spacing: -0.02em;
  margin: 6px 0 2px;
  color: var(--accent); /* гарантированный цвет суммы, если градиентный текст не поддержан */
  font-variant-numeric: tabular-nums;
}
/* Градиентный текст — только там, где background-clip:text реально работает,
   иначе сумма (самый важный элемент) стала бы прозрачной и невидимой */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .total-value {
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.total-sub { font-size: 13px; color: var(--text-2); min-height: 16px; }
.total-sub.warn { color: var(--warn-text); font-weight: 600; }

.breakdown-card { padding: 8px 18px; }
.breakdown-head { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding: 12px 0 6px; }
.breakdown-rows { display: flex; flex-direction: column; }
.brk-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.brk-row:first-child { border-top: none; }
.brk-label { color: var(--text-2); }
.brk-value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.brk-add .brk-value { color: var(--warn); }
.brk-muted { font-size: 13px; }
.brk-muted .brk-label, .brk-muted .brk-value { color: var(--text-2); }
.brk-total {
  border-top: 2px solid var(--border);
  margin-top: 2px;
  padding: 14px 0 4px;
}
.brk-total .brk-label { font-size: 16px; font-weight: 700; color: var(--text); }
.brk-total .brk-value { font-size: 20px; font-weight: 800; color: var(--text); }

.brk-in { opacity: 0; animation: brkIn 0.35s ease forwards; }
@keyframes brkIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.method { margin: 4px 4px 14px; }
.method summary {
  cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 600;
  padding: 6px 0; list-style: none;
}
.method summary::-webkit-details-marker { display: none; }
.method summary::before { content: "ⓘ "; }
.method-body { font-size: 14px; color: var(--text-2); padding: 6px 0 0; }
.method-body p { margin-bottom: 6px; }
.method-body b { color: var(--text); }
.method-note { font-size: 13px; opacity: 0.85; }

.result-actions { display: flex; gap: 10px; }

/* ---------- Кнопки ---------- */
.btn {
  height: 52px; border: none; border-radius: 14px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
/* видимый фокус для клавиатуры / VoiceOver на всех кнопках */
.icon-btn:focus-visible, .stepper-btn:focus-visible, .btn:focus-visible, .clear-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-cta); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(37, 99, 235, 0.38); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); flex: 1; }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); padding: 0 14px; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

/* прибитая снизу кнопка расчёта */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.cta-bar .btn-cta { width: 100%; max-width: 520px; display: block; }
.savings-info {
  font-size: 13px; font-weight: 600; color: var(--success);
  padding: 8px 14px; border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  text-align: center;
}

/* ---------- Админ-панель ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(8, 12, 22, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  animation: fadeIn 0.2s ease;
}
/* display:flex выше по специфичности перебивал бы атрибут [hidden] (UA-правило),
   из-за чего оверлей висел бы всегда. Явно прячем при hidden. */
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.admin-panel {
  background: var(--surface);
  width: 100%; max-width: 720px;
  max-height: 92vh;
  max-height: 92dvh; /* учитывает динамическую адресную строку iOS — кнопка «Сохранить» не уезжает */
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.28s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.admin-header h2 { font-size: 20px; font-weight: 800; }
.admin-body {
  overflow-y: auto;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.admin-form { display: flex; flex-direction: column; gap: 18px; }
.admin-section { border: none; }
.admin-section legend { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 10px; }
.admin-field {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.admin-field-label { flex: 1; font-size: 14px; color: var(--text); }
.admin-input {
  width: 130px; height: 42px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font-size: 16px; text-align: right; padding: 0 12px; /* 16px = без авто-зума iOS */
  font-variant-numeric: tabular-nums;
}
.admin-input:focus { outline: none; border-color: var(--accent); }
.admin-input.admin-invalid { border-color: var(--danger); background: rgba(239, 68, 68, 0.08); background: color-mix(in srgb, var(--danger) 8%, var(--bg)); }
.admin-unit { width: 42px; font-size: 13px; color: var(--text-2); }
.admin-field-bool .admin-checkbox { width: 22px; height: 22px; accent-color: var(--accent); }
.admin-geo-btn { width: 100%; height: 40px; margin: 6px 0 2px; font-size: 13px; }

.admin-preview {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  align-self: start;
  position: sticky; top: 0;
}
.preview-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); margin-bottom: 10px; }
.preview-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.preview-controls input { height: 40px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0 12px; font-size: 16px; }
.preview-breakdown .brk-row { padding: 8px 0; font-size: 14px; }
.preview-total { margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--border); font-size: 15px; color: var(--text-2); }
.preview-total strong { font-size: 22px; font-weight: 800; color: var(--text); margin-left: 6px; font-variant-numeric: tabular-nums; }

.admin-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.admin-io { display: flex; gap: 8px; margin-left: auto; }
.admin-footer .btn { height: 46px; }
.admin-footer .btn-primary { padding: 0 24px; }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Десктоп: админка в две колонки ---------- */
@media (min-width: 720px) {
  .overlay { align-items: center; }
  .admin-panel { border-radius: 20px; max-height: 88vh; max-height: 88dvh; }
  .admin-body { grid-template-columns: 1.3fr 1fr; }
  .admin-preview { position: sticky; top: 0; }
}

/* Мобайл: превью-чек прилипает к низу окна, остаётся на виду при редактировании формы */
@media (max-width: 719px) {
  .admin-preview { position: sticky; bottom: 0; top: auto; z-index: 1; box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.12); }
}

/* Узкие экраны (~320px): параметр — подпись и поле в строку */
@media (max-width: 380px) {
  .param { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Пустое состояние (плейсхолдер правой колонки на десктопе) ---------- */
.empty-state { display: none; flex-direction: column; align-items: center; text-align: center; padding: 36px 24px; }
.empty-icon { font-size: 42px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-text { font-size: 14px; color: var(--text-2); max-width: 300px; margin-bottom: 22px; line-height: 1.5; }
.empty-skel { width: 100%; display: flex; flex-direction: column; gap: 10px; opacity: 0.45; }
.es-map { height: 150px; border-radius: 12px; }
.es-total { height: 40px; width: 55%; border-radius: 10px; align-self: center; }
.es-row { height: 16px; border-radius: 6px; }
.es-row:last-child { width: 70%; }

/* ---------- Десктоп: широкий двухколоночный макет ---------- */
/* Левая колонка (форма + кнопка) и правая (результат) независимы по высоте,
   поэтому кнопка «Рассчитать» больше не уезжает вниз при отрисовке результата.
   Мобильная раскладка (ниже брейкпоинта) не трогается. */
@media (min-width: 880px) {
  .app { max-width: 1080px; padding-bottom: 32px; }
  .screen {
    display: grid;
    grid-template-columns: minmax(360px, 440px) 1fr;
    column-gap: 28px;
    align-items: start;
  }
  .form-col { position: sticky; top: 16px; }
  .result-col { min-width: 0; } /* чтобы карта/контент не распирали колонку */
  /* кнопка расчёта — под формой, без фиксации к низу экрана */
  .cta-bar { position: static; padding: 4px 0 0; background: none; z-index: auto; }
  .cta-bar .btn-cta { max-width: none; }
  /* плейсхолдер виден только на десктопе и только когда не скрыт через hidden */
  .empty-state:not([hidden]) { display: flex; }
  /* карта повыше, чтобы заполнять широкую колонку */
  .map { height: 260px; }
}

/* ---------- Список точек маршрута ---------- */
.waypoint-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.wp-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: fadeIn 0.18s ease;
  overflow: hidden;
}
.wp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.wp-header:hover { background: rgba(0,0,0,0.025); }
[data-theme="dark"] .wp-header:hover { background: rgba(255,255,255,0.04); }
.wp-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wp-addr {
  flex: 1;
  font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wp-del {
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text-2);
  font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color 0.15s, background 0.15s;
}
.wp-del:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

.wp-hdr-price {
  font-size: 13px; font-weight: 600; color: var(--accent);
  white-space: nowrap; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.wp-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  transition: background 0.2s;
}
.wp-status-dot.filled { background: var(--success); }
.wp-chevron {
  font-size: 12px; color: var(--text-2); flex-shrink: 0;
  transition: transform 0.2s; line-height: 1;
}
.wp-item--expanded .wp-chevron { transform: rotate(180deg); }

/* Панель детализации */
.wp-detail {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}
.wp-detail-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: flex-end; margin-bottom: 10px;
}
.wp-detail-field { display: flex; flex-direction: column; gap: 5px; }
.wp-detail-label {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.wp-mini-stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden; height: 34px; background: var(--bg);
}
.wp-stepper-btn {
  width: 30px; height: 100%; border: none; background: transparent;
  font-size: 16px; color: var(--accent); cursor: pointer;
}
.wp-stepper-btn:active { background: var(--surface-2); }
.wp-stepper-val {
  width: 32px; height: 100%; border: none; background: transparent;
  text-align: center; font-size: 14px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.wp-stepper-val:focus { outline: none; }
.wp-check-label {
  display: flex; align-items: center; gap: 6px;
  height: 30px; font-size: 14px; color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.wp-check-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.wp-num-input {
  width: 76px; height: 34px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font-size: 14px; text-align: center; padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.wp-num-input:focus { outline: none; border-color: var(--accent); }
.wp-price-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
}
.wp-price-label { font-size: 13px; color: var(--text-2); }
.wp-price-val {
  font-size: 16px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
/* Разбивка по статьям внутри карточки адреса */
.wp-breakdown { margin-top: 6px; }
.wp-breakdown .brk-row { padding: 6px 0; font-size: 13px; }

.btn-add-stop {
  width: 100%; height: 42px;
  margin-top: 8px;
  font-size: 14px; font-weight: 600;
}

/* ---------- Карточка порядка доставки (результат) ---------- */
.route-order-card { padding: 8px 18px; }
.route-order-head {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2); padding: 12px 0 6px;
}
.route-order-list { display: flex; flex-direction: column; }
.route-stop {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  animation: brkIn 0.3s ease both;
}
.route-stop:first-child { border-top: none; }
.route-stop-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  margin-top: 1px;
}
.route-stop-num.origin { background: #16a34a; color: #fff; }
.route-stop-num.middle { background: var(--accent); color: #fff; }
.route-stop-num.last   { background: var(--danger); color: #fff; }
.route-stop-body { flex: 1; min-width: 0; }
.route-stop-main { display: flex; align-items: center; gap: 8px; }
.route-stop-addr { flex: 1; font-size: 14px; color: var(--text); line-height: 1.4; }
.route-stop-price {
  font-size: 13px; font-weight: 700; color: var(--accent);
  white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.route-stop-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.route-stop-dot.filled { background: var(--success); }
.route-stop-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.route-stop-arrow {
  padding: 0 0 0 13px; color: var(--text-2);
  font-size: 14px; line-height: 1;
}

/* Итоговая сводка маршрута */
.route-summary {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 2px solid var(--border);
}
.route-summary-item { display: flex; flex-direction: column; gap: 2px; }
.route-summary-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2);
}
.route-summary-value {
  font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.route-summary-total .route-summary-value { color: var(--accent); font-size: 20px; }

/* ---------- Уважение к настройке «меньше движения» ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* без «скачка» масштаба при нажатии, если пользователь просил меньше движения */
  .btn:active, .icon-btn:active, .stepper-btn:active, .clear-btn:active { transform: none !important; }
}
