/* =============================================================================
   sizchat — дизайн-система
   Светлая тема: белый + небесно-голубой и бирюзовый (цвета доверия).
   Тёмная тема: как в Microsoft Copilot — графитовые панели, мягкие акценты.
   Файл подключают только страницы нового интерфейса (шапка/чат/каталог/кабинет).
   ========================================================================== */

:root {
  --brand-50:  #F0F9FF;
  --brand-100: #E0F2FE;
  --brand-200: #BAE6FD;
  --brand-300: #7DD3FC;
  --brand-400: #38BDF8;
  --brand-500: #0EA5E9;
  --brand-600: #0284C7;
  --brand-700: #0369A1;
  --teal-400:  #2DD4BF;
  --teal-500:  #14B8A6;
  --teal-600:  #0D9488;
  --grad-brand: linear-gradient(135deg, #38BDF8 0%, #22B8CF 55%, #14B8A6 100%);
  --grad-soft:  linear-gradient(135deg, #F0F9FF 0%, #F0FDFA 100%);

  --bg:         #FFFFFF;
  --bg-soft:    #F7FBFE;
  --bg-sunken:  #EFF7FC;
  --surface:    #FFFFFF;
  --surface-2:  #F8FBFD;
  --border:     #E3EEF6;
  --border-2:   #D3E5F0;

  --text:       #0F1B2A;
  --text-2:     #33506B;
  --muted:      #6B8399;
  --link:       #0369A1;

  --ok:   #0E9F6E;  --ok-bg:   #ECFDF5;
  --warn: #B45309;  --warn-bg: #FFFBEB;
  --err:  #DC2626;  --err-bg:  #FEF2F2;

  --shadow-sm: 0 1px 2px rgba(15,27,42,.06);
  --shadow:    0 6px 24px -8px rgba(15,27,42,.14), 0 2px 6px rgba(15,27,42,.05);
  --shadow-lg: 0 24px 60px -20px rgba(15,27,42,.28);
  --ring:      0 0 0 3px rgba(14,165,233,.28);

  --r-xs: 8px;  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-full: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --side-w: 292px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --speed: .18s;
}

html[data-theme="dark"] {
  --brand-50:  #10202E;
  --brand-100: #122A3A;
  --brand-200: #164055;
  --brand-300: #1D6A8C;
  --brand-400: #38BDF8;
  --brand-500: #4CC3F7;
  --brand-600: #7DD3FC;
  --brand-700: #BAE6FD;
  --grad-brand: linear-gradient(135deg, #2AA9E0 0%, #1FA3B8 55%, #17A79A 100%);
  --grad-soft:  linear-gradient(135deg, #16202B 0%, #152425 100%);

  --bg:         #16181D;
  --bg-soft:    #1B1F25;
  --bg-sunken:  #12141A;
  --surface:    #1E232B;
  --surface-2:  #232932;
  --border:     #2B323C;
  --border-2:   #3A434F;

  --text:       #F1F5F9;
  --text-2:     #CBD5E1;
  --muted:      #93A2B4;
  --link:       #7DD3FC;

  --ok: #34D399;  --ok-bg:   #10291F;
  --warn: #FBBF24; --warn-bg: #2A2313;
  --err: #F87171;  --err-bg:  #2C1618;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 8px 28px -10px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 30px 70px -24px rgba(0,0,0,.75);
  --ring:      0 0 0 3px rgba(76,195,247,.3);
}

/* ── Сброс ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 var(--sp-3); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0 0 var(--sp-3); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--brand-200); color: var(--text); }

/* Скроллбары — аккуратные, в тон теме */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ── Оболочка приложения ──────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.app--wide { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.app--noside { grid-template-columns: minmax(0, 1fr); }

/* Затемнение под выехавшей панелью. На широком экране его нет вовсе —
   важно, чтобы оно не занимало ячейку сетки .app (иначе колонки «съезжают»
   и содержимое уезжает вниз). */
.side-back { display: none; }

/* ── Боковая панель ───────────────────────────────────────────────────── */
.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
}
.side__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-4) var(--sp-3) var(--sp-3); }
.side__brand { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.side__brand img { height: 34px; width: auto; }
.side__brand:hover { text-decoration: none; }
.side__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-2) var(--sp-3) var(--sp-6); }
.side__group { margin: var(--sp-4) var(--sp-2) var(--sp-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.newchat {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; padding: 11px 14px; margin-bottom: var(--sp-2);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background var(--speed), border-color var(--speed), transform var(--speed);
}
.newchat:hover { background: var(--brand-50); border-color: var(--brand-300); text-decoration: none; }
.newchat:active { transform: translateY(1px); }
.newchat svg { width: 18px; height: 18px; flex: none; color: var(--brand-600); }

.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  transition: background var(--speed), color var(--speed);
}
.navlink:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.navlink.is-on { background: var(--brand-100); color: var(--brand-700); font-weight: 600; }
html[data-theme="dark"] .navlink.is-on { background: var(--brand-200); color: var(--brand-700); }
.navlink svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.navlink__badge { margin-left: auto; background: var(--brand-500); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: var(--r-full); padding: 1px 7px; }
html[data-theme="dark"] .navlink__badge { color: #06222F; }

/* История чатов */
.chatrow { position: relative; display: flex; align-items: center; gap: 6px; border-radius: var(--r-sm); }
.chatrow:hover { background: var(--bg-sunken); }
.chatrow.is-on { background: var(--brand-100); }
html[data-theme="dark"] .chatrow.is-on { background: var(--brand-200); }
.chatrow__link {
  flex: 1; min-width: 0; padding: 9px 10px; color: var(--text-2); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--r-sm);
}
.chatrow__link:hover { color: var(--text); text-decoration: none; }
.chatrow.is-on .chatrow__link { color: var(--brand-700); font-weight: 600; }
.chatrow__btn {
  flex: none; width: 28px; height: 28px; display: none; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); border-radius: var(--r-xs); cursor: pointer;
}
.chatrow:hover .chatrow__btn, .chatrow.is-open .chatrow__btn { display: flex; }
.chatrow__btn:hover { background: var(--bg-soft); color: var(--text); }
.chatmenu {
  position: absolute; right: 6px; top: 34px; z-index: 40; min-width: 176px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.chatmenu button, .chatmenu a {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; background: transparent; color: var(--text-2);
  border-radius: var(--r-xs); cursor: pointer; text-align: left; font-size: 14px;
}
.chatmenu button:hover, .chatmenu a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.chatmenu .is-danger { color: var(--err); }

.side__foot { border-top: 1px solid var(--border); padding: var(--sp-3); display: flex; flex-direction: column; gap: 6px; }
.side__user {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md);
  color: var(--text); border: 1px solid transparent;
}
.side__user:hover { background: var(--bg-sunken); text-decoration: none; }
.ava {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-full); overflow: hidden;
  background: var(--grad-brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.ava img { width: 100%; height: 100%; object-fit: cover; }
.side__user b { display: block; font-size: 14px; line-height: 1.2; }
.side__user span { display: block; font-size: 12px; color: var(--muted); }

/* ── Основная область ─────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 60px; padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); z-index: 20;
}
/* Важно: прячем бургер правилом специфичнее .iconbtn (display:grid),
   иначе иконка-кнопка перебивает display:none и бургер виден даже на ПК */
.topbar .topbar__burger { display: none; }
.topbar__title { font-weight: 700; font-size: 16px; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__sub { font-size: 12.5px; color: var(--muted); margin: 0; }
.topbar__spacer { flex: 1; }
.topbar__acts { display: flex; align-items: center; gap: var(--sp-2); }
/* Топбар «Тоня · эксперт по спецодежде…» нужен только планшетам и телефонам:
   на ПК он дублирует приветствие в самом чате — скрываем целиком */
@media (pointer: fine) {
  .topbar--touch-only { display: none; }
}
.content { flex: 1; min-height: 0; overflow-y: auto; }
.content--pad { padding: var(--sp-6) var(--sp-8) var(--sp-10); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; }
.wrap--narrow { max-width: 860px; }

/* ── Чат ──────────────────────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; flex: 1 1 auto; }
.thread { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.thread__inner { width: 100%; max-width: 780px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-4); }

.msg { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); animation: msg-in .22s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg__ava {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-full);
  background: var(--grad-brand); display: grid; place-items: center; color: #fff; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.msg__ava svg { width: 20px; height: 20px; }
.msg__col { min-width: 0; flex: 1; }
.msg__who { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.msg__who small { font-weight: 500; color: var(--muted); }
.bubble {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); border-top-left-radius: 6px;
  padding: 13px 16px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.bubble p:last-child { margin-bottom: 0; }
.bubble a { font-weight: 600; }
.msg--user { flex-direction: row-reverse; }
.msg--user .msg__col { display: flex; flex-direction: column; align-items: flex-end; }
.msg--user .msg__who { justify-content: flex-end; }
.msg--user .bubble {
  background: var(--grad-brand); color: #fff; border: 0;
  border-top-left-radius: var(--r-lg); border-top-right-radius: 6px;
}
.msg--user .msg__ava { background: var(--text-2); }
.msg__tools { display: flex; gap: 6px; margin-top: 6px; opacity: 0; transition: opacity var(--speed); }
.msg:hover .msg__tools { opacity: 1; }
.msg__tool {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: var(--r-full); padding: 2px 10px; font-size: 12px; cursor: pointer;
}
.msg__tool:hover { color: var(--text); border-color: var(--border-2); }

/* Индикатор «Тоня печатает» */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* «Разобрала запрос» — фильтры ответа */
.parsed { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.parsed span {
  font-size: 12px; background: var(--brand-50); color: var(--brand-700);
  border: 1px solid var(--brand-200); border-radius: var(--r-full); padding: 2px 10px;
}

/* Чипсы-подсказки */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 10px; }
.chips--center { justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
  border-radius: var(--r-full); padding: 8px 14px; font-size: 13.5px; cursor: pointer;
  transition: background var(--speed), border-color var(--speed), color var(--speed), transform var(--speed);
}
.chip:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-50); text-decoration: none; }
.chip:active { transform: translateY(1px); }
.chip.is-on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
html[data-theme="dark"] .chip.is-on { color: #06222F; }
.chip--ghost { background: transparent; border-style: dashed; }

/* Композер */
.composer { border-top: 1px solid var(--border); background: var(--bg); padding: var(--sp-3) var(--sp-5) var(--sp-5); }
.composer__inner { width: 100%; max-width: 780px; margin: 0 auto; }
.composer__box {
  display: flex; align-items: flex-end; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: 8px 8px 8px 12px; box-shadow: var(--shadow-sm);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.composer__box:focus-within { border-color: var(--brand-400); box-shadow: var(--ring); }
.composer__ta {
  flex: 1; min-height: 26px; max-height: 180px; resize: none; border: 0; outline: none;
  background: transparent; padding: 6px 2px; line-height: 1.5;
}
.composer__ta::placeholder { color: var(--muted); }
.iconbtn {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r-full); background: transparent;
  color: var(--text-2); cursor: pointer; transition: background var(--speed), color var(--speed);
}
.iconbtn:hover { background: var(--bg-sunken); color: var(--text); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn--send { background: var(--grad-brand); color: #fff; }
.iconbtn--send:hover { filter: brightness(1.05); color: #fff; }
.iconbtn--send[disabled] { opacity: .45; cursor: default; filter: none; }
.iconbtn--rec { color: var(--err); }
.iconbtn--rec.is-on { background: var(--err-bg); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.composer__hint { display: flex; justify-content: center; gap: var(--sp-3); margin-top: 8px; font-size: 12px; color: var(--muted); }
.composer__hint b { color: var(--text-2); font-weight: 600; }
.rec-bar {
  display: none; align-items: center; gap: 10px; margin-bottom: 8px;
  background: var(--err-bg); border: 1px solid color-mix(in srgb, var(--err) 30%, transparent);
  color: var(--err); border-radius: var(--r-md); padding: 8px 12px; font-size: 13.5px;
}
.rec-bar.is-on { display: flex; }
.rec-bar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); animation: pulse 1.2s infinite; }

/* Стартовый экран */
.hello { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100%; text-align: center; padding: var(--sp-8) var(--sp-5); }
.hello__mark { width: 64px; height: 64px; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: var(--sp-4); }
.hello__title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.03em; margin-bottom: var(--sp-2); }
.hello__title em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello__sub { color: var(--muted); max-width: 620px; margin: 0 auto var(--sp-6); }
.suggests { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 720px; margin: 0 auto; }
.suggest {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 8px 14px; cursor: pointer; color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.2; max-width: 100%;
  transition: border-color var(--speed), box-shadow var(--speed), background var(--speed);
}
.suggest:hover { border-color: var(--brand-300); box-shadow: var(--shadow); background: var(--surface-2); }
.suggest__ico { font-size: 15px; line-height: 1; }

/* О Тоне: биография, возможности и команды — компактно, без крупных кнопок */
.about { width: 100%; max-width: 760px; margin: var(--sp-6) auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); }
.about__lead { margin: 0 0 var(--sp-4); font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.about__lead b { color: var(--text); }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-6); margin-bottom: var(--sp-3); }
.about__h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0 0 8px; }
.about__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.about__list li { position: relative; padding-left: 15px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.about__list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px;
  border-radius: 2px; background: var(--grad-brand); }
.about__cmds { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.cmd {
  display: inline-flex; align-items: center; background: none; border: 1px dashed var(--border-2);
  border-radius: var(--r-full); padding: 6px 12px; cursor: pointer; color: var(--text-2);
  font-size: 12.5px; line-height: 1.2; transition: border-color var(--speed), color var(--speed);
}
.cmd:hover { border-style: solid; border-color: var(--brand-300); color: var(--text); }
@media (max-width: 640px) {
  .about__grid { grid-template-columns: 1fr; gap: var(--sp-3); }
}

/* ── Карточки товаров в чате ──────────────────────────────────────────── */
.pcards { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); margin-top: var(--sp-3); }
.pcard {
  display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-3); transition: border-color var(--speed), box-shadow var(--speed);
}
.pcard:hover { border-color: var(--brand-300); box-shadow: var(--shadow); }
.pcard__img {
  width: 116px; height: 116px; border-radius: var(--r-md); background: var(--grad-soft);
  display: grid; place-items: center; font-size: 40px; overflow: hidden; border: 1px solid var(--border);
}
.pcard__img img { width: 100%; height: 100%; object-fit: cover; }
.pcard__body { min-width: 0; display: flex; flex-direction: column; }
.pcard__top { display: flex; align-items: flex-start; gap: var(--sp-2); }
.pcard__name { font-weight: 600; font-size: 15px; line-height: 1.35; margin: 0 0 4px; color: var(--text); }
.pcard__name:hover { color: var(--brand-700); text-decoration: none; }
.pcard__meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; }
.pcard__why { font-size: 12.5px; color: var(--teal-600); margin-bottom: 8px; }
html[data-theme="dark"] .pcard__why { color: var(--teal-400); }
.pcard__foot { margin-top: auto; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.pcard__price { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.pcard__old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.pcard__disc { font-size: 11.5px; font-weight: 700; color: var(--err); background: var(--err-bg); border-radius: var(--r-full); padding: 2px 8px; }
.pcard__acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard__stock { font-size: 12px; color: var(--ok); font-weight: 600; }
.pcard__stock.is-low { color: var(--warn); }
.pcard__stock.is-out { color: var(--muted); }

/* Комплект на бригаду */
.bundle { margin-top: var(--sp-3); border: 1px solid var(--brand-200); background: var(--grad-soft); border-radius: var(--r-lg); padding: var(--sp-4); }
.bundle__head { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: var(--sp-3); }
.bundle__head span { font-size: 20px; }
.bundle__list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.bundle__row { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.bundle__row i { font-style: normal; color: var(--muted); }
.bundle__row b { margin-left: auto; font-weight: 600; white-space: nowrap; }
.bundle__sum { border-top: 1px dashed var(--border-2); padding-top: var(--sp-3); font-size: 14.5px; }
.bundle__sum b { font-size: 19px; font-weight: 800; }
.bundle__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ── Боковая панель товара (открывается в чате без перезагрузки) ──────── */
.sheet-back { position: fixed; inset: 0; background: rgba(10,20,30,.42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity var(--speed); z-index: 60; }
.sheet-back.is-on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 61;
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.sheet.is-on { transform: none; }
.sheet__top { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.sheet__title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-5); }
.sheet__foot { border-top: 1px solid var(--border); padding: var(--sp-4) var(--sp-5); display: flex; gap: var(--sp-2); flex-wrap: wrap; background: var(--surface-2); }

/* Галерея + характеристики на странице/панели товара */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--sp-6); }
.pdp__gal { position: sticky; top: 0; }
.pdp__main {
  aspect-ratio: 1 / 1; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--grad-soft); display: grid; place-items: center; font-size: 84px; overflow: hidden;
}
.pdp__main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pdp__thumbs { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.pdp__thumb { width: 64px; height: 64px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); overflow: hidden; cursor: pointer; padding: 0; }
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb.is-on { border-color: var(--brand-500); box-shadow: var(--ring); }
.pdp__buy { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); background: var(--surface); }
.pdp__price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.pdp__stock { font-size: 13.5px; font-weight: 600; color: var(--ok); }
.pdp__stock.is-low { color: var(--warn); }
.pdp__stock.is-out { color: var(--muted); }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: var(--sp-3); }
.specs td { padding: 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs td:first-child { color: var(--muted); width: 46%; padding-right: var(--sp-4); }
.trust { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-3) 0; }
.trust span { font-size: 12px; border: 1px solid var(--border-2); border-radius: var(--r-full); padding: 3px 10px; color: var(--text-2); background: var(--surface-2); }
.trust span.is-ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); background: var(--ok-bg); }

/* ── Каталог «по папкам» ──────────────────────────────────────────────── */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-4); }
.cat {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--sp-5); color: var(--text); overflow: hidden;
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.cat::after {
  content: ""; position: absolute; right: -32px; top: -32px; width: 132px; height: 132px;
  background: var(--grad-soft); border-radius: 50%; opacity: .85;
}
.cat:hover { border-color: var(--brand-300); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.cat__ico { font-size: 40px; line-height: 1; position: relative; }
.cat__name { font-size: 17px; font-weight: 700; position: relative; }
.cat__count { font-size: 12.5px; color: var(--muted); position: relative; }
.cat__arrow { position: relative; margin-top: auto; color: var(--brand-600); font-weight: 600; font-size: 13px; }

/* Фильтры каталога */
.filterbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-4); }
.filterbar__search { flex: 1; min-width: 220px; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-4); }
.ptile {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; color: var(--text);
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.ptile:hover { border-color: var(--brand-300); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.ptile__img { aspect-ratio: 4 / 3; background: var(--grad-soft); display: grid; place-items: center; font-size: 54px; overflow: hidden; }
.ptile__img img { width: 100%; height: 100%; object-fit: cover; }
.ptile__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ptile__name { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.ptile__meta { font-size: 12px; color: var(--muted); }
.ptile__price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.ptile__price b { font-size: 18px; font-weight: 800; }

/* ── Кнопки и бейджи ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: background var(--speed), border-color var(--speed), transform var(--speed), filter var(--speed);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-sunken); border-color: var(--border-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn--primary { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { filter: brightness(1.06); background: var(--grad-brand); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border-2); }
.btn--ghost:hover { background: var(--brand-50); border-color: var(--brand-300); }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
/* Иконки внутри кнопок: без явных размеров svg раздувается до 300×150
   и растягивает кнопку — задаём компактный размер всегда */
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { padding: 13px 22px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.btn--danger:hover { background: var(--err-bg); }
.btn[disabled] { opacity: .5; cursor: default; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: var(--r-full); padding: 3px 10px; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--border); }
.badge--ok  { background: var(--ok-bg);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge--warn{ background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge--err { background: var(--err-bg);  color: var(--err);  border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.badge--brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }

/* ── Формы и карточки ─────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.field__label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field__hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); transition: border-color var(--speed), box-shadow var(--speed);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-400); box-shadow: var(--ring); outline: none; }
.input--lg { padding: 14px 16px; font-size: 16px; border-radius: var(--r-lg); }
.textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand-500); }
.row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row--tight { gap: var(--sp-2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card__head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-3); }
.card__head h2, .card__head h3 { margin: 0; font-size: 16px; }
.card__body { padding: var(--sp-5); }
.card__foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card + .card { margin-top: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.ml-2 { margin-left: var(--sp-2); }
.flex { display: flex; align-items: center; gap: var(--sp-3); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ── Таблицы и списки (кабинет, корзина) ──────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl__num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.listrow { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.listrow:last-child { border-bottom: 0; }
.listrow__img { width: 64px; height: 64px; border-radius: var(--r-md); background: var(--grad-soft); display: grid; place-items: center; font-size: 26px; overflow: hidden; flex: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: var(--surface); cursor: pointer; color: var(--text-2); }
.qty button:hover { background: var(--bg-sunken); }
.qty input { width: 46px; height: 32px; border: 0; text-align: center; background: var(--surface); }

/* ── Вкладки кабинета ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--text-2); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-on { color: var(--brand-700); border-bottom-color: var(--brand-500); }

/* Баланс */
.money { font-variant-numeric: tabular-nums; }
.money--in { color: var(--ok); } .money--out { color: var(--err); }
.big-money { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }

/* ── Плашки показателей (админка) ────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
a.kpi { color: var(--text); transition: border-color var(--speed), box-shadow var(--speed); }
a.kpi:hover { border-color: var(--brand-300); box-shadow: var(--shadow); text-decoration: none; }

/* ── Аватары (админка) ──────────────────────────────────────────────── */
.ava { border-radius: var(--r-full); object-fit: cover; display: inline-grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.ava--32 { width: 32px; height: 32px; font-size: 13px; }
.ava--64 { width: 64px; height: 64px; font-size: 24px; }

/* ── Всплывающие сообщения ────────────────────────────────────────────── */
.flash { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.flash__i { padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--border); animation: msg-in .2s ease-out; }
.flash__i--ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.flash__i--err { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--r-full); box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity var(--speed), transform var(--speed); z-index: 95; font-size: 14px; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Заглушка-пустое состояние */
.empty { text-align: center; padding: var(--sp-10) var(--sp-5); color: var(--muted); }
.empty__ico { font-size: 48px; margin-bottom: var(--sp-3); }
.empty h3 { color: var(--text); }

/* Скелетон загрузки */
.skel { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--surface-2) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: skel 1.3s infinite; border-radius: var(--r-sm); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Экран входа ──────────────────────────────────────────────────────── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth__aside {
  background: var(--grad-brand); color: #fff; padding: var(--sp-10);
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.14); }
.auth__aside h2 { font-size: 30px; letter-spacing: -.03em; color: #fff; }
.auth__aside p { color: rgba(255,255,255,.88); font-size: 15px; max-width: 420px; }
.auth__feats { display: flex; flex-direction: column; gap: 12px; margin-top: var(--sp-6); position: relative; }
.auth__feat { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: rgba(255,255,255,.95); }
.auth__feat span { font-size: 19px; line-height: 1.2; }
.auth__main { display: flex; align-items: center; justify-content: center; padding: var(--sp-8) var(--sp-5); }
.auth__box { width: 100%; max-width: 400px; }
.auth__logo { height: 42px; margin-bottom: var(--sp-6); }
.seg { display: flex; background: var(--bg-sunken); border-radius: var(--r-md); padding: 4px; margin-bottom: var(--sp-5); }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; transition: background var(--speed), color var(--speed); }
.seg button.is-on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.seg a { flex: 1; display: flex; align-items: center; justify-content: center; padding: 9px 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--text-2); text-decoration: none; transition: background var(--speed), color var(--speed); }
.seg a:hover { color: var(--text); }
.seg a.is-on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.oauth { display: flex; flex-direction: column; gap: 10px; margin-top: var(--sp-4); }
.btn--yandex { background: #FC3F1D; border-color: transparent; color: #fff; }
.btn--yandex:hover { filter: brightness(1.06); background: #FC3F1D; color: #fff; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: var(--sp-5) 0; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.codecells { display: flex; gap: 10px; justify-content: space-between; }
.codecells input { width: 100%; text-align: center; font-size: 22px; font-weight: 700; padding: 12px 0; }

/* ── Нижняя навигация (мобильные) ─────────────────────────────────────── */
.tabs-bottom { display: none; }

/* ── Адаптив ──────────────────────────────────────────────────────────── */
/* Мобильная раскладка (сворачиваемая панель, бургер, нижние вкладки)
   включается ТОЛЬКО на сенсорных устройствах — планшетах и телефонах
   (pointer: coarse — палец вместо мыши). На ПК с любым окном (даже узким)
   остаётся десктопная раскладка: панель-колонка всегда видна, бургер не нужен. */
@media (max-width: 1180px) {
  .pdp { grid-template-columns: 1fr; }
  .pdp__gal { position: static; }
}
@media (max-width: 980px) and (pointer: coarse) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 70;
    transform: translateX(-102%); transition: transform .24s cubic-bezier(.22,.61,.36,1);
    box-shadow: var(--shadow-lg);
  }
  .side.is-on { transform: none; }
  .side-back { display: block; position: fixed; inset: 0; background: rgba(10,20,30,.42); opacity: 0; pointer-events: none; transition: opacity var(--speed); z-index: 69; }
  .side-back.is-on { opacity: 1; pointer-events: auto; }
  .topbar .topbar__burger { display: grid; }
  .content--pad { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .tabs-bottom {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 6px 2px; border-radius: var(--r-sm); }
  .tabs-bottom a.is-on { color: var(--brand-700); background: var(--brand-50); }
  .tabs-bottom svg { width: 22px; height: 22px; }
  .composer { padding-bottom: calc(var(--sp-4) + 62px); }
  .has-tabbar .content { padding-bottom: 76px; }
  .consent { margin-bottom: calc(62px + env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .pcard { grid-template-columns: 88px minmax(0, 1fr); gap: var(--sp-3); }
  .pcard__img { width: 88px; height: 88px; font-size: 32px; }
  .pcard__foot { gap: 8px; }
  .pcard__acts { margin-left: 0; width: 100%; }
  .ptiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cat { padding: var(--sp-4); }
  .cat__ico { font-size: 32px; }
  .thread__inner { padding: var(--sp-4) var(--sp-3); }
  .sheet { width: 100%; }
  .topbar { padding: var(--sp-3) var(--sp-4); }
  .hello__title { font-size: 24px; }
  .bubble { padding: 11px 14px; }
  h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ═══════════════ КОМПОНЕНТЫ ВНУТРЕННИХ СТРАНИЦ ═══════════════ */

/* Крошки навигации */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: var(--sp-4); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-600); text-decoration: underline; }
.crumbs .sep { opacity: .55; }
.crumbs b { color: var(--text-2); font-weight: 600; }

/* Страница товара: слева галерея/характеристики/отзывы, справа закреплённый блок покупки */
.prod { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: var(--sp-6); align-items: start; }
.prod__side { position: sticky; top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
.prod__title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 6px; }
.prod__sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }

/* Лайтбокс для фото товара */
.lb { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 82%, black);
  display: grid; place-items: center; padding: var(--sp-6); }
.lb__img { max-width: min(92vw, 900px); max-height: 88vh; border-radius: var(--r-lg); background: #fff; }
.lb__x { position: absolute; top: var(--sp-4); right: var(--sp-5); }
.lb__nav { position: absolute; left: var(--sp-4); display: flex; gap: var(--sp-2); }

/* Отзывы */
.revs { display: flex; flex-direction: column; gap: var(--sp-3); }
.rev { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-4) var(--sp-5); }
.rev__top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 6px; }
.rev__name { font-weight: 700; font-size: 14px; }
.rev__date { font-size: 12px; color: var(--muted); margin-left: auto; }
.rev__stars { color: var(--warn); font-size: 13px; letter-spacing: 2px; }
.rev__text { font-size: 14px; line-height: 1.55; }

/* Выбор варианта (тип покупателя, способ оплаты, ПВЗ) */
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); }
.pick { display: block; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: var(--sp-4); cursor: pointer; transition: border-color var(--speed), box-shadow var(--speed); }
.pick:hover { border-color: var(--brand-300); }
.pick input { accent-color: var(--brand-500); margin-right: 8px; }
.pick b { font-size: 14px; font-weight: 700; display: inline; }
.pick span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pick:has(input:checked) { border-color: var(--brand-500); box-shadow: var(--ring); background: var(--surface-2); }

/* Список пунктов выдачи */
.pvz { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
.pvz label { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pvz label:last-child { border-bottom: 0; }
.pvz label:hover { background: var(--surface-2); }
.pvz input { margin-top: 3px; accent-color: var(--brand-500); }
.pvz b { display: block; font-size: 13.5px; font-weight: 600; }
.pvz em { display: block; font-size: 12px; color: var(--muted); font-style: normal; }

/* Сводка заказа (корзина, оформление) */
.sumbar { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-5); position: sticky; top: var(--sp-4); }
.sumrow { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: 14px; padding: 7px 0; }
.sumrow span { color: var(--text-2); }
.sumrow--total { border-top: 1px solid var(--border); margin-top: var(--sp-2); padding-top: var(--sp-3); font-size: 16px; font-weight: 800; }
.sumrow--total b { font-size: 20px; }

/* Шаги оформления */
.steps { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.step { font-size: 12.5px; color: var(--muted); border: 1px solid var(--border); border-radius: var(--r-full); padding: 4px 12px; display: flex; gap: 7px; align-items: center; }
.step i { font-style: normal; font-weight: 700; }
.step.is-on { color: var(--brand-600); border-color: var(--brand-300); background: var(--brand-50); }
.step.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); }

/* Таймлайн заказа */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__row { display: grid; grid-template-columns: 18px 1fr; gap: var(--sp-3); }
.timeline__dot { width: 10px; height: 10px; border-radius: 50%; margin: 6px auto 0; background: var(--border-2); position: relative; }
.timeline__row:not(:last-child) .timeline__dot::after { content: ""; position: absolute; top: 10px; bottom: calc(var(--sp-3) * -1); left: 4.5px; width: 1px; background: var(--border); }
.timeline__dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.timeline__row b { font-size: 14px; font-weight: 700; }
.timeline__row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.timeline__row { padding-bottom: var(--sp-3); }

/* Загрузка файлов (фото-поиск, импорт, документы) */
.upload { border: 1.5px dashed var(--border-2); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-6); text-align: center; cursor: pointer; transition: border-color var(--speed), background var(--speed); display: block; }
.upload:hover { border-color: var(--brand-400); background: var(--brand-50); }
.upload__ico { font-size: 34px; line-height: 1; }
.upload__t { font-weight: 600; margin-top: var(--sp-2); }
.upload__d { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.upload input { display: none; }

/* Тёмная панель-герой (страницы «стать продавцом», «юрлицам») */
.hero { border-radius: var(--r-xl); padding: var(--sp-6); color: #fff;
  background: linear-gradient(115deg, #0B1722, #14313F 55%, #0B4A5F);
  display: flex; flex-direction: column; gap: var(--sp-3); }
.hero h1, .hero h2 { color: #fff; margin: 0; }
.hero p { color: #C9DEE8; margin: 0; max-width: 640px; }
.hero .btn { align-self: flex-start; }

/* Редактор фото профиля (настройки) */
.avaedit { display: flex; gap: var(--sp-5); flex-wrap: wrap; align-items: flex-start; }
.avaedit-stage {
  width: 180px; height: 180px; border-radius: 50%;
  background: var(--surface-2); border: 2px dashed var(--border-2);
  overflow: hidden; position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.avaedit-stage canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avaedit-stage.is-empty canvas { display: none; }
.avaedit-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 18px; line-height: 1.45; }
.avaedit-ctl { flex: 1 1 260px; min-width: 240px; }
.avaedit-ctl label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.avaedit-ctl input[type=range] { width: 100%; accent-color: var(--brand-500); }
.avaedit-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--sp-4); }
.avaedit-hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.avaedit-mini { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-4); }
.avaedit-mini span { font-size: 11.5px; color: var(--muted); }

/* Таблицы на мобильных */
.tbl-wrap { overflow-x: auto; }

@media (max-width: 900px) {
  .prod { grid-template-columns: 1fr; }
  .prod__side { position: static; }
  .sumbar { position: static; }
  .hero { padding: var(--sp-5); }
}

@media (max-width: 560px) {
  .avaedit-stage { width: 140px; height: 140px; margin: 0 auto; }
  .avaedit { gap: var(--sp-4); }
}


/* Печать (заказы, документы) */
@media print {
  .side, .topbar, .composer, .tabs-bottom, .no-print { display: none !important; }
  .app { display: block; height: auto; }
  .content { overflow: visible; }
}

/* ── Кабинеты продавца и администратора ─────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.kpi:hover { border-color: var(--border-2); }
.kpi__label { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi__value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.kpi__sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: var(--sp-4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--sp-4); }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ── Общие компоненты кабинетов (продавец / админ) ───────────── */

/* Табы-кнопки (переключение панелей без перезагрузки) */
.tabs button, .tabs .tabs__btn {
  padding: 10px 16px; color: var(--text-2); font-weight: 600; font-size: 14.5px;
  border-bottom: 2px solid transparent; white-space: nowrap;
  background: none; border-top: none; border-left: none; border-right: none; cursor: pointer;
  font-family: inherit;
}
.tabs button:hover { color: var(--text); }
.tabs button.is-on { color: var(--brand-700); border-bottom-color: var(--brand-500); }

/* Уведомления */
.note { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-lg);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; margin-bottom: var(--sp-4); }
.note > span { font-size: 17px; line-height: 1.2; }
.note--info { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.note--ok   { background: var(--ok-bg);   color: var(--ok);   border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.note--warn { background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.note--err  { background: var(--err-bg);  color: var(--err);  border: 1px solid color-mix(in srgb, var(--err) 35%, transparent); }
.note--ok b, .note--warn b, .note--err b { color: inherit; }
.note--ok div, .note--warn div, .note--err div { color: color-mix(in srgb, currentColor 85%, var(--text)); }
.note .btn { margin-top: 6px; }

/* Форма загрузки таблицы */
.imp-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .imp-grid { grid-template-columns: 1fr; } }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-4);
  cursor: pointer; text-align: center; transition: border-color var(--speed), background var(--speed); }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--brand-400); background: var(--brand-50); }
.drop-ico { font-size: 30px; line-height: 1; }
.drop-title { font-weight: 700; font-size: 14.5px; }
.drop-hint { font-size: 12.5px; color: var(--muted); }
.imp-stats { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: var(--sp-3); }
.imp-n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.imp-l { font-size: 12px; color: var(--muted); }

/* Сетка формы карточки товара */
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }
.form-grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-3) var(--sp-4); }
@media (max-width: 760px) { .form-grid2, .form-grid3 { grid-template-columns: 1fr; } }

/* Загрузка фотографий товара */
.updrop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: var(--sp-5);
  cursor: pointer; text-align: center; transition: border-color var(--speed), background var(--speed); }
.updrop:hover, .updrop.is-over { border-color: var(--brand-400); background: var(--brand-50); }
.updrop__t { font-weight: 700; font-size: 14px; }
.updrop__h { font-size: 12.5px; color: var(--muted); }
.upgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.upitem { position: relative; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 4; }
.upitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upitem__tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; }
.upitem__btn { width: 26px; height: 26px; border-radius: var(--r-full); border: none; cursor: pointer;
  background: rgba(17, 24, 28, .55); color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.upitem__btn:hover { background: rgba(17, 24, 28, .8); }
.upitem--main { border-color: var(--brand-400); box-shadow: 0 0 0 2px var(--brand-200); }
.upitem__main { position: absolute; left: 6px; bottom: 6px; background: var(--grad-brand); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-full); }
.upitem__star { position: absolute; left: 6px; bottom: 6px; border: none; cursor: pointer;
  background: rgba(17, 24, 28, .55); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 4px 8px; border-radius: var(--r-full); backdrop-filter: blur(4px); }
.upitem__star:hover { background: var(--brand-600); }
.upitem form { display: inline; margin: 0; }

/* Блок причины отклонения */
.reject-box { background: var(--err-bg); border: 1px solid color-mix(in srgb, var(--err) 35%, transparent);
  border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); font-size: 13.5px; line-height: 1.7; }

/* Пилюли-галочки (характеристики карточки товара) */
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 6px 12px; font-size: 13px; cursor: pointer; user-select: none; }
.pill input { accent-color: var(--brand-500); margin: 0; }

/* Сводка сумм (отгрузка, баланс) */
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0;
  font-size: 13.5px; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.sum-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.sum-total { border-bottom: none; padding-top: 10px; font-size: 15px; }
.sum-total b { font-size: 18px; font-weight: 800; }

/* Таймлайн заказа */
.tl { position: relative; padding-left: 18px; }
.tl:before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; background: var(--border-2); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-dot { position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-500); box-shadow: 0 0 0 3px var(--surface); }

/* Отгрузка: сетка и плашки */
.ship-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .ship-grid { grid-template-columns: 1fr; } }
.pvz-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; }
.claim-box { background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: var(--r-lg); padding: 14px 16px; margin-top: 14px; }

/* Блоки кода */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }

.grid-main { display: grid; grid-template-columns: 1.5fr .9fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 900px) { .grid-main { grid-template-columns: 1fr; } }

.upgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: var(--sp-4); }
.upitem { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--bg-sunken); }
.upitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upitem__main { position: absolute; left: 8px; bottom: 8px; background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.upitem__x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.upitem__setmain { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600; padding: 5px 4px; cursor: pointer; }

.claim { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--r-lg); padding: 14px 16px; margin-top: var(--sp-4); }
.reject-note { border: 1px solid color-mix(in srgb, var(--err) 35%, transparent); background: color-mix(in srgb, var(--err) 7%, var(--surface)); border-radius: var(--r-lg); padding: 16px 18px; font-size: 13.5px; line-height: 1.7; }
.reject-note b { display: block; margin-bottom: 6px; }

.tbl-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Юридические страницы и согласия ─────────────────────────────────── */

/* Уведомление о cookie / обучении ИИ (ФЗ-149, ФЗ-152).
   Встроено в конец колонки .main обычным блоком: не перекрывает поле
   ввода чата и кнопки внизу страниц, а занимает место под контентом. */
.consent { flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--border-2); }
.consent__in { max-width: 1180px; margin: 0 auto; padding: 12px var(--sp-4);
  display: flex; gap: var(--sp-4); align-items: center; justify-content: space-between; }
.consent__txt { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.consent__txt a { color: var(--brand-700); text-decoration: underline; }
.consent__acts { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 720px) {
  .consent__in { flex-direction: column; align-items: stretch; text-align: left; }
  .consent__acts { justify-content: flex-end; }
  .consent__txt { font-size: 12.5px; }
}

/* Статус согласия на странице «Тоня — ИИ» и в кабинете */
.consent-state { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.5; }
.consent-state svg { width: 20px; height: 20px; flex-shrink: 0; }
.consent-state--ok { color: var(--ok, #1a7f37); }
.consent-state--off { color: var(--brand-700); }

/* Блок «кто такая Тоня» на странице ИИ */
.aihero { display: flex; gap: var(--sp-4); align-items: flex-start; }
.aihero__ava { width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); }
.aihero__ava svg { width: 30px; height: 30px; }
.aihero__txt p { margin: 6px 0 0; line-height: 1.65; font-size: 14.5px; }
@media (max-width: 560px) { .aihero { flex-direction: column; } }

/* Типографика юридических текстов (privacy/terms/cookies/ai) */
.doc { font-size: 14.5px; line-height: 1.7; }
.doc h2 { font-size: 17px; margin: var(--sp-6) 0 var(--sp-2); scroll-margin-top: 70px; }
.doc h2:first-child { margin-top: 0; }
.doc p { margin: 0 0 var(--sp-3); }
.doc ul { margin: 0 0 var(--sp-3); padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--brand-700); text-decoration: underline; }
.doc__lead { font-size: 15px; color: var(--text); }

/* Ссылки на документы в сайдбаре */
.side__docs { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 var(--sp-3); }
.side__docs a { font-size: 12.5px; color: var(--muted); padding: 5px 12px; border-radius: var(--r-sm); }
.side__docs a:hover { color: var(--text); background: var(--bg-sunken); }

/* Строка кнопок (страница ИИ и др.) */
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

/* Дисклеймер ИИ в приветствии чата */
.hello__ai { display: flex; align-items: flex-start; gap: 10px; margin: var(--sp-3) 0 0;
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 14px; max-width: 560px; text-align: left; }
.hello__ai svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand-700); }
.hello__ai a { color: var(--brand-700); text-decoration: underline; }

/* Уведомление не печатается и не мешает мобильной панели */
@media print { .consent { display: none !important; } }
