/* ============================================================
   MAX Витрина — дизайн-система и стили Mini App
   ============================================================ */

:root {
  --accent: #9769FD;
  --accent-600: #7c4dee;
  --accent-700: #6a3ce0;
  --accent-soft: #EDE7FF;
  --accent-softer: #F3EFFF;
  --bg: #F9F6FF;
  --text: #161616;
  --text-2: #5b5670;
  --muted: #918da8;
  --surface: #FFFFFF;
  --line: #ece7f7;
  --line-2: #f0ecfa;
  --success: #34c17b;
  --danger: #ff5d6c;
  --warn: #ffb020;

  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-pill: 999px;

  --shadow-sm: 0 4px 14px rgba(90, 60, 180, .06);
  --shadow-md: 0 12px 30px rgba(90, 60, 180, .10);
  --shadow-lg: 0 20px 50px rgba(90, 60, 180, .16);

  --app-w: 440px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

/* Базовый размер inline-иконок (защита от «раздувания» SVG без width/height) */
.screen svg { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.pill-note svg, .summary svg, .lead svg { width: 15px; height: 15px; }
.action .ic svg { width: 22px; height: 22px; }
.plan-feats .fc { display: inline-flex; color: var(--success); vertical-align: -2px; }
.plan-feats .fc svg { width: 14px; height: 14px; }
.success-ic svg { width: 46px; height: 46px; }
.empty svg { width: 54px; height: 54px; }
.shop-header .meta svg { width: 15px; height: 15px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Прокручиваемый экран ---------- */
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 18px 24px;
  scrollbar-width: none;
}
.screen.with-tabs { padding-bottom: 100px; }   /* запас под нижнее меню — только когда оно есть */
.screen::-webkit-scrollbar { display: none; }

/* ---------- Топ-бар ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar .title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.topbar .sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.iconbtn {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: .15s;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 20px; height: 20px; }
.spacer { flex: 1; }

/* ---------- Кнопки ---------- */
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  border-radius: var(--r-pill);
  padding: 15px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: .16s ease;
  letter-spacing: -.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(151,105,253,.35); }
.btn-primary:hover { background: var(--accent-600); }
.btn-dark { background: var(--text); color: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-700); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 17px 24px; font-size: 16px; }
.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

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

/* ---------- Чипы / категории ---------- */
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 700; color: var(--text-2);
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Хиро на онбординге ---------- */
.hero {
  background: linear-gradient(160deg, #fff 0%, #f4efff 100%);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero .blob { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .5; }

/* ---------- Логотип ---------- */
.brandmark { display: inline-flex; align-items: center; gap: 10px; }
.brandmark img { height: 26px; }

/* Брендовая шапка дашборда (лого по центру + подпись ниже) */
.brandbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 0 16px;
  background: linear-gradient(var(--bg) 72%, transparent);
}
.brandbar img { height: 30px; }
.brandbar-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }

/* Символ-знак лого в шапках внутренних экранов */
.brand-sym { height: 24px; width: auto; flex: none; display: block; }
.topbar .brand-sym { margin-left: 8px; opacity: .9; }

/* Сегмент-переключатель (Товар / Услуга) */
.seg { display: flex; gap: 8px; background: var(--accent-softer); padding: 5px; border-radius: var(--r-sm); }
.seg-btn {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 14px; color: var(--text-2);
  padding: 11px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: .15s;
}
.seg-btn.on { background: var(--surface); color: var(--accent-700); box-shadow: var(--shadow-sm); }
.seg-btn svg { width: 17px; height: 17px; }
.seg-hint { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 8px; line-height: 1.45; }

.info-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-softer); border-radius: var(--r-sm); padding: 14px;
  font-size: 13px; color: var(--accent-700); font-weight: 600; line-height: 1.45; margin-bottom: 16px;
}
.info-card svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* Строка с чекбоксом */
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; margin-bottom: 16px; font-size: 14px; font-weight: 700; color: var(--text-2);
}

/* Мини-тег «услуга» / тип заявки */
.mini-tag {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  background: var(--accent-soft); color: var(--accent-700); padding: 2px 7px; border-radius: 6px; vertical-align: 1px;
}
.mini-tag.svc { background: #ffe9c9; color: #b57900; }

/* Кнопки под заявкой */
.lead-actions { display: flex; gap: 9px; margin-top: 12px; }
.lead-actions .btn { flex: 1; }

/* ---------- Онбординг ---------- */
.onb { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 14px; }
.onb-art {
  border-radius: var(--r-lg);
  flex: 1 1 auto; min-height: 120px;
  display: grid; place-items: center;
  margin: 6px 0 18px;
  position: relative;
  overflow: hidden;
}
.onb-art > div { font-size: clamp(64px, 16vh, 104px); line-height: 1; }
.onb h1 { font-size: 27px; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 10px; font-weight: 800; }
.onb .hl { background: var(--accent-soft); color: var(--accent-700); padding: 0 8px; border-radius: 8px; }
.onb p { font-size: 15px; line-height: 1.45; color: var(--text-2); margin: 0; font-weight: 500; }
.dots-nav { display: flex; gap: 7px; justify-content: center; margin: 16px 0; }
.dots-nav i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-soft); transition: .2s; }
.dots-nav i.on { width: 26px; border-radius: 6px; background: var(--accent); }

/* ---------- Дашборд: приветствие ---------- */
.greeting { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.greeting .hi { font-size: 13px; color: var(--muted); font-weight: 600; }
.greeting .nm { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Статистика ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border-radius: var(--r-sm); padding: 14px 12px;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat.accent { background: var(--accent); border-color: var(--accent); }
.stat.accent .n, .stat.accent .l { color: #fff; }
.stat.accent .l { opacity: .85; }

/* ---------- Секции ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 8px; }
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.section-head a { font-size: 13px; color: var(--accent-700); font-weight: 700; text-decoration: none; }

/* ---------- Быстрые действия ---------- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.action {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: .15s;
  display: flex; flex-direction: column; gap: 12px;
}
.action:active { transform: scale(.98); }
.action .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-700); }
.action.dark { background: var(--text); border-color: var(--text); }
.action.dark .t, .action.dark .d { color: #fff; }
.action.dark .ic { background: rgba(255,255,255,.14); color: #fff; }
.action .t { font-weight: 800; font-size: 15px; }
.action .d { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Список товаров (владелец) ---------- */
.prod-row {
  display: flex; gap: 13px; align-items: center; padding: 12px; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.prod-row .thumb { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; flex: 0 0 62px; background: var(--accent-softer); }
.prod-row .info { flex: 1; min-width: 0; }
.prod-row .nm { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-row .pr { font-weight: 800; color: var(--accent-700); font-size: 14px; margin-top: 3px; }
.prod-row .badge-hidden { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Витрина: карточки товаров ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.pcard {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s;
  display: flex; flex-direction: column;
}
.pcard:active { transform: scale(.98); }
.pcard .ph { position: relative; width: 100%; padding-top: 100%; background: var(--accent-softer); overflow: hidden; }
.pcard .ph > img, .pcard .ph > div:not(.status-tag) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.pcard .status-tag {
  position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  font-size: 10.5px; font-weight: 800; padding: 5px 10px; border-radius: var(--r-pill); color: var(--text);
}
.pcard .body { padding: 12px 12px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pcard .nm { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pcard .cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .cat { font-size: 11px; color: var(--muted); font-weight: 600; }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.pcard .pr { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.pcard .add {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; border: none; cursor: pointer; box-shadow: 0 6px 14px rgba(151,105,253,.4);
}
.pcard .add:active { transform: scale(.9); }
.pcard .add.svc { background: #ffb020; box-shadow: 0 6px 14px rgba(255,176,32,.4); }
.pcard .add.off { background: var(--line); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.pcard .status-tag.off { color: var(--danger); }

/* ---------- Звёзды и репутация ---------- */
.stars { display: inline-flex; gap: 1px; font-size: 14px; line-height: 1; letter-spacing: 1px; }
.stars .star { color: #e2dcf2; }
.stars .star.on { color: #ffb020; }

.trust-strip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 12px 15px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.trust-strip b { color: var(--text); font-size: 14px; margin-left: 2px; }
.ts-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); display: inline-block; }

.rating-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.rating-hero .rh-num { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.rating-hero .rh-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 7px; }

/* Карточка отзыва */
.review {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 15px; box-shadow: var(--shadow-sm); margin-bottom: 11px;
}
.review .rv-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.review .rv-av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-700);
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.review .rv-name { font-weight: 800; font-size: 14.5px; }
.review .rv-date { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.review .rv-text { font-size: 14px; line-height: 1.55; color: var(--text-2); font-weight: 500; }

/* Выбор оценки в форме отзыва */
.star-pick { display: flex; gap: 10px; font-size: 40px; line-height: 1; }
.star-pick .sp { color: #e2dcf2; cursor: pointer; transition: .12s; }
.star-pick .sp.on { color: #ffb020; }
.star-pick .sp:active { transform: scale(.85); }

/* ---------- Лента предпросмотра (режим владельца) ---------- */
.preview-ribbon {
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: #fff; border-radius: var(--r-pill);
  padding: 10px 8px 10px 16px; font-size: 12.5px; font-weight: 700; margin-bottom: 14px;
}
.preview-ribbon svg { width: 15px; height: 15px; flex: none; }
.preview-ribbon button {
  margin-left: auto; border: none; cursor: pointer; font-family: var(--font);
  background: rgba(255,255,255,.16); color: #fff; font-weight: 700; font-size: 12.5px;
  padding: 7px 14px; border-radius: var(--r-pill); flex: none;
}

/* ---------- Шапка публичной витрины ---------- */
.shop-header {
  border-radius: var(--r-lg); padding: 22px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-700) 100%);
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.shop-header::after { content:""; position:absolute; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.12); right:-50px; top:-60px; }
.shop-header .logo { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 26px; margin-bottom: 12px; }
.shop-header h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.shop-header p { margin: 0; font-size: 14px; opacity: .9; line-height: 1.4; font-weight: 500; }
.shop-header .meta { display: flex; gap: 16px; margin-top: 16px; font-size: 12.5px; font-weight: 700; }
.shop-header .meta span { display: flex; align-items: center; gap: 5px; opacity: .95; }

/* ---------- Карточка товара (детально) ---------- */
.gallery { position: relative; width: 100%; padding-top: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--accent-softer); margin-bottom: 16px; }
.gallery > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.detail h1 { font-size: 24px; letter-spacing: -.02em; margin: 4px 0 6px; }
.detail .price-lg { font-size: 26px; font-weight: 800; color: var(--accent-700); letter-spacing: -.02em; }
.detail .desc { color: var(--text-2); line-height: 1.55; font-size: 15px; margin: 14px 0; font-weight: 500; }

/* ---------- Формы ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-2); }
.input, textarea.input, select.input {
  width: 100%; font-family: var(--font); font-size: 15px; font-weight: 500;
  padding: 14px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); transition: .15s; outline: none;
}
.input:focus, textarea.input:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-softer); }
textarea.input { resize: vertical; min-height: 90px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Загрузка фото */
.uploader { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.upcell { position: relative; padding-top: 100%; border-radius: var(--r-sm); border: 1.5px dashed var(--line); background: var(--accent-softer); color: var(--accent); cursor: pointer; overflow: hidden; }
.upcell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upcell svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Свотчи темы */
.swatches { display: flex; gap: 12px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: var(--shadow-sm); position: relative; }
.swatch.on::after { content:""; position:absolute; inset:-6px; border:2px solid var(--text); border-radius:50%; }

/* ---------- Корзина ---------- */
.cart-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.cart-item .thumb { width: 58px; height: 58px; border-radius: 13px; object-fit: cover; background: var(--accent-softer); }

/* --- Эмодзи-пикер --- */
.emoji-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.emoji-current { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-softer); display: grid; place-items: center; font-size: 26px; flex-shrink: 0; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 208px; overflow-y: auto; padding: 8px; background: var(--accent-softer); border-radius: var(--r-sm); -webkit-overflow-scrolling: touch; }
.emoji-grid .em { font-size: 22px; line-height: 1; height: 40px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; transition: .12s; display: grid; place-items: center; }
.emoji-grid .em:hover { background: #fff; }
.emoji-grid .em.on { background: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* --- Категории (управление) --- */
.cat-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin-top: 10px; }
.cat-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13.5px; }
.cat-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; }
.cat-rm { border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.cat-rm:hover { color: var(--danger); }
.cat-pick .chip { cursor: pointer; }

/* --- Разделы каталога (товары / услуги) --- */
.catalog-sec { margin-bottom: 12px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; }
.sec-title h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sec-title svg { width: 20px; height: 20px; color: var(--accent-700); flex-shrink: 0; }
.sec-count { font-size: 12px; font-weight: 700; color: var(--accent-700); background: var(--accent-soft); border-radius: var(--r-pill); padding: 2px 9px; }
.catalog-sec.service { background: var(--accent-softer); border-radius: var(--r-md); padding: 14px 12px 4px; }

/* --- Карточки услуг --- */
.svc-list { display: flex; flex-direction: column; gap: 10px; }
.svc-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); cursor: pointer; transition: .12s; }
.svc-card:active { transform: scale(.99); }
.svc-thumb { width: 54px; height: 54px; border-radius: 13px; background: var(--accent-softer); display: grid; place-items: center; font-size: 26px; overflow: hidden; flex-shrink: 0; }
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.svc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.svc-body .cat { font-size: 11px; color: var(--muted); font-weight: 600; }
.svc-body .nm { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.svc-body .cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-body .pr { font-weight: 800; font-size: 15px; color: var(--accent-700); letter-spacing: -.02em; }
.svc-req { flex-shrink: 0; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; font-weight: 700; cursor: pointer; color: var(--accent-700); display: grid; place-items: center; }
.qty span { min-width: 20px; text-align: center; font-weight: 800; }

.summary { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-sm); }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--text-2); font-weight: 500; }
.summary .total { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--line); font-size: 19px; font-weight: 800; }

/* ---------- Заявки ---------- */
.lead {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 15px; box-shadow: var(--shadow-sm); margin-bottom: 11px;
}
.lead .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.lead .who { font-weight: 800; font-size: 15px; }
.lead .when { font-size: 12px; color: var(--muted); font-weight: 600; }
.lead .items { font-size: 13.5px; color: var(--text-2); line-height: 1.5; font-weight: 500; }
.lead .sum { font-weight: 800; color: var(--accent-700); margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: var(--r-pill); }
.tag.new { background: var(--accent-soft); color: var(--accent-700); }
.tag.in_progress { background: #fff2d9; color: #b57900; }
.tag.done { background: #d9f7e7; color: #1c9a5f; }
.tag.rejected { background: #ffe0e4; color: #d83a49; }

/* ---------- Пост в канал (превью) ---------- */
.post-preview {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-md);
}
.post-preview .cover { aspect-ratio: 16/9; background: linear-gradient(140deg, var(--accent), var(--accent-700)); display: grid; place-items: center; color: #fff; }
.post-preview .pbody { padding: 16px; }
.post-preview .ch { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.post-preview .ch .cav { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-700); font-weight: 800; }
.post-preview .ch .cn { font-weight: 800; font-size: 14px; }
.post-preview .ch .cn small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.post-preview .ptext { font-size: 14px; line-height: 1.5; color: var(--text); font-weight: 500; }

/* ---------- Успех ---------- */
.success-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 20px; }
.success-ic { width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 22px; color: var(--accent); animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.success-wrap h1 { font-size: 24px; margin: 0 0 10px; letter-spacing: -.02em; }
.success-wrap p { color: var(--text-2); font-size: 15px; line-height: 1.5; margin: 0 0 26px; max-width: 300px; font-weight: 500; }

/* ---------- Нижняя навигация ---------- */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 78px; padding: 10px 20px 20px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-around; align-items: center; z-index: 30;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; color: var(--muted); transition: .15s; padding: 4px 10px; border-radius: 12px; }
.tab svg { width: 23px; height: 23px; }
.tab span { font-size: 10.5px; font-weight: 700; }
.tab.active { color: var(--accent-700); }
.tab.fab {
  background: var(--accent); color: #fff; width: 52px; height: 52px; border-radius: 18px;
  justify-content: center; margin-top: -18px; box-shadow: 0 10px 22px rgba(151,105,253,.45);
}
.tab.fab span { display: none; }
.tab.fab svg { width: 26px; height: 26px; }

/* ---------- Плавающая корзина ---------- */
.cart-fab {
  position: absolute; left: 18px; right: 18px; bottom: 20px; z-index: 25;
  background: var(--text); color: #fff; border-radius: var(--r-pill); padding: 15px 22px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  box-shadow: var(--shadow-lg); animation: slideup .3s ease;
}
@keyframes slideup { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cart-fab .l { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.cart-fab .count { background: var(--accent); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.cart-fab .r { font-weight: 800; }

/* ---------- Разное ---------- */
.empty { text-align: center; padding: 24px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin-bottom: 10px; color: var(--accent-soft); }
.empty p { font-weight: 600; font-size: 14px; margin: 0; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-700); font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: var(--r-pill); }
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.toast {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 13px 22px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 14px; z-index: 999; box-shadow: var(--shadow-lg);
  animation: toastin .3s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }


/* ---------- Mini App: полноэкранный режим внутри MAX ---------- */
.device {
  width: 100%; max-width: var(--app-w); margin: 0 auto; height: 100vh; height: 100dvh;
  position: relative; display: flex; flex-direction: column; background: var(--bg);
}
.screen { padding-top: max(6px, env(safe-area-inset-top)); }
.tabbar { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
button { font-family: var(--font); }
a.btn { text-decoration: none; }
.link { color: var(--accent-700); font-weight: 700; text-decoration: none; cursor: pointer; }
.lead-contact { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.check-inline { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin: 4px 0 14px; }
.check-inline input { width: 20px; height: 20px; accent-color: var(--accent); }
.uploader .upcell { position: relative; }
.uploader .upcell .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(22,22,22,.65); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.uploader input[type=file] { display: none; }
.gallery img, .thumb img, .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.gallery-strip img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; cursor: pointer; flex: none; }
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 24px; gap: 14px; }
.gate img { height: 44px; }
.gate h1 { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 0; }
.gate p { color: var(--text-2); font-weight: 500; line-height: 1.5; margin: 0; max-width: 320px; }
.admin-shop { padding: 14px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag.blocked { background: #ffe6e9; color: var(--danger); }

/* ---------- Удобство и доступность ---------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.iconbtn, .chip, .tab, .btn-sm { min-height: 44px; }
.iconbtn { min-width: 44px; }
.toast { max-width: calc(100vw - 32px); text-align: center; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.skel { padding: 18px 2px; display: grid; gap: 14px; }
.skel i { display: block; border-radius: 16px; background: linear-gradient(90deg, #efe9fb 25%, #f8f5ff 50%, #efe9fb 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel-h { height: 54px; width: 60%; }
.skel-b { height: 92px; }
.skel-b.short { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.sheet-overlay { position: fixed; inset: 0; background: rgba(22,22,22,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 1000; animation: fade .15s ease; }
.sheet { width: 100%; max-width: var(--app-w); background: var(--surface); border-radius: 28px 28px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.01em; }
.sheet p { margin: 0 0 18px; color: var(--text-2); font-weight: 500; line-height: 1.45; font-size: 14.5px; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }

/* --- Кроп фото --- */
.cropper .crop-info { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.crop-frame { position: relative; width: min(280px, 78vw); aspect-ratio: 1; margin: 2px auto 8px; border-radius: var(--r-md); overflow: hidden; background: #000; touch-action: none; cursor: grab; }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-frame::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); border-radius: var(--r-md); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 6px 4px 4px; color: var(--muted); font-weight: 700; }
.crop-zoom input[type=range] { flex: 1; accent-color: var(--accent); }

/* --- Карточка-предупреждение (удаление/восстановление) --- */
.danger-card { background: #fff2f2; border: 1px solid #ffd6d6; border-radius: var(--r-sm); padding: 14px; color: var(--danger); }
.danger-card .btn-primary { background: var(--accent); color: #fff; }

/* --- Подвал витрины с логотипом MAX Витрина --- */
.shop-footer { text-align: center; padding: 22px 0 6px; margin-top: 20px; }
.shop-footer .sf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.shop-footer .sf-actions .btn-sm svg { width: 15px; height: 15px; }
.shop-footer .sf-contact { margin-top: 12px; font-size: 13px; color: var(--text-2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.shop-footer .sf-contact svg { width: 14px; height: 14px; }
.shop-footer .sf-brand { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shop-footer .sf-brand .brand-lockup { opacity: .55; }
.shop-footer .sf-brand span { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }

/* --- Лого-связка «Max Витрина» --- */
.brand-lockup { display: inline-block; vertical-align: middle; }

/* --- Полиш: анимации кнопок, чипов, карточек, переходов --- */
.btn { transition: transform .12s ease, box-shadow .22s ease, background .2s ease, filter .2s ease; will-change: transform; }
.btn:active { transform: scale(.97); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(151,105,253,.42); }
.btn-primary:active { transform: scale(.97); }
.btn-lg { transition: transform .12s ease, box-shadow .22s ease, background .2s ease; }
.chip:active, .seg-btn:active, .swatch:active { transform: scale(.94); }
.chip.active { animation: pop .2s ease; }
.tab:active { transform: scale(.9); }
.tab.active svg { animation: pop .24s ease; }
.tab.fab:active { transform: scale(.88); }
.swatch { transition: transform .14s ease, box-shadow .2s ease; }
.emoji-grid .em:active { transform: scale(.85); }
.pcard { transition: transform .14s ease, box-shadow .22s ease; }
.pcard:hover, .svc-card:hover { box-shadow: 0 12px 26px rgba(90,60,180,.14); }
.pcard:active, .svc-card:active { transform: scale(.98); }
.add { transition: transform .14s ease, box-shadow .2s ease; }
.add:hover { transform: scale(1.1); }
.add:active { transform: scale(.88); }
.cart-fab { animation: fabIn .32s cubic-bezier(.2,.7,.3,1); transition: transform .15s ease, box-shadow .22s ease; }
.cart-fab:active { transform: scale(.98); }
.action { transition: transform .14s ease, box-shadow .22s ease; }
.action:active { transform: scale(.97); }
.stat { transition: transform .14s ease; }
.stat:active { transform: scale(.97); }
@keyframes pop { 0% { transform: scale(.82); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes fabIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* более плавный переход между экранами */
.fade-in { animation: fade .32s cubic-bezier(.22,.61,.36,1); }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* --- Заголовки секций в настройках --- */
.settings-sec { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-700); margin: 16px 2px 8px; }
.settings-sec:first-of-type { margin-top: 4px; }

/* --- Панель форматирования поста --- */
.fmt-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.fmt-btn { width: 42px; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; cursor: pointer; font-size: 16px; color: var(--text); transition: transform .12s ease, background .15s ease; }
.fmt-btn:hover { background: var(--accent-softer); }
.fmt-btn:active { transform: scale(.9); }

.checklist { margin-bottom: 14px; }
.ck-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.ck-head span { color: var(--muted); font-weight: 700; }
.ck-bar { height: 6px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; margin-bottom: 8px; }
.ck-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.ck-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ck-row.ok { color: var(--muted); cursor: default; text-decoration: line-through; }
.ck-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent-soft); display: grid; place-items: center; flex: none; }
.ck-row.ok .ck-dot { background: var(--success); border-color: var(--success); color: #fff; }
.ck-dot svg { width: 13px !important; height: 13px !important; }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; min-width: 0; }
.promo-row { display: flex; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.promo-row > div { flex: 1; }
.chips { flex-wrap: wrap; }

/* ---------- Тарифы ---------- */
.plan-card { margin-bottom: 12px; }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card.pro { background: linear-gradient(160deg, var(--accent-softer), var(--surface)); }
.plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 18px; }
.plan-top b { display: flex; gap: 6px; align-items: center; }
.plan-price { font-weight: 800; color: var(--accent-700); font-size: 22px; }
.plan-price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-f { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; color: var(--text-2); padding: 4px 0; }
.plan-f svg { color: var(--success); width: 15px !important; height: 15px !important; }
.periods .disc { color: var(--success); font-weight: 800; margin-left: 4px; }
.chip.active .disc { color: #b9f3d3; }
.swatch.locked { opacity: .45; }
.swatch.locked::before { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
button:disabled { opacity: .55; cursor: not-allowed; }
