/* Мобильная админка LEYLI — компактный интерфейс для телефона */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #c2447a;
  --accent-soft: #fbe7f0;
  --red-bg: #fde8e8;
  --red-text: #b42318;
  --yellow-bg: #fdf3d7;
  --yellow-text: #7a5b00;
  --green: #067647;
  --green-bg: #e2f3ea;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --card: #1c1f26;
    --text: #eceef2;
    --muted: #9aa1ad;
    --line: #2a2e37;
    --accent: #e0699c;
    --accent-soft: #3a2230;
    --red-bg: #3b1d1d;
    --red-text: #f1a29a;
    --yellow-bg: #3a321b;
    --yellow-text: #ecd394;
    --green: #4ccb90;
    --green-bg: #1d3529;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar h1 { font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  border: 0; background: none; color: var(--text);
  font-size: 30px; line-height: 1; padding: 7px 11px; border-radius: 12px;
}
/* значок «⟳» в шрифте мельче стрелки «←» — выравниваем видимый размер */
#refreshBtn { font-size: 36px; padding: 4px 9px; }
.icon-btn:active { background: var(--line); }

main { padding: 12px; max-width: 640px; margin: 0 auto; }

/* Нижние вкладки */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; text-align: center; padding: 8px 0 6px;
  font-size: 12px; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; gap: 2px;
}
.tab-icon { font-size: 20px; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab.disabled { opacity: .45; }

/* Команды на главной */
.commands { display: grid; gap: 10px; margin-bottom: 16px; }
.cmd {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 16px; font-weight: 600; color: var(--text);
  width: 100%; text-align: left; text-decoration: none;
}
.cmd:active { background: var(--accent-soft); }
.cmd .cmd-icon { font-size: 20px; }
.cmd.secondary { font-weight: 500; }

.search-box { display: none; gap: 8px; margin-bottom: 12px; }
.search-box.open { display: flex; }
.search-box input {
  flex: 1; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text);
}
/* Поле поиска с крестиком очистки внутри */
.search-field { position: relative; flex: 1; display: block; min-width: 0; }
.search-field input { width: 100%; padding-right: 42px; box-sizing: border-box; }
/* прячем встроенный крестик браузера, чтобы не было двух */
.search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* специфичность выше, чем у общего правила .search-box button — иначе крестик
   унаследовал бы вид кнопки «Найти» (розовая заливка и широкие отступы) */
.search-box .search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--muted);
  font-size: 19px; font-weight: 400; line-height: 1;
}
.search-box .search-clear:active { background: var(--accent-soft); color: var(--accent); }
.search-box button {
  border: 0; border-radius: var(--radius); background: var(--accent);
  color: #fff; font-size: 16px; padding: 0 18px; font-weight: 600;
}

.section-label { font-size: 13px; color: var(--muted); margin: 14px 2px 8px; text-transform: uppercase; letter-spacing: .04em; }

/* Статусы */
.status-list { display: grid; gap: 8px; }
.status-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.status-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 14px; border: 0; background: none;
  font-size: 15.5px; font-weight: 600; color: var(--text); text-align: left;
}
.status-head .chev { color: var(--muted); transition: transform .15s; font-size: 13px; }
.status-card.open .chev { transform: rotate(90deg); }
.status-head .count {
  margin-left: auto; background: var(--accent-soft); color: var(--accent);
  font-size: 13.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; min-width: 28px; text-align: center;
}
.status-head .count.zero { background: var(--line); color: var(--muted); }
.status-body { border-top: 1px solid var(--line); }

/* Строка заказа */
.order-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  width: 100%; text-align: left; border: 0; background: none; color: var(--text);
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.order-row:last-child { border-bottom: 0; }
.order-row:active { background: var(--accent-soft); }
.order-num { font-weight: 700; font-size: 15px; }
.order-date { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.order-sum { font-weight: 700; font-size: 15px; text-align: right; }
.order-cust { grid-column: 1 / -1; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* статус заказа (во «Всех заказах», поиске, заказах покупателя) — справа от имени */
.order-row.with-state .order-cust { grid-column: 1; }
.order-state { color: var(--accent); font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; align-self: center; }

/* Строка категории товаров */
.cat-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 14px; border: 0; background: none;
  border-bottom: 1px solid var(--line); text-align: left;
  font-size: 15.5px; font-weight: 600; color: var(--text);
}
.cat-row:last-child { border-bottom: 0; }
.cat-row:active { background: var(--accent-soft); }
.cat-row .cat-name { flex: 1; min-width: 0; }
.cat-row .count {
  background: var(--accent-soft); color: var(--accent);
  font-size: 13.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; min-width: 28px; text-align: center;
}
.cat-row .count.zero { background: var(--line); color: var(--muted); }
/* счётчик ещё считается (у категорий с подкатегориями) */
.count.pending { background: var(--line); color: var(--muted); letter-spacing: .08em; }
.cat-row .chev { color: var(--muted); font-size: 13px; }
/* товары внутри раскрывающегося блока категории */
.cat-products { padding: 0 14px; }
.cat-products .more-btn { margin: 0 -14px; width: calc(100% + 28px); }
/* ссылки на категорию на сайте (сверху экрана категории) — кнопки те же, что
   в карточке товара (.prod-links), только крупнее под палец */
.cat-links { margin: 12px 2px 0; gap: 8px; }
.cat-links .small-btn { padding: 9px 14px; font-size: 14.5px; }
.cat-links-note { margin: 12px 2px 0; color: var(--muted); font-size: 13.5px; }

.more-btn {
  width: 100%; padding: 12px; border: 0; background: none;
  color: var(--accent); font-size: 15px; font-weight: 600;
  border-top: 1px solid var(--line);
}
.empty { padding: 14px; color: var(--muted); font-size: 14.5px; text-align: center; }
.loading { padding: 20px; text-align: center; color: var(--muted); }
.error-box {
  background: var(--red-bg); color: var(--red-text);
  border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; font-size: 14.5px;
}

/* Карточка заказа */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-head .num { font-size: 20px; font-weight: 800; }
.badge {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 3px 12px; font-size: 13.5px; font-weight: 700;
}
.badge.paid { background: var(--green-bg); color: var(--green); }
.badge.unpaid { background: var(--red-bg); color: var(--red-text); }
.badge.confirmed { background: var(--green-bg); color: var(--green); }
/* жёлтая, не красная — чтобы не сливалась с «Не оплачено» рядом */
.badge.unconfirmed { background: var(--yellow-bg); color: var(--yellow-text); }
.order-head .date { width: 100%; color: var(--muted); font-size: 13.5px; }
.order-total { font-size: 26px; font-weight: 800; margin-top: 8px; }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 600; }
.kv .v.big { font-size: 17px; }

.customer-name { font-size: 17px; font-weight: 700; }
.salon { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.cust-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.group-tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(120, 90, 200, 0.14); color: #6b4fbf;
  font-size: 12.5px; font-weight: 600; line-height: 1.5;
}
.phone-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 14px;
  background: var(--accent-soft); color: var(--accent);
  border: 0; border-radius: 999px; font-size: 16px; font-weight: 700;
}
.mini { color: var(--muted); font-size: 13.5px; }

.note { border-radius: var(--radius); padding: 12px 14px; font-size: 15px; margin-bottom: 10px; }
.note.red { background: var(--red-bg); color: var(--red-text); }
.note.yellow { background: var(--yellow-bg); color: var(--yellow-text); }
/* Блок «Комментарий о покупателе» красный ВСЕГДА (просьба владелицы
   2026-08-05), и пустой тоже; класс note-empty остался различать состояние. */
.note.note-empty { background: var(--red-bg); color: var(--red-text); }
.note.note-empty .mini { color: inherit; opacity: .75; }
.note .note-label { display: block; font-size: 12.5px; opacity: .8; margin-bottom: 3px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

.card-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-title { font-size: 16px; font-weight: 700; flex: 1; }
.small-btn {
  border: 1px solid var(--line); background: none; color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600;
}
.small-btn:disabled { opacity: .45; }
.small-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item img, .item .noimg {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.item .item-info { flex: 1; min-width: 0; }
.item .item-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.item .item-sku { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item .item-price { margin-top: 4px; font-size: 14.5px; }
.item .old { color: var(--muted); text-decoration: line-through; margin-right: 6px; }
.item .final { font-weight: 700; }
.item .qty { color: var(--muted); }
.item .item-stock { color: var(--muted); font-size: 12px; margin-top: 2px; }
.item .item-stock .low { color: var(--red-text); font-weight: 600; }

/* Режим правки состава */
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); border-radius: 9px; font-size: 19px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qty-btn:active { background: var(--accent-soft); }
.qty-btn.rm { margin-left: auto; border-color: var(--red-bg); }
.qty-btn.undo { width: auto; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--accent); }
.qty-val { min-width: 32px; text-align: center; font-size: 17px; font-weight: 700; }
.edit-item.removed { opacity: .5; }
.edit-item.removed .item-name { text-decoration: line-through; }
.small-btn.add-prod { width: 100%; margin-top: 10px; padding: 11px; border-style: dashed; color: var(--accent); }

/* Поиск товара для добавления */
.prod-results { max-height: 60vh; overflow-y: auto; }
.prod-row {
  display: flex; gap: 10px; width: 100%; text-align: left; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; margin-bottom: 8px; color: var(--text);
}
.prod-row:active { background: var(--accent-soft); }
.prod-row img, .prod-row .noimg {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.prod-info { min-width: 0; flex: 1; }

/* «Добавить в заказ» из строки товара */
.avail.pending { color: var(--muted); letter-spacing: .08em; }
.avail.low { color: var(--red-text); font-weight: 600; }
.item .add-to-order { margin-top: 6px; color: var(--accent); border-color: var(--accent-soft); }
.feat.pending { color: var(--muted); letter-spacing: .08em; }

/* Скрытый товар (видимость «Скрыт») — весь текст карточки серым */
.item.inactive .item-info, .item.inactive .item-info *,
.prod-row.inactive .prod-info, .prod-row.inactive .prod-info * { color: var(--muted) !important; }
.item.inactive img, .prod-row.inactive img { opacity: .55; }

/* Списки товаров: кнопка «📋 Списки», её панель, карточка списка.
   Кнопки списков стоят НИЖЕ ссылок на сайт, в одну строку и серым — ими
   пользуются редко, они не должны отвлекать (просьба владелицы 2026-08-06).
   Снаружи одна кнопка «Списки», «＋ В список» — внутри панели (2026-08-09). */
/* «Категории» и «Списки» стоят ОДНОЙ строкой (просьба владелицы 2026-08-12 —
   так карточка компактнее); третья кнопка «− Из списка» (только внутри
   раскрытого списка) при нехватке ширины переносится на следующую строку. */
.set-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item .show-sets, .item .add-to-set, .item .rm-from-set,
.item .show-cats, .item .add-to-cat {
  color: var(--muted); border-color: var(--line); white-space: nowrap;
}
.prod-sets, .prod-cats { margin-top: 6px; border-top: 1px solid var(--line); }
.prod-sets .panel-add-set, .prod-cats .panel-add-set { margin: 8px 0; }
/* Путь родителей у категории («ВСЕ БРЕНДЫ / IQ BEAUTY / …») — бледнее имени:
   имена категорий в магазине повторяются, без пути не понять, какая это. */
.cat-path { color: var(--muted); }
.set-row .cat-main { color: var(--accent); }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row-name { flex: 1; min-width: 0; font-size: 14px; }
.set-row .set-minus {
  flex: 0 0 auto; width: 34px; padding: 4px 0; font-size: 18px; line-height: 1;
  color: var(--red-text); border-color: var(--red-bg);
}
.set-none { padding: 8px 0; }
.status-head .set-auto { margin-left: 8px; font-weight: 400; }
.sheet-body .set-pick span { flex: 1; min-width: 0; }
.sheet-body .cat-pick span { flex: 1; min-width: 0; }
/* Категорий почти 600 — список прокручиваем внутри шторки, иначе кнопка
   «Сохранить» уезжает в самый низ и до неё не долистать. */
.sheet-body #catPickList { max-height: 42vh; overflow-y: auto; }
/* «Обновить список категорий» — служебная, поэтому скромнее прочих кнопок */
.sheet-body #catRefresh {
  background: none; color: var(--muted); justify-content: center;
  padding: 8px; font-size: 14px; font-weight: 600;
}
#catNone { text-align: center; }
/* Дата версии внизу главного экрана — служебная подпись, почти незаметная */
.build-line { text-align: center; margin: 2px 0 10px; opacity: .55; }

/* Кнопки «Показать на сайте» / «Скопировать ссылку» в карточке товара */
.prod-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prod-links .small-btn { text-decoration: none; display: inline-block; color: var(--accent); border-color: var(--accent-soft); }
.add-prod-name { text-align: center; color: var(--muted); font-size: 13.5px; margin: -2px 0 0; }
.sheet-body .qty-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0; }
.sheet-body .qty-btn { width: 44px; flex: 0 0 44px; padding: 0; justify-content: center; font-size: 20px; border: 1px solid var(--line); }
.add-hint { background: var(--yellow-bg); color: var(--yellow-text); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; text-align: center; }

/* Режим «Сборка» */
.item .asm-cb { width: 24px; height: 24px; margin-top: 16px; accent-color: var(--accent); flex-shrink: 0; }
.assembly .item.done { opacity: .45; }
.assembly .item.done .item-name { text-decoration: line-through; }

.log { font-size: 13.5px; }
.log-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-row .when { color: var(--muted); font-size: 12.5px; }
.log-row .log-state { font-size: 13px; font-weight: 600; margin-top: 2px; }

/* Реальные скидки по товарам (карточка после «Состава заказа») */
.disc-list { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.disc-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 8px; border-top: 1px solid var(--line); font-size: 13px;
}
.disc-row:first-child { border-top: 0; }
.disc-main { flex: 1; min-width: 0; line-height: 1.3; }
.disc-prod { }
.disc-rule { color: var(--muted); font-size: 12px; margin-top: 2px; }
.disc-row .dp {
  flex-shrink: 0; font-weight: 700; font-size: 11.5px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: 1px 5px;
}
.disc-row .ds { flex-shrink: 0; font-weight: 700; white-space: nowrap; }
.disc-total {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 8px; border-top: 1px solid var(--line);
  background: var(--bg); font-weight: 700; font-size: 13px;
}
.disc-total.applied { color: var(--accent); }
/* Предупреждение в правке состава: ручная скидка пересчитается по правилам */
.disc-warn {
  background: var(--yellow-bg); color: var(--yellow-text);
  border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px;
  font-size: 13px; line-height: 1.35;
}

/* Скидки из истории заказа: товар → скидка / % / рубли */
.log-disc { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ld-item { padding: 6px 8px; border-top: 1px solid var(--line); }
.ld-item:first-child { border-top: 0; }
.ld-prod { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.ld-row { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.ld-name { flex: 1; min-width: 0; }
.ld-pct {
  flex-shrink: 0; font-weight: 700; font-size: 11.5px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: 1px 5px;
}
.ld-sum { flex-shrink: 0; font-weight: 700; color: var(--text); white-space: nowrap; }
.ld-sub .ld-name { font-style: italic; }
.ld-total {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-top: 1px solid var(--line);
  background: var(--bg); font-size: 12.5px; font-weight: 700;
}
details.card summary { font-size: 16px; font-weight: 700; cursor: pointer; }

/* Шторка снизу (звонок/мессенджеры) */
.sheet.hidden { display: none; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.sheet-body {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
}
.sheet-body a, .sheet-body button {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 12px;
  background: var(--bg); color: var(--text);
  border: 0; font-size: 16px; font-weight: 600; text-decoration: none; width: 100%;
}
.sheet-body .sheet-cancel { background: none; color: var(--muted); justify-content: center; }
.sheet-body { max-height: 90vh; overflow-y: auto; }

/* Форма редактирования покупателя */
.edit-field { display: block; margin-bottom: 10px; }
.edit-field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px 2px; }
.edit-field input,
.edit-field select {
  width: 100%; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); box-sizing: border-box;
}
.edit-group-label {
  font-size: 13px; font-weight: 700; color: var(--muted);
  margin: 14px 2px 8px; padding-top: 10px; border-top: 1px solid var(--line);
}
/* Списки телефонов/почт в правке покупателя (несколько строк + «главный»).
   Специфичность выше, чем у общего .sheet-body button (иначе звезда
   унаследует width:100% и вытолкнет поле ввода за экран). */
.multi-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.multi-row input { flex: 1; min-width: 0; }
.sheet-body .multi-row .main-pick {
  flex: 0 0 44px; width: 44px; padding: 10px 0; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--muted);
}
.sheet-body .multi-row .main-pick.active { color: var(--yellow-text); border-color: var(--yellow-text); }
/* Чекбоксы категорий покупателя в шторке правки */
.cat-list { margin-bottom: 10px; }
.cat-check {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; font-size: 15px; cursor: pointer;
}
.cat-check + .cat-check { border-top: 1px solid var(--line); }
.cat-check input {
  width: 20px; height: 20px; margin: 0; flex: none;
  accent-color: var(--accent);
}
.method-row { display: flex; flex-wrap: wrap; gap: 6px; }
.method-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; width: auto;
}
.method-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Авто-расчёт тарифа доставки */
.rate-hint { font-size: 13.5px; margin: -4px 2px 10px; min-height: 0; }
.rate-hint:empty { margin: 0; }
.rate-hint.calc { color: var(--muted); }
.rate-hint.ok { color: var(--green); font-weight: 600; }
.rate-hint.warn { color: var(--yellow-text); }
.cost-row { display: flex; gap: 8px; align-items: stretch; }
.cost-row input { flex: 1; min-width: 0; }
.cost-row .small-btn { width: auto; white-space: nowrap; flex-shrink: 0; }

/* Выбор пункта выдачи (ПВЗ) */
.search-input {
  width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); margin-bottom: 4px;
}
.search-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.muted-small { font-size: 13px; color: var(--muted); }
.pvz-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 6px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--text); font-size: 14.5px;
}
.pvz-row:active { background: var(--accent-soft); border-color: var(--accent); }
.pvz-addr { flex: 1; min-width: 0; }
.pvz-rate { white-space: nowrap; font-weight: 600; color: var(--green); }

/* Ссылка на оплату */
.pay-link {
  font-size: 13px; word-break: break-all; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  color: var(--text); user-select: all;
}

/* Дубли контакта */
.dup-warn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--yellow-bg); color: var(--yellow-text);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; font: inherit; cursor: pointer;
}
.dup-warn .dup-ico { font-size: 20px; flex-shrink: 0; }
.dup-warn .dup-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dup-warn .dup-sub { font-size: 13px; opacity: .85; }
.dup-warn .dup-arrow { font-size: 22px; opacity: .6; flex-shrink: 0; }

.dup-item { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.dup-item:last-of-type { border-bottom: 0; }
.dup-name { font-weight: 700; font-size: 15px; }
.dup-meta { color: var(--muted); font-size: 13px; margin: 3px 0 9px; }
.dup-badge {
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
  border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700;
}
/* кнопка занимает всю ширину (как остальные в шторке), текст по центру */
.dup-master { justify-content: center; }

.hidden { display: none !important; }
