:root {
  --bg: #0d0f17;
  --bg2: rgba(18, 20, 31, 0.92);
  --card: rgba(23, 26, 39, 0.78);
  --card2: rgba(29, 33, 51, 0.85);
  --border: rgba(56, 62, 92, 0.75);
  --text: #eef0f8;
  --muted: #8a90a8;
  --faint: rgba(238, 240, 248, 0.45);
  --accent: #4a7dff;
  --accent2: #7c5cff;
  --green: #34c77b;
  --red: #ff5a6a;
  --yellow: #ffce4d;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  background-color: #0b0d17;
  background-image:
    radial-gradient(900px 480px at 85% -12%, rgba(124, 92, 255, 0.20), transparent 62%),
    radial-gradient(760px 420px at -12% 24%, rgba(74, 125, 255, 0.13), transparent 60%),
    radial-gradient(900px 640px at 50% 115%, rgba(124, 92, 255, 0.10), transparent 62%);
  background-attachment: fixed;
}
#app { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-top: calc(74px + env(safe-area-inset-top)); }
.page { flex: 1; padding: 0 14px 168px; animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- светлая тема ---------- */
html.light {
  --bg: #eef0f8;
  --bg2: rgba(255, 255, 255, 0.94);
  --card: rgba(255, 255, 255, 0.86);
  --card2: rgba(240, 242, 250, 0.92);
  --border: rgba(110, 120, 160, 0.35);
  --text: #1b1e2b;
  --muted: #5d6478;
  --faint: rgba(27, 30, 43, 0.45);
}
html.light body {
  background-color: #eef0f8;
  background-image:
    radial-gradient(900px 480px at 85% -12%, rgba(124, 92, 255, 0.16), transparent 62%),
    radial-gradient(760px 420px at -12% 24%, rgba(74, 125, 255, 0.12), transparent 60%),
    radial-gradient(900px 640px at 50% 115%, rgba(124, 92, 255, 0.10), transparent 62%);
}
html.light .header { background: rgba(255, 255, 255, 0.62); border-bottom-color: rgba(110, 120, 160, 0.25); }
html.light .nav-inner { background: rgba(255, 255, 255, 0.62); border-color: rgba(110, 120, 160, 0.25); }
html.light .icon-btn { background: rgba(255, 255, 255, 0.7); }
html.light .balance-chip { background: rgba(255, 255, 255, 0.7); }
html.light .msg-bubble { background: rgba(234, 236, 246, 0.95); }
html.light .msg-bubble.me { background: rgba(74, 125, 255, 0.16); }
html.light .toast { background: #2a2f45; color: #fff; }
html.light .p-card .title, html.light .cat-card .t { color: inherit; }
html.light .switch .thumb { background: #fff; border: 1px solid rgba(0,0,0,.1); }

/* ---------- ПК: широкий полноэкранный режим (16:9) ---------- */
.desktop #app { max-width: 100%; }
.desktop .page { max-width: 1080px; margin: 0 auto; width: 100%; }
.desktop .cat-grid { grid-template-columns: repeat(4, 1fr); }
.desktop .p-list { grid-template-columns: repeat(4, 1fr); }
.desktop .stats-grid { grid-template-columns: repeat(4, 1fr); }
.desktop .stat-grid { grid-template-columns: repeat(3, 1fr); }
.desktop .form-card, .desktop .product-hero, .desktop .product-block, .desktop .review-card {
  max-width: 760px; margin-left: auto; margin-right: auto;
}
.desktop .modal { border-radius: 18px; margin-bottom: 5vh; }

/* ---------- баннеры (квадрат 1:1) ---------- */
.cat-banner { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; margin-bottom: 9px; display: block; }
.p-card-inner { display: flex; gap: 12px; align-items: flex-start; }
.p-thumb { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.p-body { flex: 1; min-width: 0; }
.product-banner { display: block; width: min(300px, 72%); aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; margin: 0 auto; border: 1px solid var(--border); }
.banner-square { width: 120px; height: 120px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); margin: 8px auto; display: block; }
.banner-square-sm { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.bg-preview { width: 76px; height: 46px; border-radius: 9px; border: 1px solid var(--border); background-size: cover; background-position: center; flex-shrink: 0; }
.bg-preview-big { position: relative; height: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.bg-preview-big .img { position: absolute; inset: -34px; background-size: cover; background-position: center; }
.bg-preview-big .dim { position: absolute; inset: 0; }
.bg-preview-big .empty-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
input[type="range"] { width: 100%; accent-color: #7c5cff; height: 26px; }
.product-hero .top-right { position: absolute; right: 12px; top: 12px; }

/* ---------- кастомный фон маркета (картинка + затемнение + размытие) ---------- */
html.has-bg body { background-image: none; background-color: #0b0d17; }
html.has-bg body::before {
  content: ''; position: fixed; inset: -60px; z-index: -2;
  background-image: var(--bg-image); background-size: cover; background-position: center;
  filter: blur(var(--bg-blur, 0px));
}
html.has-bg body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(11, 13, 23, var(--bg-dim, 0.4));
}

/* ---------- header (плавающая скруглённая плашка, по ширине контента) ---------- */
.header {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(calc(100vw - 20px), 640px); z-index: 40;
  background: rgba(13, 15, 23, 0.55);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.header-inner {
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
}
.desktop .header { width: min(calc(100vw - 20px), 1080px); }
.header .brand { display: flex; align-items: center; gap: 9px; cursor: pointer; transition: opacity 0.15s; }
.header .brand:hover { opacity: 0.8; }
.header .brand img { width: 34px; height: 34px; border-radius: 9px; }
.header .brand .name { font-size: 19px; font-weight: 800; letter-spacing: 0.2px; color: var(--text); }
.header .spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 37px; height: 37px; border-radius: 50%;
  background: rgba(23, 26, 39, 0.55); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  color: var(--muted); padding: 0; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(74, 125, 255, 0.35); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.mini { width: 27px; height: 27px; font-size: 12px; background: none; }
.balance-chip {
  background: rgba(23, 26, 39, 0.55); border: 1px solid var(--border); border-radius: 20px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 700; color: var(--green); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.balance-chip:hover { border-color: var(--green); box-shadow: 0 0 12px rgba(52, 199, 123, 0.3); }

.search-wrap { position: relative; margin: 2px 0 12px; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.55; font-size: 14px; z-index: 1; pointer-events: none; }
input[type=text], input[type=number], input[type=url], textarea, select {
  width: 100%; background: rgba(20, 23, 36, 0.45); color: var(--text);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 13px; font-size: 15px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.search-wrap input { padding-left: 34px; border-radius: 13px; }

/* ---------- categories ---------- */
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 16px 0 9px; text-align: center; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-grid .empty { grid-column: 1 / -1; }

/* ---------- рекламный слайдер на главной ---------- */
.promo-slider { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); margin: 12px 0 26px; aspect-ratio: 1000 / 300; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25); }
@media (max-width: 540px) { .promo-slider { aspect-ratio: 1000 / 380; } }
.promo-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.promo-slide { min-width: 100%; height: 100%; }
.promo-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(10, 12, 20, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; font-size: 19px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s; padding: 0 0 2px 0;
}
.promo-arrow:hover { background: rgba(74, 125, 255, 0.65); }
.promo-arrow:active { transform: translateY(-50%) scale(0.9); }
.promo-arrow.left { left: 9px; }
.promo-arrow.right { right: 9px; }
.promo-dots { position: absolute; bottom: 9px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.promo-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); transition: background 0.2s, transform 0.2s; }
.promo-dots span.on { background: #fff; transform: scale(1.25); }
.promo-mini { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.cat-card {
  background: rgba(20, 23, 36, 0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius);
  padding: 13px 13px; cursor: pointer; transition: border-color 0.15s, transform 0.1s;
}
.cat-card:active { transform: scale(0.98); }
.cat-card .t { font-weight: 700; font-size: 15px; }
.cat-card .n { color: var(--muted); font-size: 12px; margin-top: 3px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 13px; color: var(--muted);
  background: rgba(20, 23, 36, 0.45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 9px 13px; width: fit-content; max-width: 100%;
}
.breadcrumb a { color: var(--accent); text-decoration: none; cursor: pointer; }
.breadcrumb .cur { color: var(--text); font-weight: 600; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; background: var(--card); border: 1px solid var(--border); color: var(--muted);
  border-radius: 18px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }

/* ---------- product cards (сетка как у категорий) ---------- */
.p-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: start; }
.p-list .empty { grid-column: 1 / -1; }
.admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.p-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; cursor: pointer; transition: border-color 0.15s, transform 0.1s;
}
.p-card:active { transform: scale(0.985); }
.p-card .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.p-card .title { font-weight: 700; font-size: 15px; }
.p-card .price { color: var(--green); font-weight: 800; white-space: nowrap; font-size: 15px; }
.p-card .meta { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { background: var(--card2); border-radius: 7px; padding: 3px 8px; font-size: 12px; color: var(--muted); }
.tag.type { color: #b9a4ff; }
.tag.warn { color: var(--yellow); }
.tag.ok { color: var(--green); }
.tag.bad { color: var(--red); }
.p-card .seller { margin-top: 7px; font-size: 13px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; border: none; border-radius: 13px; cursor: pointer;
  padding: 13px 16px; font-size: 15px; font-weight: 700; font-family: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: linear-gradient(90deg, #e5484d, #ff5a6a); }
.btn.green { background: linear-gradient(90deg, #22a565, #34c77b); }
.btn.sm { padding: 8px 12px; font-size: 13px; width: auto; border-radius: 10px; }
.btn-row { display: flex; gap: 9px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ---------- bottom nav (скруглённая пилюля с размытием) ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 0 14px calc(50px + 7px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  position: relative;
  display: flex; gap: 4px; padding: 5px;
  background: rgba(18, 21, 33, 0.55);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  max-width: min(92vw, 460px);
}
/* плавающий индикатор выбранной вкладки — стеклянная заливка с размытием */
.nav-slider {
  position: absolute; top: 5px; left: 0; height: calc(100% - 10px);
  border-radius: 19px;
  background: rgba(124, 92, 255, 0.20);
  border: 1px solid rgba(140, 120, 255, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
.nav-slider.no-anim { transition: none; }
html.light .nav-slider { background: rgba(74, 125, 255, 0.16); border-color: rgba(74, 125, 255, 0.35); }
.nav-item {
  position: relative; z-index: 1;
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 10px 18px; border: none; background: none; color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  border-radius: 19px; transition: color 0.25s;
  white-space: nowrap;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }
/* чёрно-белые иконки; у выбранной вкладки — цвет */
.nav-item .ic, .nav-item .nav-ic { filter: grayscale(1) opacity(0.6); transition: filter 0.3s ease; }
.nav-item.active .ic, .nav-item.active .nav-ic { filter: none; }
.nav-item .ic { font-size: 18px; line-height: 1; }
.nav-ic { width: 21px; height: 21px; object-fit: contain; }
.nav-item .badge {
  position: absolute; top: 3px; right: 6px; background: var(--red); color: #fff;
  border-radius: 10px; font-size: 10px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.page-fade { animation: fadein 0.25s ease; }

/* ---------- profile (колонкой, по левому краю поиска) ---------- */
.profile-head { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; padding: 16px 0 4px; position: relative; }
.profile-head .top-right { position: absolute; right: 0; top: 14px; }
.profile-head .avatar-wrap { margin: 0; }
.profile-head .name-row { justify-content: flex-start; margin-top: 8px; align-items: center; }
.profile-head .nick { font-size: 20px; }
.profile-head .days { margin-top: 3px; }
.profile-head .counts { margin-top: 6px; }
.profile-head .counts .sep { color: var(--faint); margin: 0 2px; }
.profile-head .stars-row { justify-content: flex-start; margin-top: 5px; }
.linkish { cursor: pointer; color: var(--accent); transition: opacity 0.15s; }
.linkish:hover { opacity: 0.75; text-decoration: underline; }

/* ---------- финансы ---------- */
.finance-hero {
  text-align: center; padding: 22px 14px 16px;
  background: rgba(20, 23, 36, 0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}
.finance-warn { color: var(--red); font-size: 12.5px; margin-top: 10px; }
.finance-hero .l { color: var(--muted); font-size: 14px; }
.finance-hero .v { font-size: 40px; font-weight: 900; letter-spacing: 0.4px; margin-top: 4px;
  background: linear-gradient(90deg, var(--green), #7ee0a8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.finance-hero .rate { color: var(--muted); font-size: 12px; margin-top: 8px; }
.finance-actions .btn { font-size: 16px; }
.pay-preview { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-top: 10px; font-size: 14px; }
.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pay-method {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 15px; cursor: pointer; font-family: inherit; color: var(--text);
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.2s;
}
.pay-method:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.pay-method img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pay-method .pm-name { font-weight: 800; font-size: 16px; }
.pay-method .pm-fee { color: var(--muted); font-size: 13px; margin-left: auto; }
.fin-ic { font-size: 22px; width: 38px; text-align: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); background: var(--card2); }
.avatar.big { width: 84px; height: 84px; }
.avatar-wrap { position: relative; width: fit-content; cursor: pointer; }
.avatar-edit {
  position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(20, 23, 36, 0.92); border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.avatar-wrap:hover .avatar-edit { background: rgba(48, 54, 80, 0.95); }
html.light .avatar-edit { background: rgba(255, 255, 255, 0.95); }
.profile-head .info { flex: 1; min-width: 0; }
.profile-info-card {
  width: 100%;
  background: rgba(20, 23, 36, 0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 11px 14px 12px;
}
.profile-head.has-copy .info { padding-right: 44px; }
.profile-head .name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.profile-head .nick { font-size: 18px; font-weight: 800; }
.profile-head .days { color: var(--faint); font-size: 12.5px; }
.profile-head .counts { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.stars-row { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.stars { display: flex; gap: 1px; font-size: 14px; letter-spacing: 1px; }
.stars .on { color: var(--yellow); }
.stars .off { color: #3a3f58; }
.rating-num { font-weight: 800; font-size: 13.5px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 13px; }
.stat-card .l { color: var(--muted); font-size: 12.5px; }
.stat-card .v { font-size: 17px; font-weight: 800; margin-top: 3px; }
.stat-card .v.green { color: var(--green); }

/* ---------- product page ---------- */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent);
  background: rgba(20, 23, 36, 0.45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 10px 14px; margin: 6px 0 4px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.product-hero { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.product-hero h1 { font-size: 18px; font-weight: 800; }
.product-hero .price { font-size: 24px; font-weight: 800; color: var(--green); margin-top: 7px; }
.product-hero .payout { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.product-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
.product-block .lbl { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.seller-line { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.seller-line img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--card2); }
.seller-line .n { font-weight: 700; }
.seller-line .r { color: var(--muted); font-size: 12.5px; }

/* ---------- forms ---------- */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.field .hint.gray { color: var(--faint); }
.field .counter { text-align: right; color: var(--faint); font-size: 11.5px; margin-top: 4px; }
textarea { resize: vertical; min-height: 74px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card2); border-radius: 12px; padding: 11px 13px; }
.toggle-row .tl { font-size: 14px; font-weight: 700; }
.toggle-row .td { color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; cursor: pointer; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 15px; transition: 0.2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .track { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.switch input:checked + .track .thumb { transform: translateX(20px); }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- reviews ---------- */
.review-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; }
.review-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review-card .product { color: var(--accent); font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.review-card .text { color: var(--text); margin-top: 5px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.review-card .by { color: var(--muted); font-size: 12px; margin-top: 7px; }

/* ---------- admin ---------- */
.admin-menu { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.admin-item {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px; cursor: pointer; transition: transform 0.1s;
}
.admin-item:active { transform: scale(0.985); }
.admin-item .ic { font-size: 21px; }
.admin-item .t { font-weight: 700; }
.admin-item .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.admin-item .cnt { margin-left: auto; background: var(--red); color: #fff; border-radius: 11px; font-size: 12px; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; padding: 0 6px; font-weight: 700; }
.admin-item .cnt.zero { display: none; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg-bubble { background: var(--card2); border-radius: 12px; padding: 9px 12px; margin-top: 8px; max-width: 92%; }
.msg-bubble .who { font-size: 12px; font-weight: 700; color: var(--accent); }
.msg-bubble .txt { margin-top: 3px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.msg-bubble.me { margin-left: auto; background: #243043; }

.table-like { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; cursor: pointer; }
.user-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--card2); }
.user-row .n { font-weight: 700; font-size: 14px; }
.user-row .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.user-row .right { margin-left: auto; text-align: right; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 12, 0.72);
  display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 640px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto; animation: slideup 0.2s;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0.4; } }
.modal h3 { font-size: 17px; margin-bottom: 12px; }
.modal .close-x { float: right; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }

/* ---------- футер ниже панели навигации ---------- */
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 29;
  text-align: center;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(13, 15, 23, 0.6);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
html.light .footer-bar { background: rgba(255, 255, 255, 0.62); }
.footer-bar .copy { color: var(--faint); font-size: 10.5px; letter-spacing: 0.2px; line-height: 1.4; }
.footer-bar .copy button {
  background: none; border: none; color: var(--faint); font-size: 10.5px; cursor: pointer;
  text-decoration: underline; font-family: inherit; transition: color 0.15s; padding: 0;
}
.footer-bar .copy button:hover { color: var(--muted); }

.gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 24px; gap: 14px; }
.gate .big { font-size: 52px; }
.gate h2 { font-size: 20px; }
.gate p { color: var(--muted); font-size: 14px; max-width: 340px; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  background: #262c40; color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; max-width: 86vw; text-align: center;
  animation: slideup 0.18s;
}

.divider { height: 1px; background: var(--border); margin: 12px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row .grow { flex: 1; }
 pre.code {
  background: #0a0c12; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Consolas, monospace;
}
.copy-link-btn { background: var(--card2); border: 1px solid var(--border); color: var(--accent); border-radius: 9px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; font-family: inherit; font-weight: 600; transition: border-color 0.15s, box-shadow 0.15s; }

/* ---------- кастомные иконки в кнопках/тегах ---------- */
.btn-ic { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; margin-right: 2px; }
.btn .btn-ic { display: inline-block; }
.mini-ic { width: 14px; height: 14px; object-fit: contain; }
.avatar-edit img { width: 13px; height: 13px; object-fit: contain; display: block; }
.tag-ic { width: 12px; height: 12px; object-fit: contain; vertical-align: -1.5px; margin-right: 1px; }
.toggle-row .tl .btn-ic { vertical-align: -3.5px; margin-right: 3px; }

/* ---------- hover-подсветка (ПК) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.13); box-shadow: 0 6px 22px rgba(90, 110, 255, 0.38); }
  .btn.secondary:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(74, 125, 255, 0.22); }
  .btn.danger:hover { box-shadow: 0 6px 20px rgba(255, 90, 106, 0.35); }
  .btn.green:hover { box-shadow: 0 6px 20px rgba(52, 199, 123, 0.35); }
  .cat-card:hover, .p-card:hover, .admin-item:hover, .user-row:hover, .review-card:hover, .stat-card:hover, .product-block:hover {
    border-color: rgba(124, 92, 255, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  }
  .chip:hover { border-color: var(--accent); color: var(--text); }
  .copy-link-btn:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(74, 125, 255, 0.3); }
  .back-btn:hover { opacity: 0.75; }
  .avatar-wrap:hover .avatar-edit { background: rgba(48, 54, 80, 0.95); }
}
.cat-card, .p-card, .admin-item, .user-row, .review-card, .stat-card, .product-block, .product-hero, .chip, .back-btn, .footer-rules button {
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.2s ease, color 0.16s ease, opacity 0.15s ease;
}
