:root {
  --vk-blue: #00529e;
  --vk-blue-2: #004085;
  --vk-blue-bright: #0067b9;
  --vk-link: #004888;
  --vk-bg: #edeef0;
  --vk-card: #fff;
  --vk-line: #dce1e6;
  --vk-muted: #818c99;
  --vk-ink: #222;
  --vk-red: #e64646;
  --ok: #2d7a2d;
  --print: #0f9d8a;
  --print-2: #0b7f70;
  --sis-grad: linear-gradient(90deg, #004085 0%, #004c94 32%, #0059a6 68%, #0067b9 100%);
  --sis-grad-hover: linear-gradient(90deg, #00366f 0%, #004085 38%, #00529e 100%);
  --sis-grad-soft: linear-gradient(180deg, rgba(0, 24, 48, .10) 0%, transparent 45%, rgba(255, 255, 255, .08) 100%);
  --shadow: 0 1px 0 0 #dce1e6, 0 0 0 1px #e7e8ec;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Roboto", Tahoma, Arial, sans-serif;
  color: var(--vk-ink);
  background: var(--vk-bg);
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--vk-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, label { -webkit-tap-highlight-color: rgba(0, 82, 158, 0.18); }
.hidden { display: none !important; }
.muted { color: var(--vk-muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.error { color: var(--vk-red); }
.admin-only { display: none !important; }
html.is-admin .admin-only { display: block !important; }
html.is-admin .menu-item.admin-only { display: flex !important; }

/* Шапка */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(48px + var(--safe-top));
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  background-color: var(--vk-blue);
  background-image: var(--sis-grad-soft), var(--sis-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.topbar-inner {
  width: min(1180px, 100%);
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  letter-spacing: .3px;
  font-size: 16px;
  min-width: 0;
}
.logo:hover { text-decoration: none; }
.logo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--vk-blue);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.top-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.top-menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 4px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.top-menu-btn:hover { background: rgba(255, 255, 255, .22); text-decoration: none; }
.top-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #fff;
  color: var(--vk-blue);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.top-menu-wrap { position: relative; }
.app-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #fff;
  color: var(--vk-ink);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  padding: 6px;
  z-index: 40;
}
.app-menu a, .app-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--vk-ink);
}
.app-menu a:hover, .app-menu button:hover { background: #f0f2f5; text-decoration: none; }
.app-menu-sep, .menu-sep {
  margin: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--vk-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Раскладка */
.shell {
  flex: 1 0 auto;
  width: min(1180px, 100%);
  margin: 16px auto;
  padding: 0 12px 24px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.view { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--vk-card);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.section { padding: 14px 18px 16px; }
.section > h2, .section-head h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.section-head h2 { margin: 0; }
.page-title { margin: 0; font-size: 19px; font-weight: 600; }
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 10px;
  background: #e5ebf1;
  color: var(--vk-link);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

/* Левое меню */
.menu { padding: 6px; position: sticky; top: 64px; }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--vk-ink);
  padding: 8px 10px;
  border-radius: 4px;
  position: relative;
}
.menu-item:hover { background: #f0f2f5; text-decoration: none; }
.menu-item.active { background: #d7e8f6; font-weight: 600; }
.menu-item svg { flex: none; color: var(--vk-link); }
.menu-text-short { display: none; }
.menu-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 8px;
  background: var(--vk-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Кнопки и поля */
.btn {
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  min-height: 34px;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary {
  background-color: var(--vk-blue);
  background-image: var(--sis-grad);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background-color: var(--vk-blue-2); background-image: var(--sis-grad-hover); }
.btn-print { background: var(--print); color: #fff; }
.btn-print:hover:not(:disabled) { background: var(--print-2); }
.btn-default { background: #e5ebf1; color: var(--vk-ink); }
.btn-default:hover:not(:disabled) { background: #d9e1ea; }
.btn-ghost { background: transparent; color: var(--vk-link); }
.btn-ghost:hover:not(:disabled) { background: #f0f2f5; }
.btn-danger { background: #fff; color: var(--vk-red); border: 1px solid #e64646; }
.btn-ok { background: #e3f6e3; color: var(--ok); }
.btn-big { min-height: 44px; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.btn-wide { width: 100%; }
.btn-sm { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.btn-yandex { background: #fc3f1d; color: #fff; }
.btn-yandex:hover { background: #e63616; }
.btn-max { background: #1a1a1a; color: #fff; }
.btn-max:hover { background: #333; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
label.lab { display: block; margin: 10px 0 4px; color: #55677d; font-size: 12.5px; }
.input, .view input[type="text"], .view input[type="search"], .view input[type="tel"], .view input[type="email"],
.view input[type="number"], .view select, .view textarea,
.sheet input[type="text"], .sheet input[type="tel"], .sheet input[type="email"], .sheet input[type="number"],
.sheet select, .sheet textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #d3d9de;
  border-radius: 4px;
  background: #fff;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.4; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #6aa3d4;
  box-shadow: 0 0 0 2px rgba(0, 82, 158, .16);
}
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 8px 14px 0 0; }
.check input { width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e5ebf1;
  color: var(--vk-link);
  white-space: nowrap;
}
.badge.ok { background: #e3f6e3; color: var(--ok); }
.badge.warn { background: #fff4d6; color: #7a5b00; }
.badge.bad { background: #ffecec; color: var(--vk-red); }
.badge.print { background: #ddf8f2; color: var(--print-2); }
.badge.dark { background: #44505c; color: #fff; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #9fb6d0;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
  font-size: 13px;
}
.avatar.master { background: var(--vk-blue); }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; border: 3px solid #fff; }

/* Состояния */
.loading-card { padding: 28px; text-align: center; color: var(--vk-muted); }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #c5d4e8;
  border-top-color: var(--vk-blue);
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--vk-muted);
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: #eef3f8;
  color: var(--vk-link);
  display: grid;
  place-items: center;
}
.empty strong { display: block; margin-bottom: 4px; color: var(--vk-ink); font-size: 15px; }
.empty .btn { margin-top: 12px; }
.notice {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f4f6f8;
  color: #3d4b59;
}
.notice.ok { background: #eaf6ea; color: #24572a; }
.notice.warn { background: #fff7e0; color: #6a5200; }

/* Витрина */
.hero { overflow: hidden; }
.hero-cover {
  height: 92px;
  background-color: var(--vk-blue);
  background-image:
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, .18) 0 22px, transparent 23px),
    radial-gradient(circle at 92% 70%, rgba(255, 255, 255, .12) 0 14px, transparent 15px),
    var(--sis-grad-soft), var(--sis-grad);
}
.hero-body { padding: 0 18px 16px; margin-top: -42px; }
.hero-mark {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  color: var(--vk-blue);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.hero h1 { margin: 8px 0 2px; font-size: 20px; }
.hero p { margin: 0; color: #55677d; font-size: 14px; }
.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.hero-step {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 6px;
  background: #f4f7fb;
  color: #3d4b59;
}
.hero-step b {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vk-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.cat-bar { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.search-box { position: relative; }
.search-box input { padding-left: 34px !important; min-height: 40px !important; font-size: 14px; }
.search-box svg { position: absolute; left: 10px; top: 11px; color: var(--vk-muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip {
  flex: none;
  border: 1px solid var(--vk-line);
  background: #fff;
  color: var(--vk-ink);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: #f0f2f5; text-decoration: none; }
.chip.active { background: var(--vk-blue); border-color: var(--vk-blue); color: #fff; }
.chip .chip-n { opacity: .65; margin-left: 4px; font-size: 11px; }
.cat-desc { margin: 0; color: #55677d; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.p-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--vk-ink);
  transition: box-shadow .15s, transform .15s;
}
.p-card:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0, 40, 90, .14); transform: translateY(-1px); }
.p-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef2f6;
  overflow: hidden;
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b4c3d3; }
.p-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.p-badges .badge { box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.badge.hit { background: #ff7a18; color: #fff; }
.badge.new { background: var(--vk-blue); color: #fff; }
.badge.sale { background: var(--vk-red); color: #fff; }
.badge.free { background: var(--print); color: #fff; }
.p-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.p-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.p-summary {
  color: var(--vk-muted);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-prices { margin-top: auto; padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.p-price { font-weight: 700; font-size: 15px; }
.p-price s, .buy-price s { color: var(--vk-muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.p-print { color: var(--print-2); font-size: 12.5px; font-weight: 600; }

/* Карточка товара */
.crumbs { font-size: 12.5px; color: var(--vk-muted); margin-bottom: 6px; }
.product-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; padding: 16px 18px 18px; }
.gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #eef2f6;
  cursor: zoom-in;
  border: 0;
  padding: 0;
  width: 100%;
  display: block;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; background: #f4f6f8; }
.gallery-main .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b4c3d3; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.thumb {
  flex: none;
  width: 64px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #eef2f6;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active { border-color: var(--vk-blue); }
.product-info h1 { margin: 0 0 6px; font-size: 21px; line-height: 1.25; }
.product-info .lead { margin: 0 0 12px; color: #55677d; font-size: 14px; }
.buy-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--vk-line);
  border-radius: 8px;
  background: #fafbfc;
}
.buy-opt.stl { border-color: #c5d6ea; background: #f5f9fd; }
.buy-opt.print { border-color: #b3e3da; background: #f2fbf9; }
.buy-label { font-size: 12px; font-weight: 700; color: #55677d; text-transform: uppercase; letter-spacing: .04em; }
.buy-price { font-size: 20px; font-weight: 700; }
.buy-note { font-size: 12px; color: var(--vk-muted); min-height: 32px; }
.buy-opt .btn { margin-top: auto; }
.buy-extra { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.buy-tips { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: #55677d; font-size: 12.5px; }
.buy-tips li::before { content: "✓"; color: var(--print); font-weight: 700; margin-right: 6px; }
.my-prints-note { margin-top: 10px; }
.desc { font-size: 14px; line-height: 1.55; word-break: break-word; }
.desc p { margin: 0 0 10px; }
.specs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.specs td { padding: 7px 8px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.specs td:first-child { color: var(--vk-muted); width: 40%; }
.files-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; background: #f7f8fa; }
.files-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #e5ebf1;
  color: var(--vk-link);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; background: #fff7e0; border-radius: 4px; }

/* Комментарии */
.cmts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.cmt { display: flex; gap: 10px; }
.cmt.is-hidden { opacity: .55; }
.cmt-main { min-width: 0; flex: 1; }
.cmt-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.cmt-head b { font-size: 13px; }
.cmt-body { margin-top: 3px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.cmt-actions { margin-top: 4px; display: flex; gap: 12px; font-size: 12px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--vk-link); cursor: pointer; font-size: inherit; }
.link-btn.danger { color: var(--vk-red); }
.link-btn:hover { text-decoration: underline; }
.cmt-form { display: flex; flex-direction: column; gap: 8px; }
.cmt-form .btn { align-self: flex-end; }

/* Корзина */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.cart-list { display: flex; flex-direction: column; }
.cart-line {
  display: grid;
  grid-template-columns: 22px 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
}
.cart-line:last-child { border-bottom: 0; }
.cart-line input[type="checkbox"] { width: 18px; height: 18px; }
.line-cover { width: 72px; height: 56px; border-radius: 4px; overflow: hidden; background: #eef2f6; display: grid; place-items: center; color: #b4c3d3; }
.line-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-title { font-weight: 600; font-size: 14px; color: var(--vk-ink); }
.line-meta { font-size: 12px; color: var(--vk-muted); margin-top: 2px; }
.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line-amount { font-weight: 700; font-size: 15px; white-space: nowrap; }
.line-actions { display: flex; gap: 6px; }
.cart-sum { padding: 16px; position: sticky; top: 64px; display: flex; flex-direction: column; gap: 10px; }
.cart-sum .total { font-size: 22px; font-weight: 700; }
.pay-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: #f0f2f5; color: #3d4b59; }
.waiting-line { grid-template-columns: 72px minmax(0, 1fr) auto; }

/* Оплата */
.pay-sum { font-size: 15px; margin: 6px 0 12px; }
.pay-sum b { font-size: 20px; }
.pay-methods { display: grid; gap: 8px; }
.pay-opt {
  display: grid;
  grid-template-columns: 20px 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--vk-line);
  border-radius: 8px;
  cursor: pointer;
}
.pay-opt:has(input:checked) { border-color: var(--vk-blue); background: #f2f7fc; box-shadow: 0 0 0 1px var(--vk-blue) inset; }
.pay-opt input { width: 18px; height: 18px; margin: 0; }
.pay-opt small { display: block; color: var(--vk-muted); font-size: 12px; }
.pay-ic {
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.pay-ic.sbp { background: linear-gradient(135deg, #5b57a2, #1d9bd7 50%, #0db14b); }
.pay-ic.card { background: linear-gradient(135deg, #0f754e, #37a72e); }
.pay-ic.qr { background: #1a1a1a; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; text-align: center; }
.qr-box .qr { width: 230px; height: 230px; padding: 10px; background: #fff; border: 1px solid var(--vk-line); border-radius: 8px; }
.qr-box .qr svg, .qr-box .qr img { width: 100%; height: 100%; display: block; }
.pay-result { text-align: center; padding: 28px 18px; }
.pay-result .big-ic {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
  background: var(--print);
}
.pay-result .big-ic.bad { background: var(--vk-red); }
.pay-result .big-ic.wait { background: #c5d4e8; }
.pay-result h2 { margin: 0 0 6px; font-size: 19px; }
.pay-result .btn-row { justify-content: center; margin-top: 14px; }

/* Мои покупки */
.tabs { display: flex; gap: 4px; padding: 6px; overflow-x: auto; }
.tab {
  flex: none;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--vk-ink);
  font-weight: 600;
}
.tab:hover { background: #f0f2f5; text-decoration: none; }
.tab.active { background: #d7e8f6; color: var(--vk-link); }
.own-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 16px; }
.own-card + .own-card { border-top: 1px solid #eef0f3; }
.own-cover { width: 96px; height: 76px; border-radius: 6px; overflow: hidden; background: #eef2f6; display: grid; place-items: center; color: #b4c3d3; }
.own-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.own-title { font-size: 15px; font-weight: 600; color: var(--vk-ink); }
.own-meta { font-size: 12px; color: var(--vk-muted); margin: 2px 0 8px; }
.steps { display: flex; gap: 4px; margin: 10px 0 6px; flex-wrap: wrap; }
.step {
  flex: 1 1 0;
  min-width: 64px;
  text-align: center;
  font-size: 11px;
  color: var(--vk-muted);
  position: relative;
  padding-top: 12px;
}
.step::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  border-radius: 3px;
  background: #e5ebf1;
}
.step.done::before { background: var(--print); }
.step.now { color: var(--vk-ink); font-weight: 700; }
.step.now::before { background: var(--vk-blue); }
.status-line { font-weight: 600; }
.status-line.cancelled { color: var(--vk-red); }
.master-note { margin-top: 6px; padding: 8px 10px; background: #f2fbf9; border-left: 3px solid var(--print); border-radius: 4px; font-size: 13px; white-space: pre-wrap; }
.pay-row { padding: 12px 16px; border-top: 1px solid #eef0f3; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
.pay-row:first-child { border-top: 0; }
.pay-row ul { margin: 4px 0 0; padding-left: 18px; color: #55677d; font-size: 12.5px; }

/* Чат */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 120px); height: calc(100dvh - 120px); min-height: 420px; overflow: hidden; }
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); flex: 1 1 auto; min-height: 0; }
.chat-list { border-right: 1px solid var(--vk-line); display: flex; flex-direction: column; min-height: 0; background: #f7f8fa; }
.chat-list-head { padding: 12px 14px 8px; }
.chat-list-head h2 { margin: 0 0 8px; font-size: 16px; }
.chat-dialogs { overflow: auto; flex: 1; padding: 0 6px 8px; }
.chat-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  color: inherit;
}
.chat-row:hover { background: #eef2f6; text-decoration: none; }
.chat-row.active { background: #e5ebf1; }
.chat-row.unread .chat-row-name { font-weight: 700; }
.chat-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-preview { display: block; color: var(--vk-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--vk-muted); }
.chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--vk-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f6f8; flex: 1; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 58px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--vk-line);
  background: #fff;
}
.chat-head-name { font-weight: 600; font-size: 14px; }
.chat-back {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f2f5;
  color: var(--vk-link);
  font-size: 22px;
  line-height: 36px;
  text-align: center;
  flex: none;
}
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty { margin: auto; text-align: center; padding: 24px 12px; max-width: 320px; color: var(--vk-muted); }
.chat-day {
  align-self: center;
  margin: 6px 0 2px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e7ebf0;
  color: #5b6570;
  font-size: 11px;
  font-weight: 600;
}
.chat-bubble {
  max-width: min(78%, 520px);
  padding: 9px 12px 7px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e2e6eb;
  align-self: flex-start;
}
.chat-bubble.mine { align-self: flex-end; background: #eaf1f8; border-color: #d3e0ee; }
.chat-bubble-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; }
.chat-bubble-meta { margin-top: 4px; text-align: right; font-size: 11px; color: var(--vk-muted); }
.chat-form { display: flex; gap: 6px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--vk-line); background: #fff; flex: none; }
.chat-form textarea { flex: 1; min-height: 38px; max-height: 140px; resize: none; }
.chat-send-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: var(--vk-blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.chat-send-btn:disabled { opacity: .45; cursor: default; }

/* Профиль */
.cover {
  height: 72px;
  background-color: var(--vk-blue);
  background-image: var(--sis-grad-soft), var(--sis-grad);
  border-radius: 4px 4px 0 0;
}
.profile { padding: 0 18px 14px; margin-top: -36px; display: flex; gap: 14px; align-items: flex-end; }
.profile h2 { margin: 0 0 2px; font-size: 19px; }
.login-ways { display: grid; gap: 8px; }
.login-way { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--vk-line); border-radius: 6px; }
.login-way .way-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.way-ic.ya { background: #fc3f1d; }
.way-ic.mx { background: #1a1a1a; }
.login-way .grow { flex: 1; min-width: 0; }

/* Модальное окно */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 32, 45, .42);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px 12px calc(12px + var(--safe-bottom));
}
.sheet {
  width: min(520px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 16px 18px 18px;
  border-radius: 12px;
  position: relative;
}
.sheet h3 { margin: 0 32px 8px 0; font-size: 17px; }
.sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: #f0f2f5;
  border-radius: 50%;
  color: #55677d;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sheet-product { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 6px; background: #f7f8fa; }
.sheet-product .line-cover { width: 64px; height: 50px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--vk-line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.seg label:has(input:checked) { border-color: var(--vk-blue); background: #f2f7fc; color: var(--vk-link); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 36px; height: 36px; border: 1px solid var(--vk-line); background: #fff; border-radius: 4px; cursor: pointer; font-size: 18px; }
.qty input { width: 64px !important; text-align: center; }
.total-box { margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: #f2fbf9; color: #1d4d45; }
.total-box b { font-size: 16px; }
.max-wait { margin-top: 12px; padding: 10px 12px; background: #f4f6f8; border-radius: 6px; }
.max-wait p { margin: 0 0 8px; }
.login-sheet .btn { margin-top: 8px; }

/* Просмотр фото */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 20, .92); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 4px; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 26px;
  line-height: 1;
}
.lightbox-close { top: calc(12px + var(--safe-top)); right: 12px; }
.lightbox-nav.prev { left: 12px; top: 50%; }
.lightbox-nav.next { right: 12px; top: 50%; }

/* Уведомление */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #1f2a36;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}
.toast.bad { background: #8f1d1d; }
.toast a { color: #9fd0ff; font-weight: 600; white-space: nowrap; }

/* Подвал */
.site-foot { padding: 8px 12px calc(14px + var(--safe-bottom)); }
.site-foot-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-left: 212px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--vk-muted);
}

/* Администрирование */
.adm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; }
.adm-toolbar input[type="search"] { flex: 1 1 200px; width: auto; }
.adm-toolbar select { width: auto; flex: 0 1 200px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th { text-align: left; font-size: 11px; color: var(--vk-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--vk-line); }
.adm-table td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.adm-table tr.click { cursor: pointer; }
.adm-table tr.click:hover td { background: #f7f9fb; }
.adm-thumb { width: 56px; height: 42px; border-radius: 4px; overflow: hidden; background: #eef2f6; display: grid; place-items: center; color: #b4c3d3; }
.adm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.table-wrap { overflow-x: auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo-cell { border: 1px solid var(--vk-line); border-radius: 6px; overflow: hidden; background: #fff; }
.photo-cell img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-cell .btn-row { padding: 6px; gap: 4px; justify-content: space-between; }
.photo-cell .cover-mark { display: block; padding: 3px 6px; font-size: 11px; font-weight: 700; color: #fff; background: var(--vk-blue); text-align: center; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.progress { height: 6px; background: #e5ebf1; border-radius: 3px; overflow: hidden; flex: 1 1 160px; }
.progress i { display: block; height: 100%; background: var(--vk-blue); width: 0; transition: width .2s; }
.cat-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 80px auto auto; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef0f3; }
.order-card { padding: 14px 16px; border-bottom: 1px solid #eef0f3; }
.order-card:last-child { border-bottom: 0; }
.order-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.order-head b { font-size: 14px; }
.order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; font-size: 13px; color: #3d4b59; }
.order-edit { display: grid; grid-template-columns: 1.3fr .8fr .6fr; gap: 8px; margin-top: 10px; }
.order-edit .full { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding: 12px 14px; }
.kpi-val { font-size: 22px; font-weight: 700; }
.kpi-lab { font-size: 12px; color: var(--vk-muted); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: #8fb6dd; }
.chart .bar.alt { fill: var(--print); }
.chart text { font-size: 10px; fill: #818c99; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--vk-muted); margin-top: 4px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.period { display: flex; gap: 4px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .product-top { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-sum { position: static; }
  .stats-cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .shell {
    display: block;
    width: 100%;
    margin: 8px auto 0;
    padding: 0 8px calc(76px + var(--safe-bottom));
  }
  .view { gap: 8px; }
  .top-cart-text { display: none; }
  .logo { font-size: 15px; }
  .menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 40;
    display: flex;
    gap: 2px;
    padding: 6px 6px calc(8px + var(--safe-bottom));
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -1px 0 #dce1e6, 0 -8px 24px rgba(0, 0, 0, .06);
  }
  .menu .admin-only, html.is-admin .menu .admin-only { display: none !important; }
  .menu-item {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    min-height: 52px;
    font-size: 11px;
    text-align: center;
    border-radius: 8px;
  }
  .menu-text-full { display: none; }
  .menu-text-short { display: inline; }
  .menu-badge { position: absolute; top: 2px; right: calc(50% - 20px); margin: 0; }
  .site-foot { padding-bottom: calc(84px + var(--safe-bottom)); }
  .site-foot-inner { padding-left: 4px; }
  .hero-steps { grid-template-columns: 1fr; }
  .hero-cover { height: 64px; }
  .hero-body { margin-top: -34px; padding: 0 14px 14px; }
  .hero-mark { width: 60px; height: 60px; font-size: 19px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .p-body { padding: 8px 10px 10px; }
  .p-title { font-size: 14px; }
  .p-price { font-size: 14px; }
  .product-top { padding: 12px; gap: 12px; }
  .buy-box { grid-template-columns: 1fr; }
  .buy-note { min-height: 0; }
  .section { padding: 12px 14px 14px; }
  .cart-line { grid-template-columns: 22px 56px minmax(0, 1fr); padding: 12px; }
  .cart-line .line-side { grid-column: 2 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .line-cover { width: 56px; height: 44px; }
  .waiting-line { grid-template-columns: 56px minmax(0, 1fr); }
  .waiting-line .line-side { grid-column: 1 / -1; }
  .own-card { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; }
  .own-cover { width: 64px; height: 52px; }
  .form-grid { grid-template-columns: 1fr; }
  .order-edit { grid-template-columns: 1fr 1fr; }
  .cat-row { grid-template-columns: 1fr 1fr; }
  .sheet-overlay { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: calc(18px + var(--safe-bottom)); }
  .view input, .view select, .view textarea, .sheet input, .sheet select, .sheet textarea { font-size: 16px !important; }
  .chat-card { height: calc(100dvh - 140px - var(--safe-bottom)); min-height: 320px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-open .chat-list { display: none; }
  .chat-layout:not(.has-open) .chat-pane { display: none; }
  .chat-back { display: block; }
  .chat-bubble { max-width: 88%; }
  .adm-table .hide-m { display: none; }
}
