/* ───────── HR·Swap ─────────
   Эстетика: «бутик-барахолка». Тёплая бумага, чернильный текст,
   карточки как ценники с дырочкой, редкость кодируется цветом подложки. */

:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d7;
  --card: #fffdf9;
  --ink: #17131f;
  --ink-2: #4a4453;
  --ink-3: #8a8393;
  --line: #ddd4c4;
  --accent: #6b3bff;
  --accent-ink: #ffffff;
  --accent-soft: #e7defe;
  --coral: #ff5a3c;
  --mint: #12b886;
  --gold-1: #ffd66b;
  --gold-2: #e8a317;
  --shadow: 0 1px 0 rgba(23,19,31,.06), 0 10px 30px -12px rgba(23,19,31,.18);
  --shadow-lift: 0 2px 0 rgba(23,19,31,.08), 0 24px 40px -18px rgba(23,19,31,.35);
  --radius: 20px;

  --r-none: #b9b2a7;
  --r-common: #9aa3ad;
  --r-uncommon: #3fbf7f;
  --r-rare: #3b82f6;
  --r-epic: #a855f7;
  --r-legendary: #f59e0b;
  --r-mythical: #ff3d7f;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14111a; --paper-2: #1c1824; --card: #201b29; --ink: #f3eefb; --ink-2: #c3bbd0;
    --ink-3: #8d849b; --line: #332c3f; --accent: #8f6bff; --accent-soft: #2c2248;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.6);
    --shadow-lift: 0 2px 0 rgba(0,0,0,.5), 0 24px 40px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14111a; --paper-2: #1c1824; --card: #201b29; --ink: #f3eefb; --ink-2: #c3bbd0;
  --ink-3: #8d849b; --line: #332c3f; --accent: #8f6bff; --accent-soft: #2c2248;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lift: 0 2px 0 rgba(0,0,0,.5), 0 24px 40px -18px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* без горизонтальной прокрутки. На html — hidden (уходит на весь экран и понятен старому Safari на iPhone),
   на body — только clip: hidden сделал бы body отдельной прокручиваемой областью и сломал бы липкую шапку */
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }
body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 500 15px/1.5 "Manrope", system-ui, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.muted { color: var(--ink-3); }

h1, h2, h3, .logo-text, .price, .display { font-family: "Unbounded", "Manrope", sans-serif; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 5vw, 58px); line-height: 1.02; margin: 0 0 14px; font-weight: 900; }
h1 em { font-style: normal; color: var(--accent); position: relative; white-space: nowrap; }
h1 em::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .22em;
  background: var(--gold-1); z-index: -1; border-radius: 4px; transform: rotate(-1.2deg);
}
h2 { font-size: 26px; margin: 0 0 16px; font-weight: 700; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--ink-3); margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 560px; margin: 0; }

/* ───────── шапка ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 14px max(16px, calc((100vw - 1280px) / 2));
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; transform: rotate(-6deg); box-shadow: 3px 3px 0 var(--ink); }
.logo-mark svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { font-weight: 900; font-size: 20px; }
.logo-text .dot { color: var(--coral); }
.nav { display: flex; gap: 4px; margin-left: 12px; background: var(--paper-2); padding: 4px; border-radius: 999px; }
.nav a { text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--ink); }
.nav a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav-count { background: var(--coral); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }

/* ───────── кнопки ───────── */
.btn {
  border: 0; cursor: pointer; border-radius: 14px; padding: 12px 20px; font-weight: 800; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--coral); border: 1.5px solid color-mix(in srgb, var(--coral) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--coral) 10%, transparent); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-sell { margin-left: auto; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px 60px; flex: 1; }

/* ───────── герой ───────── */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 56px 0 36px; }
.hero-stats { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats div { background: var(--card); border: 1.5px solid var(--ink); border-radius: 16px; padding: 12px 18px; box-shadow: 3px 3px 0 var(--ink); min-width: 130px; }
.hero-stats b { display: block; font: 900 24px/1.1 "Unbounded", sans-serif; }
.hero-stats span { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.hero-stack { position: relative; height: 360px; }
.hero-stack .tag { position: absolute; width: 190px; transition: transform .5s cubic-bezier(.2,.9,.3,1.2); }
.hero-stack .tag:nth-child(1) { left: 4%;  top: 30px;  transform: rotate(-9deg); }
.hero-stack .tag:nth-child(2) { left: 34%; top: 0;     transform: rotate(4deg); z-index: 2; }
.hero-stack .tag:nth-child(3) { left: 62%; top: 60px;  transform: rotate(11deg); }
.hero-stack:hover .tag:nth-child(1) { transform: rotate(-14deg) translate(-12px, 6px); }
.hero-stack:hover .tag:nth-child(3) { transform: rotate(16deg) translate(12px, 6px); }

/* ───────── бегущая строка ───────── */
/* бегущая строка — всегда тёмная полоса, как табло на бирже (не зависит от темы) */
.ticker { overflow: hidden; border-block: 1.5px solid #17131f; background: #17131f; color: #f4efe6; margin: 0 -16px 32px; padding: 10px 0;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; gap: 36px; width: max-content; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick-item { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.tick-item img { width: 30px; height: 30px; object-fit: contain; background: color-mix(in srgb, var(--paper) 14%, transparent); border-radius: 8px; }
.tick-item .price { font-size: 13px; color: var(--gold-1); }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ───────── тулбар / чипсы ───────── */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 14px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 11px; font-weight: 800; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; transition: border-color .15s; }
.search:focus-within { border-color: var(--ink); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2.5; flex: none; }
.search input { border: 0; background: transparent; outline: none; padding: 12px 0; width: 100%; font-weight: 600; }
.search-wide { width: 100%; }
select { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; font-weight: 700; cursor: pointer; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chips-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; margin-bottom: 22px; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips-cats::-webkit-scrollbar { display: none; }
.chips-tight { margin: 10px 0; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px;
  font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 30%, transparent); }
.chip small { opacity: .6; font-weight: 700; }

/* ───────── сетка / карточки-ценники ───────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.grid-catalog { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; }

.tag {
  --rc: var(--r-none);
  position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer; text-align: left; border: 0; padding: 0; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease; overflow: hidden;
  animation: pop .35s ease both;
}
.tag:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--shadow-lift); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tag-img {
  position: relative; aspect-ratio: 1; margin: 8px 8px 0; border-radius: 14px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 38%, transparent), transparent 70%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--rc) 9%, var(--paper)) 0 10px, color-mix(in srgb, var(--rc) 14%, var(--paper)) 10px 20px);
  display: grid; place-items: center; overflow: hidden;
}
.tag-img::before { /* дырочка ценника */
  content: ""; position: absolute; top: 10px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--card); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); z-index: 2;
}
.tag-img img {
  width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.18));
  transition: transform .3s ease;
}
/* полноростовая картинка: растягиваем на всю подложку, нужная точка тела → в центр и приближаем */
.tag-img img.zb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transform: translateY(calc(50% - var(--oy, 50%))) scale(var(--z, 1));
}
.tag:hover .tag-img img { transform: scale(1.06); }
.tag:hover .tag-img img.zb { transform: translateY(calc(50% - var(--oy, 50%))) scale(calc(var(--z, 1) * 1.06)); }
.tag-img .ph { font: 900 34px "Unbounded", sans-serif; color: color-mix(in srgb, var(--rc) 70%, var(--ink)); opacity: .55; }
.tag-type {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; font: 800 10px/1 "Manrope", sans-serif; letter-spacing: .12em;
  text-transform: uppercase; padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--paper);
}
.tag-type.buy { background: var(--mint); color: #fff; }
.tag-type.swap { background: var(--coral); color: #fff; }
.tag-rar {
  position: absolute; right: 10px; top: 10px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; background: var(--rc); color: #fff;
}
.tag-qty { position: absolute; right: 10px; bottom: 10px; z-index: 2; background: var(--card); border-radius: 8px; padding: 3px 7px; font-weight: 800; font-size: 12px; }
/* ряд бейджей сверху: слева статусы, справа редкость — никогда не перекрываются */
.tag-img { container-type: inline-size; }
.tag-badges {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 6px;
}
.tb-left { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tag-badges .tag-rar, .tag-badges .tag-demo, .tag-badges .tag-owned { position: static; flex: none; white-space: nowrap; }
.tag-badges .tag-rar { margin-left: auto; }
/* узкая карточка: «в наличии» сжимается до галочки, редкость — компактнее */
@container (max-width: 200px) {
  .tag-owned .t { display: none; }
  .tag-owned { padding: 4px; }
  .tag-badges .tag-rar { font-size: 9px; padding: 3px 6px; letter-spacing: .04em; }
}
.tag-demo { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink-3); }
.tag-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tag-name { font-weight: 800; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-meta { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.tag-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1.5px dashed var(--line); }
.price { font-weight: 900; font-size: 18px; display: inline-flex; align-items: center; gap: 6px; }
.price-swap { font: 700 13px/1.3 "Manrope", sans-serif; color: var(--coral); max-width: 100%; }
.seller { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
i.gold { display: inline-block; width: 1em; height: 1em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c9, var(--gold-1) 35%, var(--gold-2)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); flex: none; }

/* карточка каталога — компактнее */
.tag.cat .tag-body { padding: 10px 12px 12px; }
.tag.cat .tag-name { font-size: 13px; }
.tag.cat .tag-img::before { display: none; }
.offers { font-size: 12px; font-weight: 800; color: var(--accent); }
.offers.none { color: var(--ink-3); font-weight: 600; }

.skeleton { background: var(--card); border-radius: var(--radius); aspect-ratio: .78; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.more { display: flex; justify-content: center; margin-top: 26px; }
.empty { text-align: center; padding: 60px 16px; }
.empty-art { font-size: 52px; }
.empty h3 { font: 700 20px "Unbounded", sans-serif; margin: 10px 0 6px; }
.empty p { color: var(--ink-3); margin: 0 0 18px; }

.page-head { padding: 48px 0 28px; }

/* ───────── как это работает ───────── */
/* всегда тёмный блок (в обеих темах): раньше в тёмной теме он «переворачивался» в светлый и терял контраст */
.how { --how-ink: #f4efe6; margin-top: 70px; color: var(--how-ink); border-radius: 28px; padding: 36px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 55%), #17131f;
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, #2a2338); }
.how h2 { color: var(--how-ink); }
.how li { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 18px; padding: 16px; }
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how li span { font: 900 14px "Unbounded", sans-serif; color: var(--gold-1); }
.how li b { display: block; font-size: 17px; margin: 6px 0 4px; }
.how li p { margin: 0; font-size: 14px; color: rgba(244,239,230,.7); }
.how-warn { color: #fff; }
.how-warn { margin: 26px 0 0; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--coral) 20%, transparent); font-size: 14px; font-weight: 600; }

/* ───────── мои ───────── */
.mine-list { display: flex; flex-direction: column; gap: 12px; }
.mine-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; background: var(--card); border-radius: 18px; padding: 10px 14px 10px 10px; box-shadow: var(--shadow); }
.mine-row .tag-img { margin: 0; border-radius: 12px; }
.mine-row .tag-img::before { display: none; }
.mine-row h3 { font: 800 16px "Manrope", sans-serif; margin: 0 0 3px; }
.mine-row .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.status.active { background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); }
.status.sold { background: var(--paper-2); color: var(--ink-3); }

/* ───────── модалки ───────── */
.modal {
  border: 0; padding: 0; border-radius: 26px; background: var(--card); color: var(--ink);
  width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 40px 80px -20px rgba(0,0,0,.5);
}
.modal[open] { animation: modalIn .28s cubic-bezier(.2,.9,.3,1.15); }
.modal::backdrop { background: rgba(20,15,30,.55); backdrop-filter: blur(4px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.modal-x { position: absolute; right: 14px; top: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--paper-2); font-size: 24px; line-height: 1; cursor: pointer; }
.modal-x:hover { background: var(--line); }

.detail { display: grid; grid-template-columns: 1fr 1fr; }
.detail .tag-img { margin: 14px; border-radius: 20px; aspect-ratio: 1; }
.detail .tag-img::before { top: 18px; width: 16px; height: 16px; margin-left: -8px; }
.detail .tag-img img { width: 78%; height: 78%; }
.detail-info { padding: 34px 30px 28px 16px; display: flex; flex-direction: column; gap: 14px; }
.detail-info h2 { font-size: 26px; margin: 0; padding-right: 36px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; }
.big-price { font: 900 34px "Unbounded", sans-serif; display: flex; align-items: center; gap: 10px; }
.wants-box { background: color-mix(in srgb, var(--coral) 12%, transparent); border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.wants-box small { display: block; color: var(--coral); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.seller-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; }
.avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 900 17px "Unbounded", sans-serif; color: #fff; flex: none; }
.seller-card .who { flex: 1; min-width: 0; }
.seller-card b { display: block; overflow: hidden; text-overflow: ellipsis; }
.seller-card span { font-size: 12px; color: var(--ink-3); }
.note { font-size: 14px; color: var(--ink-2); background: var(--paper-2); border-radius: 12px; padding: 10px 12px; margin: 0; }
.others h4 { margin: 4px 0 8px; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.others-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; cursor: pointer; }
.others-row:hover { color: var(--accent); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.detail-actions .btn { flex: 1; }

/* выставить */
.modal-sell { padding: 26px 28px 24px; }
.sell-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; padding-right: 40px; flex-wrap: wrap; }
.sell-head h2 { margin: 0; font-size: 22px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; font-size: 13px; font-weight: 800; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-size: 11px; }
.steps li + li::after { content: none; }
.steps li.on { color: var(--ink); }
.steps li.on::before { background: var(--accent); color: #fff; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 4px 2px; }
.pick { min-width: 0; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 6px; cursor: pointer; text-align: left; --rc: var(--r-none); transition: border-color .12s, transform .12s; }
.pick:hover { border-color: var(--rc); transform: translateY(-2px); }
.pick .tag-img { margin: 0; border-radius: 10px; }
.pick .tag-img::before { display: none; }
.pick .tag-img .ph { font-size: 22px; }
.pick b { display: block; font-size: 12px; line-height: 1.25; margin: 6px 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick small { display: block; font-size: 11px; color: var(--ink-3); margin: 0 2px; }
.pick-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; flex-wrap: wrap; }

.modal { overflow-x: hidden; }
.sell-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; }
.sell-layout > *, .field, .row > * { min-width: 0; }
.field input, .gold-input input, .at-input input { min-width: 0; }
.sell-preview .tag { cursor: default; animation: none; }
.sell-preview .tag:hover { transform: none; }
.sell-fields { display: flex; flex-direction: column; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row .field-qty { max-width: 120px; }
.row:has(.field-qty) { grid-template-columns: 1fr 120px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 800; }
.field em { font-style: normal; color: var(--ink-3); font-weight: 600; }
.field input, .field textarea, .gold-input, .at-input {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: none; width: 100%; font-weight: 600;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .gold-input:focus-within, .at-input:focus-within { border-color: var(--ink); }
.gold-input, .at-input { display: flex; align-items: center; gap: 8px; padding-block: 0; }
.gold-input input, .at-input input { border: 0; padding: 11px 0; background: transparent; }
.at-input i { font-style: normal; color: var(--ink-3); font-weight: 800; }
.field.invalid input, .field.invalid .gold-input, .field.invalid .at-input { border-color: var(--coral); }
.form-error { margin: 0; color: var(--coral); font-weight: 700; font-size: 14px; }
.sell-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* тост */
/* ───────── уведомления: стопка карточек ───────── */
.toasts { position: fixed; top: 84px; right: max(16px, calc((100vw - 1280px) / 2)); z-index: 150; width: min(380px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
/* внутри открытого окна у dialog есть анимация transform — пока она идёт, fixed считался бы от окна; держим слой отдельно */
dialog .toasts { position: fixed; }
.toast-card {
  --tc: var(--accent);
  pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 16px; padding: 12px 10px 14px 12px;
  box-shadow: 4px 4px 0 var(--ink), var(--shadow-lift);
  animation: toastIn .38s cubic-bezier(.2,.9,.3,1.25) both;
}
.toast-card.t-click { cursor: pointer; }
.toast-card.t-click:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink), var(--shadow-lift); }
.toast-card.out { animation: toastOut .26s ease forwards; }
.t-success { --tc: var(--mint); }
.t-error { --tc: var(--coral); }
.t-warn { --tc: var(--gold-2); }
.t-message, .t-offer { --tc: var(--accent); }
.t-deal { --tc: var(--sync); }
.t-watch { --tc: var(--r-mythical); }
.t-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--tc); color: #fff; font: 900 16px/1 "Unbounded", sans-serif; }
.t-ico .avatar { width: 34px; height: 34px; border-radius: 11px; }
.t-message .t-ico { background: none; }
.t-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 1px; }
.t-body b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-body > span { font-size: 14px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.t-body b + span { font-size: 13px; }
.t-body small { font-size: 11px; font-weight: 800; color: var(--tc); margin-top: 2px; }
.t-x { border: 0; background: none; color: var(--ink-3); font-size: 20px; line-height: 1; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; margin: -2px -2px 0 0; }
.t-x:hover { background: var(--paper-2); color: var(--ink); }
.t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc); transform-origin: left;
  animation: toastBar var(--dur, 4s) linear forwards; }
.toast-card:hover .t-bar { animation-play-state: paused; }  /* навёл — уведомление не уходит */
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 640px) {
  .toasts { top: 10px; right: 12px; left: 12px; width: auto; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.96); } }
  @keyframes toastOut { to { opacity: 0; transform: translateY(-24px) scale(.96); } }
}
@media (prefers-reduced-motion: reduce) { .toast-card, .toast-card.out { animation-duration: .01s; } }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px max(16px, calc((100vw - 1280px) / 2)); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ───────── аккаунты ───────── */
:root { --sync: #2f7cf6; --trust: #e8a317; }
.small { font-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-sell { margin-left: 0; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 9px; box-shadow: none; }
.btn-xs.btn-primary { box-shadow: 2px 2px 0 var(--ink); }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; color: var(--ink-3); font-weight: 700; cursor: pointer; padding: 6px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.me-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 800; font-size: 14px; }
.me-chip:hover { border-color: var(--ink); }
.me-nick { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar-img { background: linear-gradient(160deg, var(--accent-soft), var(--paper-2)); overflow: hidden; }
/* аватар Highrise — фигура в полный рост (300×382), голова примерно на 40% высоты: приближаем лицо */
.avatar-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.9); transform-origin: 55% 47%; }
.avatar-xs { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; display: inline-grid; vertical-align: -5px; }
.avatar-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; }
.avatar-lg { width: 88px; height: 88px; border-radius: 26px; font-size: 36px; box-shadow: 4px 4px 0 var(--ink); }

/* бейджи: ✓ синхронизирован, щит — проверенный продавец */
.bdg { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; vertical-align: -3px; margin-left: 4px; flex: none; }
.bdg svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bdg-sync { background: var(--sync); }
.bdg-trust { background: none; width: 20px; height: 20px; }
.bdg-trust svg { width: 20px; height: 20px; fill: var(--trust); stroke: none; }
.bdg-trust svg .tick { fill: none; stroke: #fff; stroke-width: 1.8; }
.bdg.xs { width: 15px; height: 15px; margin-left: 3px; }
.bdg.xs svg { width: 10px; height: 10px; }
.bdg-trust.xs, .bdg-trust.xs svg { width: 16px; height: 16px; }
.bdg.lg { width: 26px; height: 26px; margin-left: 6px; vertical-align: 2px; }
.bdg.lg svg { width: 16px; height: 16px; }
.bdg-trust.lg, .bdg-trust.lg svg { width: 28px; height: 28px; }
.seller { display: inline-flex; align-items: center; }
.tag-owned {
  position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 3px;
  background: var(--sync); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 7px 3px 5px; border-radius: 999px;
}
.tag-owned svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pick .tag-owned { left: 5px; top: 5px; padding: 3px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pill-sync { background: color-mix(in srgb, var(--sync) 15%, transparent); color: var(--sync); }
.pill-trust { background: color-mix(in srgb, var(--trust) 20%, transparent); color: color-mix(in srgb, var(--trust) 70%, var(--ink)); }
.pill-admin { background: var(--accent-soft); color: var(--accent); }
.pill-ban { background: color-mix(in srgb, var(--coral) 18%, transparent); color: var(--coral); }
.stars { color: var(--trust); font-weight: 800; white-space: nowrap; }
.warn-line { background: color-mix(in srgb, var(--trust) 14%, transparent); border-radius: 12px; padding: 10px 14px; font-weight: 600; margin: 0 0 16px; }
.warn-line.small { margin: 0; padding: 8px 12px; }
.ok-line { color: var(--sync); font-weight: 700; margin: 0; display: flex; gap: 6px; align-items: center; }
.ok-line svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; flex: none; }
.price-fiat { font-family: "Unbounded", sans-serif; }
.card p.trust-ok { background: color-mix(in srgb, var(--trust) 14%, transparent); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.cur-sym { font-style: normal; font-weight: 900; color: var(--ink-2); }
.cur-sel { border: 0; background: var(--paper-2); border-radius: 8px; padding: 2px 6px; font-size: 12px; margin-left: 6px; }
.as-who { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.trust-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip-trust.on { background: color-mix(in srgb, var(--trust) 22%, var(--card)); border-color: var(--trust); color: var(--ink); }
.chip-sync.on { background: color-mix(in srgb, var(--sync) 16%, var(--card)); border-color: var(--sync); color: var(--ink); }

/* вход */
.modal-auth { width: min(760px, calc(100vw - 24px)); display: none; grid-template-columns: 260px 1fr; }
.modal-auth[open] { display: grid; }
.auth-side { background: var(--accent); color: #fff; padding: 36px 28px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: -40% -40% auto auto; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.12); }
.auth-side p { margin: 0; font: 700 18px/1.35 "Unbounded", sans-serif; }
.auth-badge { width: 64px; height: 64px; border-radius: 20px; background: #fff; color: var(--sync); display: grid; place-items: center; font: 900 34px "Unbounded"; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-6deg); }
.auth-main { padding: 32px 30px 26px; display: flex; flex-direction: column; gap: 16px; }
.auth-main h2 { margin: 0; }
#authForm, #resetForm { display: flex; flex-direction: column; gap: 14px; }
.field small { font-size: 12px; }
.code-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--paper-2); border: 1.5px dashed var(--ink-3); border-radius: 12px; padding: 10px 12px; }
.code-box b { font: 800 17px "Unbounded", monospace; letter-spacing: .02em; user-select: all; }
.code-box span { font-size: 13px; color: var(--ink-3); width: 100%; }

/* гость */
.guest { text-align: center; padding: 70px 16px; max-width: 560px; margin: 0 auto; }
.guest .lead { margin: 0 auto 24px; }
.guest-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* кабинет */
.acc-head { display: flex; align-items: center; gap: 22px; padding: 40px 0 24px; flex-wrap: wrap; }
.acc-id { flex: 1; min-width: 220px; }
.acc-id h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 8px; overflow-wrap: anywhere; }
.acc-sub { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.acc-stats { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 700; color: var(--ink-2); font-size: 14px; }
.acc-tabs { margin-bottom: 22px; flex-wrap: wrap; }
.acc-tabs .nav-count { margin-left: 4px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font: 700 18px "Unbounded", sans-serif; }
.panel-head small { font: 600 13px "Manrope", sans-serif; }

.sync-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); border: 1.5px solid color-mix(in srgb, var(--sync) 30%, transparent); }
.sync-off { border-color: var(--line); }
.sync-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--sync); display: grid; place-items: center; color: #fff; font: 900 24px "Unbounded"; }
.sync-off .sync-ico { background: var(--paper-2); color: var(--ink-3); }
.sync-ico svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sync-text p { margin: 4px 0; color: var(--ink-2); font-size: 14px; }
.sync-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--sync); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.w-card { cursor: default; }
.w-card:hover { transform: none; }
.w-bound { opacity: .7; }
.w-card .tag-foot { align-items: center; }

.deal-row.attn { outline: 2px solid var(--accent); }

/* переписка */
.conv-row { width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit; grid-template-columns: 76px 1fr; }
.conv-row.attn { outline: 2px solid var(--accent); }
.conv-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-right: 40px; margin-bottom: 12px; }
.chat-head a { color: var(--ink); }
.chat-list { display: flex; flex-direction: column; gap: 8px; height: min(46vh, 380px); overflow-y: auto; background: var(--paper-2); border-radius: 14px; padding: 12px; }
.msg { max-width: 80%; align-self: flex-start; background: var(--card); border-radius: 14px 14px 14px 4px; padding: 8px 12px; box-shadow: var(--shadow); }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-radius: 14px 14px 4px 14px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 11px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin: 10px 0 6px; }
.chat-form textarea { flex: 1; resize: none; background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font: inherit; color: inherit; outline: none; }
.chat-form textarea:focus { border-color: var(--ink); }

/* жалобы */
.report-row { grid-template-columns: 1fr auto; }
.report-row a { color: var(--ink); font-weight: 800; }
.report-row .note { margin: 6px 0; }
.stack select, .stack textarea { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; color: inherit; width: 100%; }
.deal-row a { color: var(--ink); font-weight: 800; }
.status { display: inline-flex; align-items: center; gap: 3px; }
.status svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 3; }
.st-awaiting_confirm { background: var(--accent-soft); color: var(--accent); }
.st-completed { background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--mint); }
.st-cancelled { background: var(--paper-2); color: var(--ink-3); }
.mine-row .tag-img[data-listing-open] { cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card h3 { margin: 0; font: 700 17px "Unbounded", sans-serif; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card .field { width: 100%; }
.h-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--sync); padding: 4px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.h-trust { background: none; padding: 0; width: 24px; height: 24px; fill: var(--trust); stroke: none; }
.h-trust .tick { fill: none; stroke: #fff; stroke-width: 1.8; }
.verify-steps { margin: 0; padding: 0; list-style: none; counter-reset: v; display: flex; flex-direction: column; gap: 14px; width: 100%; }
.verify-steps li { counter-increment: v; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-left: 34px; position: relative; }
.verify-steps li::before { content: counter(v); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 800 12px/24px "Manrope"; text-align: center; }
.verify-steps li > span { font-weight: 700; font-size: 14px; }
.inline-form { display: flex; gap: 8px; width: 100%; }
.inline-form .at-input { flex: 1; background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; }
.inline-form input { border: 0; background: transparent; outline: none; padding: 9px 0; width: 100%; min-width: 0; font-weight: 700; }
.progress { width: 100%; height: 10px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-1), var(--trust)); border-radius: 5px; transition: width .4s; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.checklist li.ok { color: var(--mint); }
.stack { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.stack input, .card > .field input { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; font-weight: 600; width: 100%; }
.stack input:focus { border-color: var(--ink); }

.user-results { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 300px; overflow: auto; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.user-row:hover { border-color: var(--accent); }
.user-row .muted { margin-left: auto; }
.modal-small { width: min(520px, calc(100vw - 24px)); padding: 26px 24px 22px; }
.modal-small h2 { margin: 0 0 10px; padding-right: 40px; font-size: 22px; }
.search .at { font-weight: 800; color: var(--ink-3); }

.review-form { display: flex; flex-direction: column; gap: 14px; }
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-pick input { position: absolute; opacity: 0; }
.star-pick label { font-size: 38px; line-height: 1; color: var(--line); cursor: pointer; transition: transform .1s; }
.star-pick label:hover, .star-pick label:hover ~ label, .star-pick input:checked ~ label { color: var(--trust); }
.star-pick input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }

.reviews { display: flex; flex-direction: column; gap: 12px; }
.review { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-head a { font-weight: 800; color: var(--ink); }
.review p { margin: 8px 0 4px; }
.admin-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border-radius: 14px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.who-nick { font-weight: 800; color: var(--ink); text-decoration: none; }
a.who-nick:hover { color: var(--accent); }
.seller-card .who { display: flex; flex-direction: column; }
.who-line { display: flex; align-items: center; min-width: 0; }
.who-line .who-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.big-price .price { font-size: inherit; gap: 10px; }

/* ───────── анимированный игрок на главной ───────── */
.hero { position: relative; }
.hero-player { position: absolute; right: 0; bottom: 6px; width: 150px; z-index: 5; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.hp-btn { pointer-events: auto; border: 0; background: none; padding: 0; cursor: pointer; width: 100%; -webkit-tap-highlight-color: transparent; }
.hp-btn svg { display: block; width: 100%; overflow: visible; }
.hp-bubble {
  position: relative; margin-bottom: 4px; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800; font-size: 13px; padding: 7px 12px; border-radius: 14px; white-space: nowrap; transition: opacity .25s, transform .25s;
}
.hp-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: var(--card); border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: translateX(-50%) rotate(45deg); }
.hp-bubble.swap { opacity: 0; transform: translateY(4px) scale(.96); }
.hp-skin { fill: #f5c7a3; }
.hp-hair { fill: #2a1f35; }
.hp-streak { fill: var(--accent); }
.hp-hoodie { fill: var(--accent); }
.hp-pocket { fill: color-mix(in srgb, var(--accent) 70%, #000); }
.hp-string { stroke: #fff; stroke-width: 3; stroke-linecap: round; fill: none; opacity: .8; }
.hp-pants { fill: #2b2d42; }
.hp-shoe { fill: var(--coral); }
.hp-eye { fill: #fff; }
.hp-pupils { transition: transform .12s ease-out; }
.hp-pupils circle { fill: #1b1426; }
.hp-pupils .hp-glint { fill: #fff; }
.hp-blush { fill: #ff8fa3; opacity: .55; }
.hp-mouth { fill: none; stroke: #7a2e3b; stroke-width: 3; stroke-linecap: round; }
.hp-coin circle { fill: var(--gold-1); stroke: var(--gold-2); stroke-width: 2.5; }
.hp-coin text { font: 900 12px "Unbounded", sans-serif; fill: var(--gold-2); }
.hp-shadow { fill: color-mix(in srgb, var(--ink) 18%, transparent); transform-origin: 80px 220px; animation: hp-shadow 2.4s ease-in-out infinite; }

.hp-body { animation: hp-bob 2.4s ease-in-out infinite; }
.hp-head { transform-origin: 80px 100px; animation: hp-tilt 4.8s ease-in-out infinite; }
.hp-arm-r { transform-origin: 117px 118px; animation: hp-wave 2.4s ease-in-out infinite; }
.hp-arm-l { transform-origin: 43px 116px; animation: hp-sway 2.4s ease-in-out infinite; }
.hp-coin { transform-box: fill-box; transform-origin: center; animation: hp-flip 1.6s linear infinite; }
.hp-eyes { transform-origin: 80px 70px; animation: hp-blink 4.2s infinite; }
@keyframes hp-bob { 50% { transform: translateY(-5px); } }
@keyframes hp-shadow { 50% { transform: scaleX(.86); opacity: .7; } }
@keyframes hp-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }
@keyframes hp-wave { 0%, 100% { transform: rotate(-8deg); } 25% { transform: rotate(-38deg); } 50% { transform: rotate(-12deg); } 75% { transform: rotate(-36deg); } }
@keyframes hp-sway { 50% { transform: rotate(6deg); } }
@keyframes hp-flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(.1); } 100% { transform: scaleX(1); } }
@keyframes hp-blink { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.08); } }
/* по клику — прыжок с переворотом */
.hero-player.jump .hp-btn { animation: hp-jump .7s cubic-bezier(.3,.7,.4,1); }
@keyframes hp-jump { 0% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(4px) scale(1.08, .9); } 50% { transform: translateY(-46px) rotate(-8deg); } 80% { transform: translateY(0) scale(1.05, .95); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hp-body, .hp-head, .hp-arm-r, .hp-arm-l, .hp-coin, .hp-eyes, .hp-shadow { animation: none; }
  .hero-player.jump .hp-btn { animation: none; }
}
.hp-note { margin: 16px 0 0; max-width: 520px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.hp-note a { color: var(--accent); font-weight: 800; text-decoration: none; white-space: nowrap; }
.hp-note a:hover { text-decoration: underline; }
/* настоящий аватар игрока из Highrise (PNG в полный рост): когда загрузился, заменяет нарисованного */
.hp-real { display: none; position: relative; width: 100%; aspect-ratio: 253 / 394; }
.has-avatar .hp-real { display: block; }
.has-avatar .hp-fallback { display: none; }
.hp-real::after { /* тень под ногами */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 10px; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 22%, transparent); z-index: -1; animation: hp-shadow 2.4s ease-in-out infinite;
}
.hp-avatar { width: 100%; height: 100%; object-fit: contain; object-position: bottom; transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.25)); animation: hp-idle 2.4s ease-in-out infinite; }
/* «дыхание» и покачивание: сжимается у земли, как персонаж в игре */
@keyframes hp-idle {
  0%, 100% { transform: translateY(0) scale(1, 1) rotate(0); }
  25% { transform: translateY(-3px) scale(.99, 1.015) rotate(-1.5deg); }
  50% { transform: translateY(-6px) scale(1, 1.02) rotate(0); }
  75% { transform: translateY(-3px) scale(.99, 1.015) rotate(1.5deg); }
}
.hp-real.swap .hp-avatar { animation: hp-swap .5s ease; }
@keyframes hp-swap { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
.hp-name { pointer-events: auto; margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); background: var(--card); border: 1.5px solid var(--line);
  padding: 3px 10px; border-radius: 999px; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.hp-name:hover { border-color: var(--ink); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .hp-avatar, .hp-real::after { animation: none; } }
/* игрок стоит в своей колонке справа от карточек и не наезжает на них */
@media (min-width: 1101px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) 170px; gap: 28px; }
  .hero-player { position: static; width: 170px; align-self: end; margin-bottom: 20px; }
  .hp-bubble { white-space: normal; text-align: center; max-width: 170px; }
}
/* средние экраны: игрок отдельной строкой под героем */
@media (min-width: 641px) and (max-width: 1100px) {
  .hero-player { position: static; grid-column: 1 / -1; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; width: auto; }
  .hp-btn { width: 110px; }
  .hp-bubble::after { left: auto; right: -7px; bottom: 50%; transform: translateY(50%) rotate(-45deg); }
  .hp-name { align-self: flex-end; }
}
@media (max-width: 640px) {
  .hero-player { position: static; flex-direction: row-reverse; justify-content: flex-end; gap: 8px; width: auto; margin-top: 14px; }
  .hp-btn { width: 86px; }
  .hp-name { display: none; }
  .hp-bubble::after { left: auto; right: -7px; bottom: 50%; transform: translateY(50%) rotate(-45deg); }
  .hp-bubble { white-space: normal; max-width: 200px; }
}

/* ───────── визуальные фишки ───────── */
::selection { background: var(--accent); color: #fff; }
html { scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
/* плавная смена темы только в момент переключения, чтобы не тормозить остальное */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color .35s, color .35s, border-color .35s !important; }

/* кнопка темы: луна ↔ солнце */
.theme-btn { cursor: pointer; overflow: hidden; }
.theme-btn svg { position: absolute; transition: transform .45s cubic-bezier(.2,.9,.3,1.3), opacity .3s; }
.theme-btn .i-sun { transform: translateY(26px) rotate(-90deg); opacity: 0; }
.theme-btn.is-dark .i-moon { transform: translateY(-26px) rotate(90deg); opacity: 0; }
.theme-btn.is-dark .i-sun { transform: none; opacity: 1; }
.theme-btn .i-moon { fill: currentColor; stroke: none; }

/* «живой рынок»: пульсирует, пока открыт поток событий */
.live-badge { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; padding: 3px 9px 3px 7px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-3); letter-spacing: .1em; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); position: relative; }
.is-live .live-badge { color: var(--mint); background: color-mix(in srgb, var(--mint) 14%, transparent); }
.is-live .live-badge i { background: var(--mint); }
.is-live .live-badge i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint); animation: ping 1.8s ease-out infinite; }
@keyframes ping { to { transform: scale(3); opacity: 0; } }

/* наклон карточки за курсором */
.grid .tag.tilt { transform: perspective(800px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-4px); transition: transform .08s linear, box-shadow .2s; }

/* голографический блик у легендарных и мифических предметов */
.tag.holo::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; opacity: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.35), transparent 45%),
    linear-gradient(115deg, transparent 20%, color-mix(in srgb, var(--rc) 45%, transparent) 40%, rgba(255,255,255,.25) 50%, color-mix(in srgb, var(--r-rare) 35%, transparent) 60%, transparent 80%);
  background-size: 100% 100%, 250% 250%; background-position: 0 0, var(--mx, 0%) var(--my, 0%);
  mix-blend-mode: overlay; transition: opacity .3s;
}
.tag.holo:hover::after { opacity: 1; }
.tag.holo { box-shadow: var(--shadow), 0 0 0 1.5px color-mix(in srgb, var(--rc) 45%, transparent); }
.tag.holo-mythical { animation: pop .35s ease both, aura 3.2s ease-in-out infinite; }
@keyframes aura {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 1.5px color-mix(in srgb, var(--rc) 50%, transparent), 0 0 18px -6px var(--rc); }
  50% { box-shadow: var(--shadow), 0 0 0 1.5px color-mix(in srgb, var(--rc) 80%, transparent), 0 0 28px -4px var(--rc); }
}
.tag.holo .tag-rar { background: linear-gradient(100deg, var(--rc), color-mix(in srgb, var(--rc) 55%, #fff), var(--rc)); background-size: 200% 100%; animation: shine 2.6s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }

/* конфетти */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.confetti i { position: absolute; width: 8px; height: 13px; border-radius: 2px; animation: burst 1.3s cubic-bezier(.15,.7,.4,1) forwards; }
@keyframes burst {
  0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(var(--dx) - 50%), calc(var(--dy) + 320px)) rotate(var(--rot)); opacity: 0; }
}

/* плашка «нет связи» */
.net-banner { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px;
  background: var(--coral); color: #fff; font-weight: 700; font-size: 14px; padding: 9px 12px 9px 14px; border-radius: 14px; box-shadow: var(--shadow-lift);
  animation: drop .35s cubic-bezier(.2,.9,.3,1.3); max-width: calc(100vw - 24px); }
.net-banner .linkish { color: #fff; padding: 2px 4px; }
.net-spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .tag.holo-mythical, .tag.holo .tag-rar, .is-live .live-badge i::after, .net-spin { animation: none; }
}

/* ───────── шапка: кнопка сообщений ───────── */
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; flex: none; }
.icon-btn:hover, .icon-btn.on { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.icon-btn .nav-count { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--paper); }

/* ───────── сообщения: список + чат ───────── */
.inbox {
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  height: clamp(520px, calc(100dvh - 190px), 820px);
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
}
.inbox-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--paper-2) 45%, var(--card)); }
.inbox-search { margin: 12px; flex: none; min-width: 0; }
.inbox-search input { padding: 9px 0; }
.conv-list { overflow-y: auto; flex: 1; min-height: 0; }
.conv {
  --rc: var(--r-none);
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; text-decoration: none; color: inherit; border-left: 3px solid transparent;
}
.conv:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.conv.on { background: var(--accent-soft); border-left-color: var(--accent); }
.conv-img { position: relative; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 38%, transparent), transparent 70%), color-mix(in srgb, var(--rc) 12%, var(--paper)); }
.conv-img > img { width: 88%; height: 88%; object-fit: contain; }
.conv-img .ph { font: 900 14px "Unbounded", sans-serif; opacity: .5; }
.conv-av { position: absolute; right: -4px; bottom: -4px; box-shadow: 0 0 0 2px var(--card); }
.conv-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.conv-top { display: flex; align-items: center; min-width: 0; font-size: 14px; }
.conv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-top time { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.conv-item, .conv-last { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item { font-weight: 700; color: var(--ink-2); }
.conv.unread .conv-last { color: var(--ink); font-weight: 700; }
.conv-flag { font-size: 10px; font-weight: 800; color: var(--coral); margin-left: 6px; }
.conv-empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.conv-empty .empty-art { font-size: 40px; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { margin: auto; text-align: center; padding: 30px; max-width: 360px; }
.chat-empty h3 { font: 700 18px "Unbounded", sans-serif; margin: 8px 0; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.chat-back { display: none; text-decoration: none; font-size: 22px; font-weight: 800; padding: 0 6px; color: var(--ink); }
.chat-who { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; line-height: 1.2; }
.chat-who a { color: var(--ink); text-decoration: none; }
.chat-who a:hover { color: var(--accent); }
.chat-who small { flex-basis: 100%; font-size: 12px; }
.chat-menu { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 210px; padding: 6px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column;
}
.more-menu .menu a, .more-menu .menu button { text-align: left; padding: 9px 10px; border-radius: 9px; border: 0; background: none; font-weight: 700; font-size: 13px; text-decoration: none; color: var(--ink); cursor: pointer; }
.more-menu .menu a:hover, .more-menu .menu button:hover { background: var(--paper-2); }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper-2) 40%, var(--card)); flex: none; }
.chat-item .tag-img { width: 42px; height: 42px; margin: 0; border-radius: 10px; flex: none; }
.chat-item .tag-img::before { display: none; }
.chat-item-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chat-item-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inbox .chat-list { flex: 1; height: auto; min-height: 0; border-radius: 0; padding: 14px 16px; background: var(--paper); gap: 6px; }
.day-sep { text-align: center; margin: 10px 0 4px; }
.day-sep span { font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--paper-2); padding: 3px 10px; border-radius: 999px; }
.msg small { display: flex; justify-content: flex-end; gap: 4px; align-items: center; }
.msg:not(.mine) small { justify-content: flex-start; }
.tick { font-weight: 800; letter-spacing: -2px; }
.tick.read { color: var(--sync); }
.chat-hello { margin: auto; text-align: center; max-width: 420px; padding: 20px 10px; }
.chat-hello p { margin: 6px 0 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chat-foot { padding: 10px 16px 12px; border-top: 1px solid var(--line); flex: none; }
.inbox .chat-form { margin: 0; }
.inbox .chat-form textarea { max-height: 140px; line-height: 1.4; }
.chat-form .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-safe { margin: 6px 0 0; font-size: 12px; }
.chat-blocked { margin: 0; text-align: center; font-weight: 700; color: var(--ink-2); font-size: 14px; }

/* ник в Highrise, отправленный в чате */
.msg-nick { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card)); border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.msg.mine.msg-nick { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--card))); }
.nick-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 2px 0; }
.nick-card small { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.nick-card b { font: 800 19px "Unbounded", sans-serif; word-break: break-all; }
.nick-meta { font-size: 12px; }
.nick-meta .ok-line { font-size: 12px; }
.share-nick { flex: none; white-space: nowrap; }
.mod-ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); border-radius: 10px; flex: none; }
.conv-img .mod-ico { width: 100%; height: 100%; border-radius: 12px; }
.xs-pill { font-size: 10px; padding: 2px 7px; margin-left: 6px; }
.rep-contact { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* «печатает…» — три прыгающие точки */
.typing { color: var(--mint); font-weight: 800; font-size: 12px; flex-basis: 100%; }
.conv-last.typing { color: var(--mint); font-weight: 800; }
.typing i { font-style: normal; display: inline-block; animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }

/* ID чата и просмотр переписок модератором */
.menu-id { border-top: 1px solid var(--line) !important; margin-top: 4px; color: var(--ink-3) !important; font-size: 12px !important; }
.chat-id { font-family: ui-monospace, "Consolas", monospace; font-weight: 700; letter-spacing: .03em; }
button.chat-id { padding: 0; font-size: 12px; }
.msg-author { display: block; margin: 0 0 2px !important; font-weight: 800; color: var(--accent) !important; }
.admin-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-foot .muted { margin-right: auto; }
#adminChats .chat-who a { color: var(--ink); text-decoration: none; }

/* логин продавца в карточке: обрезается только текст, значки ✓ и щит всегда видны целиком */
.tag-foot .seller { display: inline-flex; align-items: center; min-width: 0; max-width: 58%; overflow: visible; }
.seller-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.seller .bdg { flex: none; }
.min-note { color: var(--ink-3); margin-top: -6px; }

/* «дырочка ценника» уместна на маленьких карточках-бирках; на большой картинке в окне она выглядит как дефект */
.detail .tag-img::before, .sell-preview .tag-img::before { display: none; }

/* страница 404 */
.nf { text-align: center; padding: 70px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.nf-tag { position: relative; width: 190px; padding: 26px 20px 20px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink); transform: rotate(-6deg); animation: nf-swing 3.2s ease-in-out infinite; transform-origin: 50% -30px; }
.nf-tag::before { content: ""; position: absolute; top: 10px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.nf-tag::after { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 34px; background: var(--ink-3); margin-bottom: -16px; }
.nf-tag b { display: block; font: 900 64px/1 "Unbounded", sans-serif; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), var(--r-mythical)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-tag span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.nf h1 { font-size: clamp(26px, 4vw, 40px); margin: 22px 0 0; }
.nf p { color: var(--ink-2); max-width: 460px; margin: 0; }
.nf .btn-row { justify-content: center; margin-top: 8px; }
@keyframes nf-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .nf-tag { animation: none; } }

/* ───────── SEO-страницы предметов (/item/<id>) ───────── */
.seo-page { padding-top: 28px; }
.crumbs { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.seo-item { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
.seo-img { margin: 0; border-radius: 22px; }
.seo-img::before { display: none; }
.seo-img .tag-rar { right: 14px; top: 14px; }
.seo-info { display: flex; flex-direction: column; gap: 16px; }
.seo-info h1 { font-size: clamp(28px, 4vw, 46px); margin: 0; }
.seo-info h2, .seo-block h2 { font-size: 18px; margin: 0; }
.seo-block { margin-top: 36px; }
.seo-block h2 { font-size: 22px; margin-bottom: 14px; }
.seo-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; }
.seo-offer { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); }
.seo-offer:hover { box-shadow: var(--shadow-lift); }
.seo-offer { flex-wrap: wrap; }
.seo-offer b { flex: 1 1 55%; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.seo-offer .status { margin: 0; }
.seo-offer .muted { margin-left: auto; font-size: 13px; }
.seo-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.seo-rels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 45%), 1fr)); gap: 8px; }
.seo-rel { --rc: var(--r-none); display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 6px 10px 6px 6px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 700; min-width: 0; }
.seo-rel span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-rel .wimg { width: 38px; height: 38px; }
@media (max-width: 760px) { .seo-item { grid-template-columns: minmax(0, 1fr); } .seo-img { max-width: 360px; } }

/* обмен: выбор предметов «что хочешь взамен» */
.wants-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { --rc: var(--r-none); display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 3px; border-radius: 12px;
  background: var(--card); border: 1.5px solid color-mix(in srgb, var(--rc) 55%, var(--line)); animation: pop .25s ease both; }
.wchip b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 150px; }
.wchip button { border: 0; background: var(--paper-2); color: var(--ink-2); width: 22px; height: 22px; border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; flex: none; }
.wchip button:hover { background: color-mix(in srgb, var(--coral) 20%, transparent); color: var(--coral); }
.wimg { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; flex: none;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 40%, transparent), transparent 70%), color-mix(in srgb, var(--rc) 14%, var(--paper)); }
.wimg img { width: 92%; height: 92%; object-fit: contain; }
.wimg .ph { font: 900 10px "Unbounded", sans-serif; opacity: .55; }
.wants-search { min-width: 0; }
.field .wants-search input { border: 0; background: transparent; padding: 11px 0; border-radius: 0; box-shadow: none; }
.wants-search input:disabled { cursor: not-allowed; }
.wants-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 250px; overflow-y: auto;
  padding: 6px; border-radius: 14px; background: var(--paper-2); }
.wmini { --rc: var(--r-none); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1.5px solid transparent; font: inherit; color: inherit; min-width: 0; text-align: center; transition: border-color .12s, transform .12s; }
.wmini:hover, .wmini:focus-visible { border-color: var(--rc); transform: translateY(-2px); }
.wmini .wimg { width: 56px; height: 56px; border-radius: 10px; }
.wname { font-size: 11px; font-weight: 700; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; }
.wrar { font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--rc); }
/* показ в карточке и в объявлении */
.wthumbs { display: inline-flex; align-items: center; vertical-align: middle; }
.wthumb { --rc: var(--r-none); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; margin-left: -6px;
  background: color-mix(in srgb, var(--rc) 25%, var(--paper)); box-shadow: 0 0 0 2px var(--card); }
.wthumb:first-child { margin-left: 0; }
.wthumb img { width: 90%; height: 90%; object-fit: contain; }
.wthumb .ph { font-size: 9px; font-weight: 900; }
.wmore { margin-left: 4px; font-size: 12px; font-weight: 800; color: var(--coral); }
.wants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin: 8px 0 4px; }
.wants-note { display: block; margin-top: 4px; }

/* избранное и подписки */
.tag-fav { background: var(--coral); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 999px; }
.save-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fav-btn.on { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 50%, transparent); }
.watch-btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.tag.gone { opacity: .5; }

/* встречное предложение */
.offer-card b { font-size: 22px; }
.gold-word { font-size: 13px; color: var(--ink-3); font-family: "Manrope", sans-serif; }
.offer-note { font-size: 13px; color: var(--ink-2); }
.offer-card.st-accepted .nick-meta { color: var(--mint); font-weight: 800; }
.offer-card.st-declined, .offer-card.st-superseded { opacity: .6; }
.offer-card .btn-row { margin-top: 4px; }

/* история цен (одна серия: 2px линия, точки 8px, подписи цветом текста) */
.ph-chart { margin: 0; }
.ph-chart figcaption { display: flex; justify-content: space-between; margin-bottom: 4px; }
.ph-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ph-base { stroke: var(--line); stroke-width: 1; }
.ph-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ph-pt circle:not(.ph-hit) { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.ph-pt .ph-hit { fill: transparent; cursor: pointer; }
.ph-pt:hover circle:not(.ph-hit) { r: 6; }
.ph-chart text { font: 700 10px "Manrope", sans-serif; fill: var(--ink-3); }

/* лента рынка */
.activity { margin-top: 48px; }
.activity-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.activity-head h2 { margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 8px; }
.feed-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 8px 12px 8px 8px; box-shadow: var(--shadow); cursor: pointer; font-size: 14px; animation: pop .35s ease both; }
.feed-row:hover { box-shadow: var(--shadow-lift); }
.feed-img { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 38%, transparent), transparent 70%), color-mix(in srgb, var(--rc) 12%, var(--paper)); }
.feed-img img { width: 90%; height: 90%; object-fit: contain; }
.feed-img .ph { font-size: 12px; font-weight: 900; opacity: .5; }
.feed-ico { flex: none; }
.feed-text { flex: 1; min-width: 0; line-height: 1.35; }
.feed-text a { color: var(--ink); font-weight: 800; text-decoration: none; }
.feed-row.deal { box-shadow: var(--shadow), inset 3px 0 0 var(--mint); }
.feed-price { white-space: nowrap; }
.feed-row time { font-size: 11px; color: var(--ink-3); font-weight: 700; white-space: nowrap; }

/* уровни и достижения */
.pill-level { background: color-mix(in srgb, var(--gold-1) 30%, transparent); color: color-mix(in srgb, var(--gold-2) 70%, var(--ink)); }
.pill-level.lv-5, .pill-level.lv-6 { background: linear-gradient(90deg, var(--gold-1), var(--r-mythical)); color: #fff; }
.level-card { margin-bottom: 14px; }
.level-card .progress { width: 100%; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ach { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; opacity: .55; filter: grayscale(.8); }
.ach.ok { opacity: 1; filter: none; box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--gold-2) 55%, transparent); }
.ach-ico { font-size: 28px; }
.ach b { font-size: 14px; }
.ach small { font-size: 12px; color: var(--ink-3); }

/* журнал модерации */
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-row { display: flex; gap: 14px; align-items: baseline; background: var(--card); border-radius: 12px; padding: 9px 14px; box-shadow: var(--shadow); font-size: 14px; }
.log-row time { font-size: 12px; color: var(--ink-3); font-weight: 700; white-space: nowrap; min-width: 110px; }
.log-row a { color: var(--ink); font-weight: 800; text-decoration: none; }

/* ───────── админ-панель ───────── */
.acc-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tabs button { white-space: nowrap; flex: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kpi b { font: 900 26px/1.15 "Unbounded", sans-serif; display: flex; align-items: center; gap: 8px; }
.kpi b small { font: 700 13px "Manrope", sans-serif; text-transform: none; letter-spacing: 0; }
.kpi span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi-live { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--mint) 50%, transparent); }
.kpi-warn { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--coral) 55%, transparent); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 25%, transparent); flex: none; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.chart-card { gap: 8px; align-items: stretch; padding: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar i { display: block; width: 100%; height: max(3px, var(--h)); background: var(--bc); border-radius: 4px 4px 2px 2px; opacity: .85; transition: opacity .15s; }
.bar:hover i { opacity: 1; }
.bar:last-child i { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bc) 30%, transparent); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; }
.top-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; counter-reset: top; }
.top-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; counter-increment: top; }
.top-list li::before { content: counter(top); width: 18px; color: var(--ink-3); font-size: 12px; }
.top-list li > b { margin-left: auto; font-family: "Unbounded", sans-serif; }
.top-list a { color: var(--ink); text-decoration: none; }
.top-img { width: 32px; height: 32px; border-radius: 8px; background: color-mix(in srgb, var(--rc, var(--r-none)) 22%, var(--paper-2)); display: grid; place-items: center; overflow: hidden; flex: none; }
.top-img img { width: 90%; height: 90%; object-fit: contain; }
.top-img .ph { font-size: 11px; font-weight: 900; }
.announce-card textarea { resize: vertical; }
.au-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
.au-av { position: relative; }
.au-av .live-dot { position: absolute; right: 4px; bottom: 2px; width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--card); }
.au-main h3 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.au-main h3 a { color: var(--ink); text-decoration: none; }
.au-main h3 .pill { margin-left: 4px; font-size: 11px; padding: 2px 8px; }
.au-meta { flex-wrap: wrap; gap: 4px 14px; }
.warn-text { color: var(--coral); }
.au-row .more-menu .menu { min-width: 250px; }

/* плашка-объявление для всех посетителей */
.announce { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 10px 48px 10px 16px; position: relative;
  font-weight: 700; font-size: 14px; text-align: center; color: #fff; background: var(--accent); }
.announce-warn { background: var(--coral); }
.announce-ok { background: var(--mint); }
.announce-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255,255,255,.2); color: #fff;
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 17px; line-height: 1; }

/* ───────── цена на рынке ───────── */
.ps-slot:empty { display: none; }
.price-stats { border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ps-empty { gap: 4px; }
.ps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ps-stat { display: flex; flex-direction: column; gap: 2px; background: var(--paper-2); border-radius: 10px; padding: 8px 10px; }
.ps-stat > small:first-child { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ps-stat .price { font-size: 16px; }
.ps-range { margin: 0; }
.ps-last { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; }
.ps-last > small { flex-basis: 100%; }
.ps-last > span { display: inline-flex; gap: 5px; align-items: baseline; }
.ps-last .price { font-size: 14px; }
.price-hint { margin: -4px 0 0; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.price-hint:empty { display: none; }

/* ───────── мои объявления: срок ───────── */
.status.expired { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.mine-row.dim .tag-img { opacity: .6; }
.tag-meta.soon { color: var(--coral); }
.panel-note { margin: 0 0 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ───────── настройки ───────── */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fold { width: 100%; }
.fold summary { cursor: pointer; font-weight: 800; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.block-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.user-row.static { cursor: default; }
.user-row.static a { color: var(--ink); text-decoration: none; }
.user-row.static .btn { margin-left: auto; }
.profile-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--accent); }

/* ───────── документы ───────── */
.doc-body { max-width: 760px; margin: 0 auto; padding: 44px 0 20px; }
.doc-body h1 { font-size: clamp(28px, 4vw, 44px); }
.doc-body .lead { margin-bottom: 28px; }
.doc-body h2 { font-size: 20px; margin: 30px 0 10px; }
.doc-body p, .doc-body li { color: var(--ink-2); font-size: 15px; }
.doc-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc-body a { color: var(--accent); }
.doc-body code { background: var(--paper-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.doc-body .tips { list-style: none; padding: 0; }
.faq { background: var(--card); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { margin: 8px 0 2px; }
.how-warn a { color: inherit; font-weight: 800; }
.foot { align-items: center; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-links a[href^="mailto"] { color: var(--ink-2); }

/* ───────── адаптив ───────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-stack { height: 250px; }
  .hero-stack .tag { width: 150px; }
  .how ol { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail .tag-img { width: min(100% - 28px, 380px); margin: 14px auto 6px; }
  .detail .tag-badges { right: 56px; } /* не залезать под крестик модалки */
  .seller-card { flex-wrap: wrap; }
  .seller-card .btn { width: 100%; }
  .detail-info { padding: 4px 20px 22px; }
  .settings-grid { grid-template-columns: 1fr; }
  .sync-card { grid-template-columns: auto 1fr; }
  .sync-actions { grid-column: 1 / -1; align-items: stretch; }
  .modal-auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .sell-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sell-preview { width: 170px; margin: 0 auto; }
  .sell-preview p { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px 8px; flex-wrap: wrap; padding-block: 10px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .nav a { flex: 1; justify-content: center; padding: 7px 8px; }
  .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
  .logo-mark svg { width: 20px; height: 20px; }
  .logo-text { font-size: 17px; }
  .btn-sell { padding: 9px 13px; font-size: 13px; }
  .btn-sell span { display: none; }
  .top-actions { gap: 6px; }
  .btn-login { padding: 9px 13px; font-size: 13px; }
  .me-nick { max-width: 90px; }
  .acc-head { padding-top: 24px; gap: 14px; }
  .avatar-lg { width: 64px; height: 64px; border-radius: 20px; }
  .acc-tabs button { padding: 9px 6px; font-size: 12px; }
  .auth-main { padding: 26px 18px 20px; }
  .trust-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips-cats { mask-image: none; }
  .modal .chips { margin-inline: 0; padding-inline: 0; }
  .hero { padding: 24px 0 24px; gap: 0; }
  .hero-stack { display: none; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stats span { font-size: 11px; line-height: 1.3; display: block; }
  .lead { font-size: 15px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-catalog { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tag-body { padding: 10px 11px 12px; }
  .tag-name { font-size: 13px; }
  .price { font-size: 15px; }
  .tag-foot { flex-wrap: wrap; row-gap: 4px; }
  .seller { max-width: 100%; font-size: 11px; }
  .hero-stats div { min-width: 0; padding: 10px; }
  .hero-stats b { font-size: 16px; white-space: nowrap; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 9px 6px; font-size: 13px; }
  .toolbar select { width: 100%; }
  .how { padding: 24px 20px; }
  .how ol { grid-template-columns: 1fr; }
  .modal-sell { padding: 20px 16px; }
  .sell-head h2 { font-size: 19px; }
  .sell-actions { flex-direction: column-reverse; }
  .sell-actions .btn { width: 100%; }
  .row, .row:has(.field-qty) { grid-template-columns: 1fr; }
  .row .field-qty { max-width: none; }
  .mine-row { grid-template-columns: 60px 1fr; }
  .mine-row .acts { grid-column: 1 / -1; justify-content: stretch; }
  .mine-row .acts .btn { flex: 1; }
  .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid, .grid-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-row { grid-template-columns: 1fr; }
  .msg { max-width: 90%; }
  .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
  .chat-item { flex-wrap: wrap; }
  .chat-item-acts { width: 100%; justify-content: stretch; }
  .chat-item-acts .btn { flex: 1; }
  .chat-menu .btn[data-copy] { display: none; }
  .doc-body { padding-top: 26px; }
}
/* ───────── шапка на телефоне: логотип по центру ─────────
   1-я строка: [тема][сообщения]  ЛОГОТИП  [аккаунт]
   2-я строка: [Витрина | Каталог | Кабинет]  [+]
   Кнопки из .top-actions раскладываются по сетке шапки (display: contents), поэтому ничего не вылезает за экран. */
@media (max-width: 640px) {
  .topbar {
    display: grid; align-items: center; gap: 10px 6px; padding: 8px 12px 10px;
    grid-template-columns: 38px 38px minmax(0, 1fr) 38px 38px;
    grid-template-areas: "theme msg logo acc acc" "nav nav nav nav sell";
  }
  .top-actions { display: contents; }
  .logo { grid-area: logo; justify-self: center; min-width: 0; }
  .logo-text { font-size: 18px; }
  .nav { grid-area: nav; order: 0; width: auto; min-width: 0; margin: 0; }
  #themeBtn { grid-area: theme; }
  #msgBtn { grid-area: msg; }
  #openLogin, #meChip { grid-area: acc; justify-self: end; }
  #openSell { grid-area: sell; justify-self: end; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .btn-sell { width: 38px; height: 38px; padding: 0; border-radius: 12px; }
  .btn-login { padding: 8px 12px; }
  /* в шапке — только аватар: ник и значки занимали полэкрана */
  .me-chip { padding: 3px; border-radius: 13px; }
  .me-chip .me-nick, .me-chip .bdg { display: none; }
  .me-chip .avatar-sm { width: 30px; height: 30px; border-radius: 10px; }
  /* страницы без кнопок (404, страницы предметов): логотип и разделы */
  .topbar:not(:has(.top-actions)) { grid-template-areas: "logo logo logo logo logo" "nav nav nav nav nav"; }
  .toasts { top: 8px; }
}

/* ───────── окна на телефоне: шторка снизу ─────────
   Окно прижато к низу экрана и занимает его целиком по ширине, крестик не уезжает при прокрутке,
   главные кнопки закреплены внизу — до них всегда дотягивается большой палец. */
@media (max-width: 640px) {
  .modal {
    width: 100vw; max-width: 100vw; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 24px 24px 0 0;
    overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom);
  }
  .modal[open] { animation: sheetIn .32s cubic-bezier(.2,.9,.3,1.05); }
  @keyframes sheetIn { from { transform: translateY(40%); opacity: .4; } }
  /* «ручка» шторки */
  .modal::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
  .modal-x { position: sticky; top: 8px; float: right; margin: 0 10px -44px 0; width: 36px; height: 36px; font-size: 22px;
    background: color-mix(in srgb, var(--paper-2) 85%, transparent); backdrop-filter: blur(8px); }
  .modal-small { padding: 14px 18px 20px; }
  .detail .tag-img { width: min(100% - 32px, 300px); margin: 10px auto 4px; }
  .detail-info { padding: 4px 16px 0; gap: 14px; }
  .detail h2 { font-size: 26px; }
  .big-price { font-size: 34px; }
  .seller-card { padding: 10px; }
  /* кнопки: главная — на всю ширину и закреплена внизу окна */
  .detail-actions {
    position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); order: 10;
  }
  .detail-actions .btn { padding: 12px 10px; font-size: 14px; min-height: 48px; }
  .detail-actions .btn-primary { grid-column: 1 / -1; }
  .detail-actions .btn-danger { grid-column: 1 / -1; min-height: 40px; padding: 8px; font-size: 13px; }
  .detail-actions .btn:only-child, .detail-actions .btn-primary + .btn:last-child { grid-column: 1 / -1; }
  /* избранное / следить / поделиться — компактный ряд из одинаковых кнопок */
  .save-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .save-row .btn { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 11px; line-height: 1.2; min-height: 54px; text-align: center; white-space: normal; }
  .detail-info > .linkish { align-self: center; }
  /* форма объявления и вход */
  .modal-sell { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
  .sell-actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0 4px; margin-top: 4px; z-index: 3; }
  .auth-main { padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); }
  .pick-grid { max-height: 52dvh; }
  /* нижняя полоса iPhone не перекрывает подвал и плашку «нет связи» */
  .foot { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* очень узкие экраны (маленькие телефоны): счётчики в шапке не должны обрезаться */
@media (max-width: 400px) {
  .hero-stats { gap: 6px; }
  .hero-stats div { padding: 8px 7px; border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .hero-stats b { font-size: 14px; }
  .hero-stats span { font-size: 10px; }
  .how { padding: 20px 14px; }
  .how li { padding: 12px; }
}

/* сообщения на узком экране: либо список, либо открытый чат */
@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 150px); min-height: 420px; margin-inline: -8px; border-radius: 18px; }
  .inbox-side { border-right: 0; }
  .inbox.has-chat .inbox-side { display: none; }
  .inbox:not(.has-chat) .chat-pane { display: none; }
  .chat-back { display: block; }
  .share-nick span { display: none; }
  .au-row { grid-template-columns: 38px minmax(0, 1fr); }
  .au-row .acts { grid-column: 1 / -1; justify-content: flex-start; }  /* на телефоне кнопка — только иконка 🎮 */
  /* на телефоне чат занимает весь экран: шапка кабинета не нужна */
  .route-messages .acc-head { display: none; }
  .route-messages .acc-tabs { margin-top: 12px; }
  .chat-open .acc-tabs { display: none; }
  .chat-open .inbox { height: calc(100dvh - 120px); margin-top: 10px; }
  .chat-open .foot { display: none; }
  .chat-top, .chat-item, .chat-foot { padding-inline: 12px; }
  .inbox .chat-list { padding: 12px; }
}
