/* AdMarket — дизайн-система.
   Направление: монохром, как монограмма «AM» на аватарке — графит и жемчужно-белый, строгая геометрия.
   Цвет несёт только смысл: зелёный — деньги пришли или всё в порядке, янтарный — ждём, красный — ошибка.
   Сети TON и Solana — в своих цветах, чтобы их сразу узнавали.
   Одна смелая деталь — срезанные углы, как у щита «AM», у главных кнопок и карточки баланса, и суммы шрифтом Tektur.
   Светлая или тёмная тема — как в Telegram у пользователя; акцентный цвет Telegram не используем — у маркета свой. */
@font-face { font-family: Tektur; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/tektur-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Tektur; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/tektur-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Tektur; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/tektur-cyrillic-700.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Tektur; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/tektur-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f0f1f3; --surface: #ffffff; --raised: #e7e8ec;
  --text: #121318; --hint: #6c6f79;
  --accent: #121318; --on-accent: #ffffff; --link: #121318;
  --danger: #d93d36;
  --sep: rgb(18 19 24 / .11); --fill: rgb(18 19 24 / .06); --accent-fill: rgb(18 19 24 / .07);
  --seg-on: #ffffff; --overlay: rgb(8 9 12 / .5);
  /* Смысловые цвета: деньги и успех, ожидание, ошибка */
  --green: #1d9a5f; --money: #1d9a5f; --orange: #b97c12; --red: #d93d36;
  --radius: 12px;
  --cut: 10px; /* срез угла у главных кнопок */
  --tabs-h: 56px;
  --display: Tektur, Bahnschrift, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13; --surface: #17181d; --raised: #22232a;
    --text: #edeef1; --hint: #8b8e99;
    --accent: #edeef1; --on-accent: #0e0f13; --link: #edeef1;
    --danger: #f2645c;
    --sep: rgb(237 238 241 / .09); --fill: rgb(237 238 241 / .07); --accent-fill: rgb(237 238 241 / .08);
    --seg-on: #2c2d35; --overlay: rgb(0 0 0 / .6);
    --green: #44c38b; --money: #44c38b; --orange: #e3ae4e; --red: #f2645c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f13; --surface: #17181d; --raised: #22232a;
  --text: #edeef1; --hint: #8b8e99;
  --accent: #edeef1; --on-accent: #0e0f13; --link: #edeef1;
  --danger: #f2645c;
  --sep: rgb(237 238 241 / .09); --fill: rgb(237 238 241 / .07); --accent-fill: rgb(237 238 241 / .08);
  --seg-on: #2c2d35; --overlay: rgb(0 0 0 / .6);
  --green: #44c38b; --money: #44c38b; --orange: #e3ae4e; --red: #f2645c;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
/* В тексте ссылка подчёркнута: цвет у неё тот же, что у текста */
.alert a, .footnote a, .hint a, .legal a, .rule a, p a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Иконки */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.btn .i, .chip .i { width: 18px; height: 18px; }
.small .i, .hint .i, .badge .i { width: 15px; height: 15px; vertical-align: -3px; }

.view { padding: 8px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; min-height: 100vh; }
.view.no-tabs { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* Типографика */
h1 { font-family: var(--display); font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; margin: 10px 0 14px; }
h2 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin: 20px 0 10px; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
.hint, .muted { color: var(--hint); }
.hint { font-size: 14px; }
.small { font-size: 13px; }
.center { text-align: center; }
.text-foreground { color: var(--text); }
.text-success { color: var(--money); }
.text-destructive { color: var(--danger); }
.section-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 26px 2px 10px; }
.section-title .hint, .section-title.row .hint { font-weight: 400; }
.sub-group { font-size: 13px; font-weight: 600; color: var(--hint); margin: 14px 0 6px; }
.sub-group:first-child { margin-top: 0; }
.desc { white-space: pre-wrap; margin: 12px 0 0; font-size: 15px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Группы (как в настройках Telegram) */
.card { display: block; position: relative; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card.tap { cursor: pointer; }
.card.tap:active, .li.tap:active, .q-row:active, .choose-item:active { background: color-mix(in srgb, var(--surface) 88%, var(--hint)); }
.list, .group { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.li { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; }
.li + .li::before, .q-row + .q-row::before, .choose-item + .choose-item::before {
  content: ''; position: absolute; top: 0; right: 0; left: 16px; height: 1px; transform: scaleY(.5); transform-origin: top; background: var(--sep);
}
.li.tap { cursor: pointer; }
.li input[type=radio] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.footnote { font-size: 13px; line-height: 1.4; color: var(--hint); margin: -4px 16px 14px; }

/* Таблица «название — значение» */
.kv { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; font-size: 15px; }
.kv > * { padding: 9px 0; position: relative; }
.kv > :nth-child(odd) { color: var(--text); }
.kv > :nth-child(even) { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv > :nth-child(n+3)::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); transform-origin: top; background: var(--sep); }
.kv > :nth-child(odd):nth-child(n+3)::before { right: -16px; }

/* Ряд показателей (без «плиток»): цифра крупно, подпись мелко, тонкие разделители */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; padding-top: 12px; position: relative; }
.metrics::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); background: var(--sep); }
.metric { min-width: 0; padding: 0 10px; text-align: left; }
.metric:first-child { padding-left: 0; }
.metric + .metric { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--hint) 22%, transparent); }
.metric b { display: block; font-family: var(--display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric span { display: block; font-size: 12px; line-height: 1.3; color: var(--hint); margin-top: 1px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; text-decoration: none; }
.btn:active { opacity: .82; }
.btn:not(.secondary, .outline, .ghost, .destructive, .sm) { border-radius: 3px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.btn:not(.secondary, .outline, .ghost, .destructive, .sm):focus-visible { outline-color: var(--on-accent); outline-offset: -5px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.secondary { background: var(--accent-fill); color: var(--accent); }
.btn.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--sep); color: var(--text); }
.btn.ghost { background: none; color: var(--accent); width: auto; height: auto; padding: 4px 2px; font-weight: 500; }
.btn.destructive { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.btn.success { background: var(--green); color: #fff; }
.btn.secondary, .balance .btn + .btn { box-shadow: inset 0 0 0 1px var(--sep); }
.btn.sm { height: 36px; font-size: 15px; padding: 0 14px; width: auto; border-radius: 10px; gap: 6px; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--fill); color: var(--text); cursor: pointer; }
.icon-btn.round { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--accent); }
.icon-btn.round .i { width: 20px; height: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--link); font-size: 17px; padding: 6px 0; margin: 0 0 2px -6px; cursor: pointer; }
.sticky-bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 .5px 0 var(--sep); z-index: 15; }
.sticky-bottom > div { max-width: 688px; margin: 0 auto; }
.spinner { display: inline-block; flex: none; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Поля ввода */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field-label { font-size: 13px; color: var(--hint); margin: 0 2px; }
.field[data-invalid] .input, .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 46px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--fill); outline: none; font-size: 16px; -webkit-appearance: none; appearance: none; }
select.input { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.input:focus, .input-group:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.input-group { display: flex; align-items: center; border-radius: 10px; background: var(--fill); overflow: hidden; }
.input-group .input { background: transparent !important; box-shadow: none !important; }
.input-group-addon { padding: 0 14px 0 4px; color: var(--hint); white-space: nowrap; font-size: 15px; }
.search { position: relative; margin-bottom: 4px; }
.search .input { height: 40px; padding-left: 38px; background: var(--fill); border-radius: 10px; font-size: 16px; }
.search::before { content: ''; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); background: var(--hint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.4; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; }

/* Чипы и переключатели */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); font-size: 15px; cursor: pointer; white-space: nowrap; }
.card .chip, .sheet .chip { background: var(--fill); }
.sheet .card .chip { background: var(--fill); }
.chip.on, .chip[aria-pressed="true"], .card .chip.on, .sheet .chip.on { background: var(--accent); color: var(--on-accent); }
.chip.sug { box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip.ghost { background: none; color: var(--hint); box-shadow: inset 0 0 0 1px var(--sep); }
.cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 12px; line-height: 18px; text-align: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.tabs-list, .toggle-group { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin-bottom: 14px; gap: 2px; }
.tabs-list > button, .toggle-group > button { flex: 1; height: 32px; border: 0; background: none; border-radius: 7px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text); white-space: nowrap; padding: 0 8px; }
.tabs-list > button[aria-selected="true"], .toggle-group > button[aria-pressed="true"] { background: var(--seg-on); font-weight: 600; box-shadow: 0 3px 8px rgb(0 0 0 / .12), 0 3px 1px rgb(0 0 0 / .04); }
.sub-group + .chips.wrap, .chips.wrap + .sub-group { margin-top: 8px; }

/* Метки */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--hint); white-space: nowrap; }
.badge.muted { background: var(--fill); color: var(--hint); }
.badge.success { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--money); }
.badge.warning { background: color-mix(in srgb, var(--orange) 15%, transparent); color: color-mix(in srgb, var(--orange) 85%, var(--text)); }
.badge.destructive { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--danger); }
.badge.promo { background: var(--accent); color: var(--on-accent); }
.badge.lg { height: 26px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Сообщения */
.alert { display: block; padding: 12px 14px; border-radius: var(--radius); font-size: 15px; line-height: 1.4; margin-bottom: 12px; background: var(--surface); }
.alert.with-icon { display: flex; gap: 10px; align-items: flex-start; }
.alert.with-icon > .i:first-child { color: var(--accent); vertical-align: 0; }
.alert.with-icon > div { min-width: 0; }
.alert.destructive { background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.alert.destructive b, .alert.destructive.with-icon > .i:first-child { color: var(--danger); }
.alert.success { background: color-mix(in srgb, var(--green) 11%, var(--surface)); }
.alert.success.with-icon > .i:first-child { color: var(--money); }
.alert.warning { background: color-mix(in srgb, var(--orange) 11%, var(--surface)); }
.alert.warning.with-icon > .i:first-child { color: var(--orange); }
.alert b { overflow-wrap: anywhere; }

/* Пустые состояния и загрузка */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 48px 20px; }
.empty-header { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 300px; }
.empty-media { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--hint); font-size: 30px; }
.empty-media .i { width: 30px; height: 30px; }
.empty-title { color: var(--hint); font-size: 15px; line-height: 1.45; }
.empty-content:empty { display: none; }
.skeleton { background: var(--fill); border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
.skeleton-card { display: flex; gap: 12px; align-items: center; }
.skeleton-card .ava-sk { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; }
@keyframes pulse { 50% { opacity: .5; } }

/* Аватары: буква на цвете Telegram, фото поверх */
.ava { position: relative; overflow: hidden; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #edeef1; font-family: var(--display); font-weight: 600; font-size: 18px; }
.ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava.lg { width: 72px; height: 72px; font-size: 28px; }
.ava.xs { width: 28px; height: 28px; font-size: 13px; }

/* Цветные квадратные иконки (как в настройках Telegram) */
.sq { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--text); background: var(--raised); }
.sq .i { width: 18px; height: 18px; stroke-width: 2; }
.sq.lg { width: 40px; height: 40px; border-radius: 11px; }
.sq.lg .i { width: 22px; height: 22px; }
.sq.money { color: var(--money); }
.sq.danger { color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--raised)); }

/* Выбор услуги на главной */
.choose { display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.choose-item { position: relative; display: flex; width: 100%; gap: 12px; align-items: center; text-align: left; padding: 10px 14px 10px 16px; border: 0; background: none; cursor: pointer; color: var(--text); min-height: 60px; }
.choose-item + .choose-item::before { left: 68px; }
.choose-item b { display: block; font-size: 16px; font-weight: 500; }
.choose-item small { display: block; color: var(--hint); font-size: 13px; line-height: 1.3; margin-top: 1px; }
.choose-item > span:nth-child(2) { flex: 1; min-width: 0; }
.chev { color: color-mix(in srgb, var(--hint) 70%, transparent); width: 18px !important; height: 18px !important; }
.fmt-bar { display: flex; gap: 12px; align-items: center; padding: 12px 14px 12px 16px; margin: 12px 0; border-radius: var(--radius); background: var(--surface); }
.fmt-bar .grow b { display: block; font-size: 16px; font-weight: 600; }
.fmt-bar .grow small { display: block; color: var(--hint); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.fmt-bar .btn { flex: none; }

/* Выдача: строки с колонкой цен, как котировки на бирже */
.quotes { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.q-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.q-row + .q-row::before { left: 72px; }
.q-main { flex: 1; min-width: 0; }
.q-title { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; line-height: 1.25; }
.q-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: 14px; color: var(--hint); line-height: 1.3; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-facts { display: flex; gap: 12px; margin-top: 5px; font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.q-facts span { display: inline-flex; align-items: center; gap: 3px; }
.q-facts .i { width: 14px; height: 14px; stroke-width: 2; }
.q-facts .rate { color: var(--text); }
.q-facts .rate .i { color: var(--orange); fill: var(--orange); stroke: var(--orange); }
.q-price { flex: none; text-align: right; }
.q-price b { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-price small { display: block; max-width: 84px; margin: 1px 0 0 auto; font-size: 12px; line-height: 1.25; color: var(--hint); }
.q-tag { height: 18px; padding: 0 6px; border-radius: 3px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; flex: none; }
.q-tag.mine { background: var(--fill); color: var(--hint); }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 10px; }
.results-head b { font-size: 17px; font-weight: 600; }
.toolbar-row { display: flex; gap: 8px; margin: 0 0 10px; }
.toolbar-row .btn { flex: none; background: var(--surface); color: var(--text); }
.toolbar-row select.input { flex: 1; height: 36px; font-size: 15px; background-color: var(--surface); border-radius: 10px; }

/* Категории — текстовые чипы, игры — строкой */
.cat-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-tile { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); font-size: 15px; cursor: pointer; white-space: nowrap; }
.cat-tile small { color: var(--hint); font-size: 13px; font-variant-numeric: tabular-nums; }
.cat-tile.all { background: var(--accent-fill); color: var(--accent); font-weight: 500; }
.sel-chips { margin-top: 10px; }
.tree-row { padding: 10px 0; position: relative; }
.tree-row + .tree-row::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); background: var(--sep); }

/* Страница канала */
.hero { padding: 18px 16px; }
.ch-title { font-weight: 600; font-size: 16px; }
.hero .ch-title.big { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.hero-actions { margin-top: 14px; }
.hero-actions .btn { flex: 1; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 14px; }
.crumbs a { padding: 4px 10px; border-radius: 8px; background: var(--accent-fill); }
.seller-card { display: flex; align-items: center; gap: 12px; }
.guarantee h3 { display: flex; align-items: center; gap: 8px; }
.guarantee h3 .i { color: var(--money); }
.guarantee .stack { gap: 8px; }
.guarantee .stack > div { color: var(--text); font-size: 15px; line-height: 1.4; }
.fav-wide.on { color: var(--red); }
.mini-scroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
.mini-scroll::-webkit-scrollbar { display: none; }
.mini { position: relative; flex: none; width: 148px; padding: 12px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.mini .ava { width: 40px; height: 40px; font-size: 16px; margin-bottom: 6px; }
.mini b.truncate { font-size: 15px; }
.mini .badge { align-self: flex-start; margin: 2px 0; }
.mini .q-tag { position: absolute; top: 12px; right: 12px; }
.mini-price { font-family: var(--display); font-size: 15px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; padding-top: 12px; position: relative; }
.price-line::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); background: var(--sep); }
.price-line.flat { margin-top: 0; padding-top: 0; }
.price-line.flat::before { display: none; }
.price-line > .hint { min-width: 0; }
.price-line .big { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card.promoted { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Кошелёк */
.balance { background: linear-gradient(135deg, color-mix(in srgb, var(--text) 7%, var(--surface)), var(--surface) 60%); border-radius: 4px; padding: 18px 16px 16px; margin-bottom: 12px;
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.balance .amount { font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 2px 0 2px; }
.balance .sub { color: var(--hint); font-size: 14px; }
.balance .btns { margin-top: 16px; }
.balance .btn + .btn { background: var(--accent-fill); color: var(--accent); }
.promo-banner { background: var(--surface); }
.promo-banner.active { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); }
.promo-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; position: relative; }
.promo-line::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); background: var(--sep); }
.copy { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--fill); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.method { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); cursor: pointer; margin-bottom: 8px; }
.method.on { box-shadow: inset 0 0 0 2px var(--accent); }
.method .mi { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: none; }
.banned { text-align: center; padding: 60px 20px; }

/* Пост (превью как в Telegram) */
.post { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--sep); }
.post img, .post video { display: block; width: 100%; max-height: 360px; object-fit: cover; background: #000; }
.post .ptext { padding: 10px 12px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.4; }
.post .ptext:empty { display: none; }
.post .pbtns { display: grid; gap: 4px; padding: 0 6px 6px; }
.post .pbtn { background: var(--accent-fill); color: var(--accent); text-align: center; padding: 9px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.spoiler { background: var(--hint); color: transparent; border-radius: 4px; cursor: pointer; transition: .2s; }
.spoiler.open { background: none; color: inherit; }
.ptext code, .ptext pre { font-family: ui-monospace, Menlo, monospace; background: var(--fill); padding: 1px 4px; border-radius: 4px; }
.ptext blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--accent); }

/* Редактор поста */
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 38px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--fill); cursor: pointer; font-size: 15px; }
.toolbar button .i { width: 16px; height: 16px; }
.toolbar button:active { background: var(--accent-fill); }
.editor { min-height: 140px; max-height: 50vh; overflow-y: auto; padding: 12px 14px; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); box-shadow: inset 0 .5px 0 var(--sep); outline: none; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.editor:empty::before { content: attr(data-ph); color: var(--hint); }
.editor .tg-spoiler { background: color-mix(in srgb, var(--hint) 35%, transparent); border-radius: 3px; }
.counter { text-align: right; font-size: 12px; color: var(--hint); margin-top: 6px; }
.counter.over { color: var(--danger); }
.media-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.media-box img, .media-box video { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.media-box .rm { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; }
.btn-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
.btn-row .input { height: 42px; font-size: 15px; }

/* Прогресс и графики */
.progress { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.chart { width: 100%; height: 130px; display: block; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .ar { fill: var(--accent-fill); }
.chart .tg { stroke: var(--green); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart text { fill: var(--hint); font-size: 10px; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 84px; margin-top: 14px; }
.bar { position: relative; height: 100%; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar.promo { background: color-mix(in srgb, var(--accent) 14%, var(--fill)); }
.bar i, .bar b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; }
.bar i { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.bar b { background: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.dot.opens { background: var(--accent); }
.dot.promo { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Хронология */
.timeline { position: relative; padding-left: 18px; }
.timeline .ev { position: relative; display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; font-size: 15px; }
.timeline .ev time { flex: none; color: var(--hint); font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline .ev::before { content: ''; position: absolute; left: -15px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .ev::after { content: ''; position: absolute; left: -12px; top: 18px; bottom: -2px; width: 2px; background: var(--fill); }
.timeline .ev:last-child { padding-bottom: 0; }
.timeline .ev:last-child::after { display: none; }

/* Чат */
.msgs { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 18px; background: var(--surface); white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.35; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.msg:not(.mine):not(.sys) { border-bottom-left-radius: 6px; }
.msg.sys { align-self: center; max-width: 92%; background: color-mix(in srgb, var(--hint) 20%, transparent); color: var(--text); font-size: 13px; text-align: center; border-radius: 14px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; text-align: right; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; height: 42px; min-height: 42px; max-height: 120px; resize: none; padding: 10px 14px; border-radius: 21px; }
.chat-input .btn { width: 42px; height: 42px; padding: 0; border-radius: 50%; clip-path: none; }
.unread { min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; display: grid; place-items: center; padding: 0 6px; font-weight: 600; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--orange); }

/* «Что сейчас» в заказе */
.now { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; font-size: 15px; line-height: 1.4; }
.now-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-fill); }

/* Шаги («Как это работает») */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 3px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; background: var(--accent); color: var(--on-accent); }
.step b { display: block; margin-bottom: 1px; }

/* Подсказки «что это?» */
.ti-btn { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 3px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--hint); font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; cursor: pointer; }

/* Рейтинг и отзывы */
.stars { color: var(--orange); letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; color: var(--fill); }
.rsum { display: flex; gap: 18px; align-items: center; padding-bottom: 12px; }
.rbig { display: flex; flex-direction: column; align-items: center; min-width: 86px; }
.rbig b { font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; }
.rbars { flex: 1; display: grid; gap: 4px; }
.rbar { display: grid; grid-template-columns: 12px 1fr 24px; gap: 6px; align-items: center; font-size: 12px; color: var(--hint); }
.rbar div { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.rbar i { display: block; height: 100%; background: var(--orange); border-radius: 3px; }
.review { padding: 12px 0; position: relative; }
.review::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; transform: scaleY(.5); background: var(--sep); }
.rtext { white-space: pre-wrap; font-size: 15px; margin-top: 4px; }
.reply { margin-top: 8px; padding: 9px 12px; border-radius: 10px; background: var(--fill); font-size: 14px; }
.reply b { font-size: 12px; color: var(--accent); }
.star-pick { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.star-pick button { border: 0; background: none; font-size: 38px; line-height: 1; color: var(--fill); cursor: pointer; }
.star-pick button.on { color: var(--orange); }
.review-form { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--orange) 50%, transparent); }

/* Нижнее меню */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 .5px 0 var(--sep); }
.tab { flex: 1; height: var(--tabs-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--hint); position: relative; cursor: pointer; }
.tab .i { width: 25px; height: 25px; stroke-width: 1.7; }
.tab.on { color: var(--accent); }
.tab.on::before { content: ''; position: absolute; top: 0; left: 50%; width: 24px; height: 2px; margin-left: -12px; background: var(--accent); }
.tab.on .i { stroke-width: 2.1; }
.tab-count { position: absolute; top: 5px; left: 50%; margin-left: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }

/* Нижняя шторка */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: var(--overlay); animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 14px 14px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, .8, .2, 1); max-width: 720px; margin: 0 auto; }
.sheet::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 12px; cursor: grab; }
.sheet h2:first-child { margin-top: 4px; }
.sheet-actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--bg); padding: 12px 0 4px; margin-top: 8px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* Уведомление */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); z-index: 60; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; font-size: 15px; text-align: center; animation: up .2s; max-width: 520px; margin: 0 auto; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.toast.destructive { background: var(--red); color: #fff; }

/* Строки списков: многострочные, разделители от начала текста */
.nowrap { white-space: nowrap; }
.li.top { align-items: flex-start; }
.li.top > .ava { margin-top: 2px; }
.li + .li:has(> .ava:first-child)::before { left: 72px; }
.li + .li:has(> .sq.lg:first-child)::before { left: 68px; }
.i.rot90 { transform: rotate(90deg); }
.cat-tile .i { width: 18px; height: 18px; }
.back-link .i { width: 24px; height: 24px; }
.chat-input .btn .i { width: 20px; height: 20px; }
.fav-wide.on .i { fill: currentColor; }
.metrics:first-child { margin-top: 0; padding-top: 0; }
.metrics:first-child::before { display: none; }
.q-row:focus-visible, .mini:focus-visible { outline-offset: -2px; }

/* Шаги в форме покупки: номер в кружке и вопрос */
.step-title { display: flex; align-items: center; gap: 10px; }
.step-title .step-n { width: 24px; height: 24px; font-size: 13px; }
.step-title .btn.ghost { flex: none; }

/* Подпись внутри чипа: цена срока, категория темы */
.chip-sub { color: var(--hint); font-weight: 400; margin-left: 2px; }
.chip.on .chip-sub { color: inherit; opacity: .75; }

/* Списки с галочками: права бота, гарантии */
.checks { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.checks > div, .guarantee .stack > div { position: relative; padding-left: 28px; }
.checks > div::before, .guarantee .stack > div::before {
  content: ''; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; background: var(--green);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Список с иконками (продвижение в топ) */
.icon-list { display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.4; }
.icon-list > div { display: flex; gap: 12px; align-items: flex-start; }
.icon-list .i { color: var(--accent); margin-top: 1px; }
.kv-note { display: block; font-size: 12px; line-height: 1.3; color: var(--hint); margin-top: 1px; }

/* Главная: поле поиска-кнопка */
.search-open { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; margin: 0 0 4px; border: 0; border-radius: 10px; background: var(--fill); color: var(--hint); font-size: 16px; text-align: left; cursor: pointer; }
.search-open .i { width: 18px; height: 18px; stroke-width: 2; }
.search-top { margin: 6px 0 10px; }
.search-top .input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Правила: разделы с короткими пунктами */
.rules { display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.45; }
.rule > b { display: block; font-size: 15px; margin-bottom: 4px; }
.rule ul { margin: 0; padding-left: 18px; }
.rule li { margin: 3px 0; }
.rule li::marker { color: var(--hint); }

/* Логотип AdMarket */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 4px; object-fit: cover; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.brand-mark.lg { width: 72px; height: 72px; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }

/* Согласие и юридические тексты */
.consent { padding-top: 8px; }
.consent-mark { display: block; margin: 14px auto 0; }
.consent .li > .i { color: var(--accent); }
.legal h3 { margin: 18px 0 6px; font-size: 16px; }
.legal p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }

/* Кошелёк */
.cur-sel { width: auto; height: 34px; font-size: 14px; background-color: var(--surface); }
.method-row .pick { color: var(--accent); visibility: hidden; }
.method-row.on .pick { visibility: visible; }

/* Админка */
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 6px; }
.kpi span { display: block; font-size: 13px; color: var(--hint); }
.kpi b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; margin-top: 2px; }
.rank { flex: none; width: 22px; color: var(--hint); font-size: 14px; font-variant-numeric: tabular-nums; }
.li .right { text-align: right; flex: none; }
.log-details { margin-top: 4px; line-height: 1.5; word-break: break-word; color: var(--text); }
.log-details code { font-size: 12px; }
.copy-inline { cursor: pointer; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.li code { word-break: break-all; }
/* Панель поиска: три элемента в строку на узком экране */
.toolbar-row .btn.sm { padding: 0 11px; font-size: 14px; }
.toolbar-row select.input { min-width: 0; padding: 0 26px 0 10px; font-size: 14px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }

/* Кошелёк TON */
.sq.ton { background: #0098ea; color: #fff; }
.sq.sol { background: linear-gradient(135deg, #9945ff, #14f195); color: #fff; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }

/* Чат сделки: фото, сообщения администрации; доказательства в жалобах */
.msg.admin { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent); }
.msg-from { display: block; font-size: 12px; font-weight: 600; color: var(--orange); margin-bottom: 2px; }
.msg-photo { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 4px; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.chat-input .icon-btn { flex: none; }
