/* ─────────────────────────────────────────────────────────────────────────
   Характер Raion в сине-белых цветах панели.

   Владелец: «оставить в сине-белом, но с элементами как у Raion». Поэтому
   палитра остаётся синей (акцент) и белой (текст / светлая тема), а от
   raionchick.live берутся приёмы, которые делают его узнаваемым:

   * шрифт Geist и Geist Mono — плотный гротеск и моноширинные подписи;
   * крупные жирные заголовки прописными с плотной разрядкой;
   * подписи разделов «01 / …» моноширинным капсом, под ними тонкая линия;
   * фон — тонкая сетка из линий, а не цветные пятна;
   * вкладки — текст с подчёркиванием, а не плитки-«квадраты»;
   * круглые обводки у значков и стрелок, как круглые кнопки Raion;
   * бегущая строка с «+» между пунктами;
   * заставка: цветной экран, огромное слово, линия, растущая слева направо.

   Порядок слоёв: app.css (устройство) → hex.css (графит) → hx.css (группы
   Hex) → этот файл (характер). Здесь только внешний вид.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --font: "Geist", "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --rx-line: rgba(255, 255, 255, 0.09);
  --rx-grid: rgba(255, 255, 255, 0.035);
  --rx-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="light"] {
  --rx-line: rgba(17, 24, 39, 0.12);
  --rx-grid: rgba(17, 24, 39, 0.055);
}

/* ─── фон: сетка линий вместо цветных пятен ─── */
body::before {
  inset: 0;
  height: auto;
  filter: none;
  background-image:
    linear-gradient(var(--rx-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rx-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 90%);
}

/* ─── заголовок экрана: жирный гротеск прописными ─── */
.header__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.header { border-bottom: 1px solid var(--rx-line); }

/* ─── подписи разделов «01 / …» ─── */
.view, [data-inner] { counter-reset: rx-sec; }
.section__head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rx-line);
  margin-bottom: 12px;
}
.section__title {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-2);
}
.section__title::before {
  counter-increment: rx-sec;
  content: counter(rx-sec, decimal-leading-zero) " /";
  color: var(--accent);
}
.section__title svg { display: none; }
.hx-sublabel, .tile__label, .kv__k { font-family: var(--mono); }

/* ─── вкладки и переключатели: текст с подчёркиванием, без плиток ─── */
.seg,
.seg--tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rx-line);
  border-radius: 0;
  background: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg__opt,
.seg--tabs .seg__opt {
  flex: 0 0 auto;
  flex-direction: row;
  min-width: 0;
  min-height: 0;
  padding: 11px 1px 12px;
  border-radius: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-3);
  background: none;
}
.seg__opt svg,
.seg--tabs .seg__opt svg { display: none; }
.seg__opt[aria-pressed="true"] { color: var(--fg); }
.seg__glow {
  background: none;
  border-radius: 0;
  box-shadow: inset 0 -2px 0 var(--accent);
}
/* Раздел с вкладками: полоса во всю ширину, как навигация Raion. */
.seg--tabs { justify-content: space-between; gap: 12px; }

/* ─── группы: круглая обводка у значка и у стрелки ─── */
.hx-list { counter-reset: rx-acc; }
.hx-acc__tile {
  background: transparent;
  border: 1px solid var(--rx-line);
  color: var(--fg);
}
.hx-acc--open .hx-acc__tile {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  transform: none;
}
.hx-acc--danger .hx-acc__tile { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.hx-acc--danger.hx-acc--open .hx-acc__tile { background: var(--bad); color: #fff; }
.hx-acc__title::before {
  counter-increment: rx-acc;
  content: counter(rx-acc, decimal-leading-zero);
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.hx-acc__chev {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 9px;
  border: 1px solid var(--rx-line);
  border-radius: 50%;
}
.hx-acc--open .hx-acc__chev { border-color: var(--accent); color: var(--accent); }
.hx-acc__title { font-weight: 700; letter-spacing: -0.02em; }

/* ─── крупные цифры — плотный гротеск ─── */
.money-hero__value, .tile__value, .kpi__value, .stat__value { font-family: var(--font); font-weight: 800; letter-spacing: -0.04em; }

/* ─── кнопки: чёткие, текст прописными с разрядкой у главных ─── */
.btn--primary { letter-spacing: 0.02em; }

/* ─── заставка (Raion intro), в синем ─── */
.rx-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  background: #2f80ed;
  color: #fff;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s var(--rx-ease);
}
.rx-splash--out { clip-path: inset(0 0 100% 0); }
.rx-splash__word {
  position: relative;
  font-family: "Geist", "Arial Black", Arial, sans-serif;
  font-size: clamp(40px, 13.5vw, 128px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.05em;
  animation: rx-word 0.9s var(--rx-ease) both;
}
.rx-splash__word sup {
  position: absolute;
  top: -0.1em;
  right: -0.55em;
  font-size: 0.18em;
  font-weight: 600;
  letter-spacing: 0;
}
@keyframes rx-word { from { opacity: 0; transform: translateY(18px); } }
.rx-splash__line {
  position: relative;
  width: min(78vw, 560px);
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.rx-splash__line i {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: left;
  animation: rx-load 1.4s var(--rx-ease) forwards;
}
@keyframes rx-load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rx-splash__cap {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.9;
  animation: rx-word 0.9s 0.12s var(--rx-ease) both;
}
@media (prefers-reduced-motion: reduce) {
  .rx-splash, .rx-splash__word, .rx-splash__cap, .rx-splash__line i { animation: none; transition: none; }
}

/* ─── полоска загрузки под шапкой — тоже линия Raion, во всю ширину ─── */
.header::after { background: var(--accent); height: 2px; }

/* ─── главная цифра: сплошной синий блок с сеткой, белый крупный текст (как цветные блоки Raion) ─── */
.money-hero {
  border: 0;
  color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--accent) 60%, #0b1b3a), transparent 70%),
    linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #0b1b3a));
  box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--accent) 80%, transparent);
}
.money-hero__label { color: rgba(255, 255, 255, 0.82); }
.money-hero__label .btn { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); }
.money-hero__value { font-weight: 900; letter-spacing: -0.055em; }
.money-hero__value .cur { color: rgba(255, 255, 255, 0.72); }
.money-hero__sub { color: rgba(255, 255, 255, 0.82); }
.money-hero__trend { padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.money-hero__trend.up, .money-hero__trend.down { color: #fff; }

/* ─── быстрые действия: номер, круглый значок-обводка, подпись крупно (строки проектов Raion) ─── */
.qa-grid { counter-reset: rx-qa; }
.qa {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 14px 14px 16px;
  background: var(--hx-surface, var(--card));
  border-color: var(--rx-line);
}
.qa::before {
  counter-increment: rx-qa;
  content: counter(rx-qa, decimal-leading-zero);
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--fg-3);
}
.qa .qa__icon,
.qa[class*="qa--"] .qa__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--rx-line);
  color: var(--fg);
  transition: background 0.35s var(--rx-ease), color 0.35s, border-color 0.35s;
}
.qa:hover .qa__icon, .qa:active .qa__icon { background: var(--accent); border-color: transparent; color: #fff; }
.qa__text { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
@media (max-width: 420px) {
  .qa { padding: 13px 13px 15px; min-height: 104px; }
  .qa .qa__icon { width: 38px; height: 38px; border-radius: 50%; }
  .qa__text { font-size: 15px; }
}

/* ─── плитки показателей: подпись моно, цифра плотным гротеском ─── */
.tile { border-color: var(--rx-line); }
.tile__value { font-weight: 900; letter-spacing: -0.05em; }

/* Пять вкладок раздела на узком экране: чуть мельче и плотнее, чтобы последняя не уходила за край. */
@media (max-width: 420px) {
  .seg--tabs { gap: 6px; }
  .seg--tabs .seg__opt { font-size: 13.5px; letter-spacing: -0.02em; }
}

/* ─── починка вёрстки на узком экране (мини-приложение в Telegram Desktop ~320 px) ─── */
/* Переключатель тарифа — по размеру, а не во всю строку: иначе он выталкивал название тарифа до нуля. */
.plan__head .switch { width: auto; }
/* Сетки групп и полей не растягиваются по самому широкому ребёнку: строка кнопок уводила карточку за край. */
.hx-list, .hx-fields { grid-template-columns: minmax(0, 1fr); }
.hx-acc__head { min-width: 0; }
.switch .grow { min-width: 0; }
/* Две кнопки в ряд: длинная подпись переносится на вторую строку, а не обрезается. */
.btn-row .btn { white-space: normal; line-height: 1.15; height: auto; min-height: 46px; padding: 8px 10px; text-align: center; }
@media (max-width: 380px) {
  .hx-acc__head { gap: 12px; padding: 16px; }
  .hx-acc__tile { width: 40px; height: 40px; }
  .hx-fields { padding: 14px 16px 18px; }
}

/* ─── вложенные переключатели (внутри вкладки раздела) — пилюлями: две полосы подчёркиваний подряд сливались ─── */
[data-inner] .seg {
  gap: 8px;
  padding: 2px 0 4px;
  border-bottom: 0;
}
[data-inner] .seg__opt {
  padding: 8px 14px;
  border: 1px solid var(--rx-line);
  border-radius: 999px;
  font-size: 13.5px;
}
[data-inner] .seg__opt[aria-pressed="true"] { border-color: transparent; color: var(--chip-on-fg, var(--accent)); }
[data-inner] .seg__glow {
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
/* Подписи трёх полей тарифа в одну строку и поля по одной линии: «Продление, ₽» переносилась и роняла своё поле. */
.plan__field { justify-content: flex-end; }
.plan__field small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.06em; }

/* ─── окно Telegram Desktop: ничего не шире окна и никакой прокрутки вбок ───
   Бегущая строка стояла с отступами −16 px при полях страницы 16 px; где поля меньше (или окно уже),
   она выступала за край, страницу можно было сдвинуть вбок — и сдвиг оставался на всех экранах:
   шапка и вкладки «уезжали» вправо. */
html, body { overflow-x: hidden; overscroll-behavior-x: none; }
.main { overflow-x: clip; }

/* ─── строки списков: плашка статуса переносится под имя, а не обрезается ─── */
.row__title:has(.badge) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  white-space: normal;
  overflow: visible;
}
.row__title .badge { flex: none; white-space: nowrap; }

/* ─── фильтры-пилюли — одной строкой с прокруткой, а не в два ряда ─── */
.chips:not(.chips--fill):not(.chips--tight), [data-inner] .seg, [data-inner] .seg--wrap {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.chips:not(.chips--fill) > *, [data-inner] .seg__opt { flex: none; }

/* ─── плитки значков — ровные круги везде ───
   Общее правило первой колонки строки (.row > span:first-child…) задавало ей ширину 22 px, а высоту плитки
   оставляло 36 px — выходил вертикальный овал. Здесь размер плитки задаётся ей самой и важнее того правила. */
.opt__icon, .fold__icon, .feed__icon, .drawer__icon, .hold__icon, .qa__icon, .hx-acc__tile {
  flex: none !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
}
.opt .opt__icon { width: 38px !important; height: 38px !important; }
.fold__icon { width: 38px !important; height: 38px !important; }
.feed__icon { width: 32px !important; height: 32px !important; }

/* ─── «Рассылка — в боте» ─── */
.bc-intro { display: flex; gap: 14px; padding: 16px; margin-bottom: 16px; }
.bc-intro__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; }
.bc-intro__body { display: grid; gap: 8px; min-width: 0; }
.bc-intro__title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.bc-intro__text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }

/* ─── премиум-эмодзи картинкой (как в Telegram) ─── */
.pe { display: inline-block; vertical-align: -0.22em; object-fit: contain; }
.pe--tint { background-color: currentColor; -webkit-mask: var(--pe) center / contain no-repeat; mask: var(--pe) center / contain no-repeat; }
.hx-emoji .pe { vertical-align: middle; }
.hx-emoji-tile__glyph .pe { vertical-align: middle; }

/* ─── тексты: карточки с сообщением, как в Telegram ─── */
.tx-list { display: grid; gap: 10px; padding: 14px; grid-template-columns: minmax(0, 1fr); }
.tx-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--rx-line);
  background: var(--inset);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.3s var(--rx-ease);
}
.tx-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rx-line)); }
.tx-card:active { transform: scale(0.99); }
.tx-card--own { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.tx-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tx-card__title { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.tx-card__own { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; }

/* Пузырь сообщения — цвета исходящего сообщения Telegram в тёмной и светлой теме. */
.tg-bubble {
  display: block;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #182533;
  color: #f5f5f5;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14.5px;
  line-height: 1.42;
  font-style: italic;              /* бот пишет всё курсивом (настройка ui.italic_text) */
  overflow-wrap: anywhere;
}
:root[data-theme="light"] .tg-bubble { background: #ffffff; color: #0f1419; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.tg-bubble b, .tg-bubble strong { font-weight: 700; }
.tg-bubble code, .tg-bubble pre { font-family: var(--mono); font-style: normal; font-size: 13px; color: #7fd1ff; }
:root[data-theme="light"] .tg-bubble code { color: #1a73c9; }
.tg-bubble blockquote { margin: 4px 0; padding: 2px 0 2px 10px; border-left: 3px solid #64b5ef; }
.tg-bubble a { color: #6ab3f3; text-decoration: none; }
.tg-bubble--clamp { max-height: 8.6em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.tp-var {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: #9cc9ff;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}
:root[data-theme="light"] .tp-var { color: #1a5fb4; }
.tp-rule { display: block; height: 1px; margin: 6px 0; background: currentColor; opacity: 0.25; }

.tx-editor { display: grid; gap: 8px; }
.tx-editor__label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
/* ─── Аватар как в Telegram: цветной кружок с инициалами, поверх — фото профиля, если оно есть ─── */
.avatar--tone { border: 0; color: #fff; font-weight: 700; letter-spacing: 0.02em; text-transform: none;
  background: linear-gradient(180deg, var(--av1), var(--av2)); box-shadow: none; position: relative; overflow: hidden; }
.avatar--tone.avatar--photo { display: grid; place-items: center; box-shadow: none; }
.avatar--tone.avatar--photo::before { content: none; }
.avatar--tone .avatar__txt { display: grid; place-items: center; line-height: 1; }
.avatar--tone .avatar__txt svg { opacity: 0.95; }
.u-row .avatar--sm { width: 42px; height: 42px; font-size: 15px; }
.u-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.u-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--fg-3); background: var(--s-2); box-shadow: inset 0 0 0 1px var(--line); }
.u-tag--bad { color: #fff; background: color-mix(in srgb, var(--bad) 85%, transparent); box-shadow: none; }
.u-bal { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.u-row--off .row__title { opacity: 0.62; }
.u-row--off .avatar { filter: saturate(0.35); opacity: 0.8; }

.tx-editor__input { min-height: 180px; font-size: 13px; line-height: 1.5; }

/* ─── Редактор текста: превью прилипает к верху шторки — что бы ни листали (каталог, поле), вставленное видно ─── */
.tx-editor__stick {
  position: sticky; top: 0; z-index: 3;
  display: grid; gap: 6px; margin: 0 -18px; padding: 2px 18px 10px;
  /* Тот же слой, что у самой шторки: поверх неё он почти не отличается по цвету, а размытие прячет то, что
     проезжает под превью при прокрутке. Сплошной цвет давал тёмную полосу поперёк шторки. */
  background: var(--s-4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tx-editor__preview { max-height: 34vh; overflow-y: auto; overscroll-behavior: contain; }
.tg-sp { border-radius: 4px; background: color-mix(in srgb, currentColor 22%, transparent); }
.tx-caret {
  display: inline-block; width: 2px; height: 1.15em; margin: 0 1px; vertical-align: -0.2em;
  border-radius: 1px; background: var(--accent); animation: tx-blink 1s steps(1) infinite;
}
@keyframes tx-blink { 50% { opacity: 0; } }
.pe.tx-pop { animation: tx-pop 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes tx-pop { from { transform: scale(0.2); opacity: 0; } }

/* Панель оформления: «Эмодзи» подписана, остальное — значками в круглых кнопках; не влезла — листается вбок. */
.tx-tools { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.tx-tools::-webkit-scrollbar { display: none; }
.tx-tool {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 36px; height: 36px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line); background: var(--s-2); color: var(--fg-2);
  transition: background var(--fast, 0.15s), color var(--fast, 0.15s), transform var(--fast, 0.15s);
}
.tx-tool:active { transform: scale(0.92); }
.tx-tool--emo { width: auto; padding: 0 14px 0 11px; font-weight: 600; font-size: 13.5px; color: var(--fg); }
.tx-tool--on { background: var(--accent); border-color: transparent; color: #fff; }
.tx-tools__sep { flex: none; width: 1px; height: 22px; background: var(--line); }

/* Каталог эмодзи — прямо в шторке, под панелью: открыт, пока нужен; вставлять можно подряд. */
.tx-emo { display: grid; gap: 8px; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--s-2); }
.tx-emo[hidden] { display: none; }
.tx-emo__search { margin: 0; }
.tx-emo__body { max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; }
.tx-emo__group { margin: 6px 2px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.tx-emo__group:first-child { margin-top: 0; }
.tx-emo__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.tx-emo__tile {
  color: var(--fg);
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-width: 0;
  border-radius: 12px; border: 0; background: transparent; transition: background 0.15s, transform 0.15s;
}
.tx-emo__tile:hover { background: var(--s-2); }
.tx-emo__tile:active { transform: scale(0.86); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tx-emo__tile .pe { vertical-align: middle; }
.tx-emo__fb { font-size: 24px; line-height: 1; }
.tx-emo__raw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.tx-emo__note, .tx-emo__empty { margin: 0; font-size: 12px; color: var(--fg-3); text-align: center; }

.tx-editor__warn {
  margin: 0; padding: 8px 12px; border-radius: 12px; font-size: 12.5px;
  background: color-mix(in srgb, var(--bad, #ef4444) 14%, transparent); color: var(--bad, #ef4444);
}
.tx-editor__warn[hidden] { display: none; }
.tx-vars { display: grid; gap: 6px; }
.tx-vars__list { display: flex; flex-wrap: wrap; gap: 6px; }
.tx-var {
  padding: 5px 10px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: #9cc9ff;
  font-family: var(--mono); font-size: 12px;
}
:root[data-theme="light"] .tx-var { color: #1a5fb4; }
.tx-var:active { transform: scale(0.94); }

/* ─── «Фото»: картинка — кнопка загрузки; под ней название и два значка. Ничего не шире карточки ─── */
.hx-media { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .hx-media { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hx-media__card { grid-template-columns: minmax(0, 1fr); min-width: 0; padding: 8px 8px 10px; gap: 8px; border-radius: 20px; }
.hx-media__pic { display: block; width: 100%; min-width: 0; cursor: pointer; border-radius: 14px; }
.hx-media__pic img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; }
.hx-media__pic--empty { display: grid; place-items: center; border: 1px dashed var(--rx-line); color: var(--fg-3); }
.hx-media__pic--empty span { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.hx-media__pic:active { transform: scale(0.98); }
.hx-media__foot { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 2px; }
.hx-media__title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hx-media__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rx-line);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
}
.hx-media__icon--bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.hx-media__actions { display: none; }

/* ─── «Эмодзи»: плитки одной высоты, длинное название — в две строки ─── */
.hx-emoji-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
@media (min-width: 700px) { .hx-emoji-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hx-emoji-tile { align-content: start; min-width: 0; }
/* Свой значок и плитка «добавить» — рамкой, а не цветом: цвет в сетке значков спорил бы с самими значками. */
.hx-emoji-tile--own { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.hx-emoji-tile--add { border: 1px dashed var(--line); color: var(--fg-2); }
.hx-emoji-tile--add:hover { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
/* Быстрые вставки («•», «~») — те же кнопки панели, но со знаком вместо значка. */
.tx-tool--txt { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.tx-editor__about { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--fg-2); }
.hx-emoji-tile__title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ─── фильтр списка — одна кнопка «Показать: …» ─── */
.filter-bar { display: flex; justify-content: flex-start; margin: 2px 0 12px; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rx-line);
  background: var(--hx-surface, var(--card));
  color: var(--fg-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.25s var(--rx-ease);
}
.filter-pill b { color: var(--fg); font-weight: 700; }
.filter-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-pill:active { transform: scale(0.97); }
.filter-opt[aria-pressed="true"] .row__title { color: var(--accent); }

/* ─── люди: звёздочка Telegram Premium вместо плашки ─── */
.u-star { color: var(--warn); font-size: 0.85em; vertical-align: 0.05em; }

/* ─── тарифы: предупреждение и кнопки не слипаются ─── */
.notice + .btn-row, .section > .notice + .btn-row, .notice + .section { margin-top: 12px; }
.btn-row + .section, .btn-row + .section__head { margin-top: 18px; }

/* ─── Способы оплаты: по переключателю на каждый ─── */
/* ─── способы оплаты: вкладки «Свои / HEX», поставщик с главным переключателем, его способы под ним ─── */
/* ─── уведомления на телефон ─── */
.hx-push { display: grid; gap: 8px; margin-top: 14px; }
.hx-push__body { display: grid; gap: 10px; }
.hx-push__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--fg-2); }
.hx-push__text--ok { color: var(--ok); }
.hx-push__text--warn { color: var(--warn); }

.hx-pay { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.hx-pay .card__label { margin: 0; }
.hx-pay__tabs .seg__opt { flex: 1 1 0; justify-content: center; }
.hx-pay__pane { display: grid; gap: 8px; }
.hx-pay__pane[hidden], .hx-pay__note[hidden], .hx-pay__rule[hidden] { display: none; }
.hx-pay__prov {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--s-2);
  overflow: hidden;
  transition: border-color var(--mid), background var(--mid);
}
.hx-pay__prov.is-on { border-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.hx-pay__head { padding: 12px 14px; }
.hx-pay__head .hx-field__label { font-weight: 700; }
.hx-pay__note { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--warn); }
/* Раскрытие по высоте содержимого: grid 0fr → 1fr едет плавно, без подбора max-height на глаз. */
.hx-pay__sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--mid); }
.hx-pay__prov.is-on .hx-pay__sub { grid-template-rows: 1fr; }
.hx-pay__subin { min-height: 0; overflow: hidden; }
.hx-pay__prov:not(.is-on) .hx-pay__subin { visibility: hidden; transition: visibility 0s linear 260ms; }
.hx-pay__method { position: relative; padding: 10px 14px 10px 30px; border-top: 1px solid var(--line); }
.hx-pay__method::before {
  content: ""; position: absolute; left: 16px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--fg-3); transition: background var(--mid);
}
.hx-pay__method[aria-checked="true"]::before { background: var(--ok); }
.hx-pay__method .hx-field__label { font-size: 14px; }
.hx-pay__rule {
  margin: 0; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.4; color: var(--fg-2); background: var(--info-soft);
}
.hx-pay__rule[data-tone="ok"] { background: var(--ok-soft); }
.hx-pay__rule[data-tone="warn"] { background: var(--warn-soft); }
.hx-pay__rule[data-tone="bad"] { background: var(--bad-soft); }
@media (prefers-reduced-motion: reduce) { .hx-pay__sub, .hx-pay__prov { transition: none; } }
