/* Узел Design System – Root Styles Entry Point */

/* Global CSS custom properties and foundational styles */

/* ========== IMPORTS ========== */
@import url("tokens/fonts.css");
@import url("tokens/colors.css");
@import url("tokens/typography.css");
@import url("tokens/spacing.css");
@import url("tokens/shadows.css");

/* ========== GLOBAL RESET & BASE STYLES ========== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  font-weight: var(--weight-regular);
  line-height: var(--line-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base),
              color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHY BASE ========== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--line-display);
  letter-spacing: var(--letter-tight);
  word-spacing: var(--word-display);  /* #1203 */
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

h1 {
  font-size: var(--size-display-xl);
}

h2 {
  font-size: var(--size-display-lg);
}

h3 {
  font-size: var(--size-lg);
}

h4 {
  font-size: var(--size-md);
}

h5, h6 {
  font-size: var(--size-base);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--line-body);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

strong, b {
  font-weight: var(--weight-bold);
}

em, i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  background-color: var(--bg-secondary);
  padding: 0.25em 0.5em;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

pre {
  background-color: var(--bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-6);
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* ========== FORM ELEMENTS (Base) ========== */

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--size-base);
  color: var(--text-primary);
  background-color: var(--surface-inset);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-base);
  padding: var(--padding-input-y) var(--padding-input-x);
  box-shadow: var(--shadow-inset-sm);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              background-color var(--transition-base);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-secondary);
  background-color: var(--surface-hover);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-focus);
  background-color: var(--surface-default);
}

input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--surface-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
  /* 2026-07-17: opacity:0.6 поверх уже приглушённых surface-disabled/text-disabled
     токенов — двойное затемнение, особенно заметное в тёмной теме. Токены сами
     по себе уже несут нужную приглушённость. */
}

/* ========== BUTTONS (Base) ========== */

button {
  font-family: var(--font-body);
  font-size: var(--size-sm);
  font-weight: var(--weight-bold);
  line-height: var(--line-lg);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--padding-button-y) var(--padding-button-x);
  transition: box-shadow var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  white-space: nowrap;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--bevel-raised);
}

button:active:not(:disabled) {
  box-shadow: var(--bevel-pressed);
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== LISTS ========== */

ul, ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* ========== TABLES ========== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
}

th, td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

th {
  font-weight: var(--weight-semibold);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

tr:hover {
  background-color: var(--bg-secondary);
}

/* ========== UTILITY CLASSES ========== */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

/* Grid utilities */
.grid {
  display: grid;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Visibility utilities */
.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========== RESPONSIVE HELPERS ========== */

@media (max-width: 767px) {
  .hidden-mobile {
    display: none;
  }
}

@media (min-width: 768px) {
  .hidden-desktop {
    display: none;
  }
}

/* Prevent layout shift from scrollbar. Раньше был overflow-y: scroll — форсировал
   скроллбар всегда, что (1) на некоторых рендерерах сжимало body на ширину полосы и
   порождало горизонтальное переполнение, (2) не нужно на мобильных (overlay-scrollbar).
   scrollbar-gutter: stable резервирует место под скроллбар без его принудительного
   показа — тот же анти-прыжок-контента, без побочных эффектов. */
html {
  scrollbar-gutter: stable;
}

/* #485, пункт «100vh вместо 100dvh». Экраны-оболочки задают min-height, чтобы футер
   не всплывал на короткой странице. На iOS 100vh считается по БОЛЬШОМУ вьюпорту (с
   убранной адресной строкой), поэтому при видимой панели браузера оболочка выше
   стекла и страница скроллится там, где скроллить нечего. 100dvh — фактическая
   высота прямо сейчас. Порядок объявлений и есть фолбэк: браузер без dvh
   (Safari < 15.4, Chrome < 108) вторую строку не понимает и остаётся на 100vh.
   Класс, а не inline-стиль: React в объекте стиля двух одноимённых ключей не
   допускает, а без фолбэка правка была бы регрессом для старых браузеров. */
.uzel-screen {
  min-height: 100vh;
  min-height: 100dvh;
}

/* #485, пункт «backdrop-filter без фолбэка». Замер 05.08: у header и BottomNav
   computed backdrop-filter = blur(8px), -webkit-формы нет вовсе — React печатает из
   объекта стиля только неprefixed-свойство, а Safari понимает его лишь с 18.0. На
   iOS 17 и старше (и в Firefox < 103) размытия не было, и под полупрозрачной
   подложкой (--overlay-light, альфа 0.85) сквозь шапку просвечивал уезжающий текст.
   Префикс добавлен прямо в стилях узлов, а этот блок закрывает случай, когда блюра
   нет ВООБЩЕ: подложка становится непрозрачной, и просвечивать нечему. */
.uzel-blur-bar {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .uzel-blur-bar {
    background: var(--surface-default);
  }
}

/* ===== Хэдер 2026-07-16: меню профиля (fan-анимация) + оверлей новостей ===== */
.uzel-menu-fan { animation: uzel-menu-in .16s ease both; }
.uzel-menu-fan > * { animation: uzel-fan .26s both cubic-bezier(.2, .8, .2, 1); }
.uzel-menu-fan > *:nth-child(1) { animation-delay: .02s; }
.uzel-menu-fan > *:nth-child(2) { animation-delay: .06s; }
.uzel-menu-fan > *:nth-child(3) { animation-delay: .10s; }
.uzel-menu-fan > *:nth-child(4) { animation-delay: .14s; }
@keyframes uzel-menu-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes uzel-fan { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes uzel-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes uzel-pop { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }

/* Минималистичный скролл в оверлее новостей */
.uzel-scroll-y { scrollbar-width: thin; scrollbar-color: var(--border-primary) transparent; }
.uzel-scroll-y::-webkit-scrollbar { width: 8px; }
.uzel-scroll-y::-webkit-scrollbar-track { background: transparent; }
.uzel-scroll-y::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 99px; }
.uzel-scroll-y::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* issue #517: тот же минимализм для СТРАНИЦЫ целиком (сайт и админка через общий
   styles.css) — раньше стилилась только пара внутренних блоков (.uzel-scroll-y),
   а системный скролл document/admin.html оставался чужеродной светлой полосой
   поверх тёмной темы. */
html { scrollbar-width: thin; scrollbar-color: var(--border-primary) transparent; }
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 99px; }
html::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* issue #421: раньше здесь гасилась ОДНА анимация из шести — только веер меню.
   Живыми оставались бесконечный uzel-spin (спиннер загрузки), uzel-fade-in-down у
   баннера платежа, uzel-pop и uzel-fade у модалок и плавная прокрутка страницы.
   Человек, попросивший систему убрать движение, просил про всё движение сразу.
   Правило общее и по месту: перечисление имён анимаций уже один раз отстало от
   кода — следующая добавленная анимация снова осталась бы живой.
   iteration-count:1 нужен отдельно от duration: бесконечная анимация с нулевой
   длительностью иначе продолжает перезапускаться. Ноль не ставим — событие
   animationend/transitionend при нулевой длительности не приходит, а на нём в
   проекте держатся снятия временных классов. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Плашка ожидания в чеке (issue #624) ────────────────────────────────────
   Владелец 19.08.2026: цены приходят с сервера, и экран между запросом и
   ответом «гулял, прыгал, моргал». Плашка занимает место будущего числа, а по
   ней идёт блик — тот же приём, что у банков.

   Свет доведён до полной плотности поверхности (владелец: «свет чуть ярче»):
   на тёплом фоне полупрозрачный блик читался как грязь, а не как свет.

   Общий блок prefers-reduced-motion выше глушит анимацию до 0.01ms, поэтому
   отдельного правила здесь не нужно: остаётся ровная плашка без движения. */
.uzel-skeleton {
  position: relative;
  overflow: hidden;
}
.uzel-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 10%,
    color-mix(in srgb, var(--surface-raised) 92%, #fff) 50%,
    transparent 90%);
  transform: translateX(-100%);
  animation: uzel-skeleton-run 1.25s ease-in-out infinite;
}
@keyframes uzel-skeleton-run {
  to { transform: translateX(120%); }
}

/* ── Подтверждение копирования (разбор владельца 20.08.2026) ─────────────────
   Было: слово «Скопировано» вставало ВНУТРЬ кнопки — она прыгала в ширину,
   толкая ссылку рядом, появлялась и исчезала рывком.

   Стало: значок меняется на галочку (это и есть главное подтверждение), а слово
   всплывает подписью НАД кнопкой, вне потока, и гаснет плавно. Никто ничего не
   двигает; пропадает подпись сама, по таймеру кнопки.

   aria-hidden на подписи не случайно: состояние кнопки читается скринридером по
   её собственному тексту, а дубль читался бы дважды. */
.uzel-copied {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: normal;
  text-transform: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.uzel-copied.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Подсветка карточки после покупки (#653) ────────────────────────────────
   Решение владельца 20.08.2026 — вариант В3: успех любой покупки сообщается
   ОДНОЙ плашкой на «Подписке», той же, что у платежа картой. Плашка говорит,
   что произошло, а подсветка — ГДЕ это видно: взгляд после чтения плашки идёт
   на карточку состояния, и она коротко берёт акцент, а не мигает цветом.

   Обводкой, а не фоном: фон карточки несёт состояние подписки (активна/истекла),
   и перекрашивать его на полсекунды значит на полсекунды соврать о состоянии.

   Гасится общим блоком prefers-reduced-motion выше — своего правила не нужно. */
@keyframes uzel-flash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-primary) 55%, transparent); }
  35%  { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-primary) 38%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-primary) 0%, transparent); }
}
.uzel-flash { animation: uzel-flash 1.1s ease-out 1; border-radius: inherit; }

/* ── Свечение развёрнутого работающего протокола (issue #863, п.2.9) ────────
   Персистентное, не одноразовое, как uzel-flash выше — держится, пока блок
   открыт И профиль реально активен, гаснет вместе с ними. Обводка + мягкий
   внешний ореол, не заливка фона: карточка уже несёт состояние подписки
   цветом фона, второй смысл на том же канале не нужен. */
.uzel-glow {
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--feedback-success) 55%, transparent),
    0 0 12px 1px color-mix(in srgb, var(--feedback-success) 30%, transparent);
  border-radius: inherit;
}

/* ── Экран устройства (#1434, #1435). Классы, а не инлайн: раскладка меняется по ширине. ── */
.cx { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.cx-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.cx button { text-transform: none; letter-spacing: normal; white-space: normal; box-shadow: none; padding: 0;
  min-height: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; justify-content: flex-start; }
.cx-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-tertiary); margin: 0 2px 6px; }
.cx-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
  border-radius: 16px; background: var(--surface-inset); }
.cx .cx-tab { display: flex; align-items: center; gap: 9px; padding: 9px 10px; min-height: 58px; border-radius: 12px;
  text-align: left; color: var(--text-secondary); }
.cx-tab b { display: block; font-size: 14.5px; line-height: 1.2; }
.cx-tab small { display: block; font-size: 12px; line-height: 1.25; margin-top: 2px; }
.cx .cx-tab.on { background: var(--surface-raised); color: var(--text-primary);
  box-shadow: var(--bevel-raised), 0 2px 6px rgba(var(--shadow-ink), .14); }
.cx-tab.on svg { color: var(--accent-primary); }
.cx-apps { display: grid; grid-template-columns: repeat(var(--cx-n, 4), minmax(0, 1fr)); gap: 8px; }
.cx .cx-app { position: relative; display: grid; justify-content: stretch; justify-items: center; gap: 6px; padding: 12px 2px 9px; min-width: 0;
  border-radius: 16px; background: var(--surface-default); border: 1.5px solid var(--border-primary);
  font-size: 12px; font-weight: 700; text-align: center; }
.cx-app-sub { display: none; }
.cx .cx-app.on, .cx .cx-chip.on { border-color: var(--accent-primary); background: var(--surface-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent); }
.cx-ok { position: absolute; top: -6px; right: -5px; width: 20px; height: 20px; border-radius: 50%; display: grid;
  place-items: center; background: var(--accent-primary); color: var(--text-on-accent); }
.cx-logo { display: block; width: 42px; height: 42px; border-radius: 11px; object-fit: cover; flex: none;
  box-shadow: 0 1px 3px rgba(var(--shadow-ink), .25); }
.cx-logo.lg { width: 56px; height: 56px; border-radius: 14px; }
.cx-pill { display: inline-flex !important; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 11px !important;
  border-radius: 999px; background: var(--surface-default) !important; border: 1px solid var(--border-primary) !important;
  color: var(--text-primary) !important; font-size: 13.5px !important; font-weight: 700 !important; white-space: nowrap !important; }
.cx-card { background: var(--surface-raised); border: 1px solid var(--border-primary); border-radius: 20px; padding: 14px;
  box-shadow: var(--bevel-raised), 0 4px 14px rgba(var(--shadow-ink), .10); min-width: 0; }
.cx-head { display: flex; align-items: center; gap: 12px; }
.cx-head h3 { font: 700 18px var(--font-display); margin: 0; }
.cx-head small { display: block; font-size: 13px; color: var(--text-tertiary); }
.cx-head > :last-child:not(:first-child):not(div) { margin-left: auto; align-self: flex-start; }
.cx-tag { margin-left: auto; align-self: flex-start; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: var(--accent-secondary-active); background: color-mix(in srgb, var(--accent-secondary) 15%, transparent); }
.cx-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 13px; }
.cx-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cx .cx-b, a.cx-b { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 4px 8px;
  border-radius: 14px; font-size: 14.5px; font-weight: 700; text-align: center; text-decoration: none; }
.cx .cx-b.p, a.cx-b.p { background: var(--accent-primary); color: var(--text-on-accent);
  box-shadow: var(--bevel-accent), 0 3px 10px rgba(var(--shadow-ink), .24); }
.cx .cx-b.s, a.cx-b.s { background: var(--surface-default); color: var(--text-primary); border: 1px solid var(--border-primary); }
.cx .cx-b.d, a.cx-b.d { background: color-mix(in srgb, var(--feedback-success) 13%, transparent); color: var(--accent-secondary-active); }
.cx .cx-b[disabled] { opacity: .55; cursor: default; }
.cx-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 4px 4px 4px 12px; border-radius: 14px;
  background: var(--surface-inset); }
.cx-key code { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 500 12.5px var(--font-mono); color: var(--text-secondary); background: none; padding: 0; }
.cx .cx-ib, .cx-key > button { display: inline-flex !important; align-items: center !important; justify-content: center !important; flex: none; width: 40px !important; height: 40px !important;
  min-width: 40px !important; min-height: 40px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important;
  background: var(--surface-raised) !important; box-shadow: var(--bevel-raised) !important; color: var(--text-primary) !important; }
.cx-qr { display: none; }
.cx-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-size: 14px; font-weight: 700;
  background: var(--surface-default); border: 1px solid var(--border-primary); }
.cx-status small { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-tertiary); }
.cx-status a { color: var(--accent-primary); font-weight: 700; text-decoration: none; }
.cx-status.ok { background: color-mix(in srgb, var(--feedback-success) 12%, var(--surface-default));
  border-color: color-mix(in srgb, var(--feedback-success) 40%, transparent); }
.cx-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-disabled); }
.cx-dot.w { background: var(--feedback-warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--feedback-warning) 22%, transparent); }
.cx-dot.g { background: var(--feedback-success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--feedback-success) 22%, transparent); }
.cx-chips { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 5px; margin: -3px -2px -5px; scrollbar-width: none; }
.cx .cx-chip { flex: none; display: flex; align-items: center; gap: 7px; height: 46px; padding: 0 13px; border-radius: 14px;
  background: var(--surface-default); border: 1.5px solid var(--border-primary); font-size: 14px; font-weight: 700; white-space: nowrap; }
.cx .cx-chip.add { width: 46px; padding: 0; justify-content: center; border-style: dashed; color: var(--text-secondary); }
.cx-chip-add-text { display: none; }
.cx-chip-name { flex: 1; text-align: left; }
.cx-manage { padding: 2px 14px; }
.cx .cx-manage-head { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px;
  font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.cx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border-primary); }
.cx-row-t { flex: 1 1 150px; min-width: 0; }
.cx-row-t b { display: block; font-size: 14.5px; }
.cx-row-t small { display: block; font-size: 12.5px; color: var(--text-tertiary); }
.cx-row.end { justify-content: flex-end; }
.cx .cx-tb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 11px;
  background: var(--surface-default); border: 1px solid var(--border-primary); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.cx .cx-tb.r { color: var(--feedback-error); border-color: color-mix(in srgb, var(--feedback-error) 35%, var(--border-primary)); }
.cx-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 13.5px;
  background: var(--surface-inset); color: var(--text-secondary); }
.cx-note a { color: var(--accent-primary); font-weight: 600; }
.cx-dev { display: flex; align-items: center; gap: 12px; position: relative; }
.cx-dev-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-default); border: 1px solid var(--border-primary); color: var(--text-secondary); }
.cx-dev button { box-shadow: none; text-transform: none; letter-spacing: normal; }
.cx-dev h2 { font: 700 21px var(--font-display); margin: 0; }
.cx-dev-name { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cx-dev-sub { font-size: 13px; color: var(--text-tertiary); }
.cx-menu { margin-left: auto; position: relative; flex: none; }
.cx-menu-list { position: absolute; right: 0; top: 44px; z-index: 30; width: 220px; padding: 6px; border-radius: 14px;
  background: var(--surface-default); border: 1px solid var(--border-primary); box-shadow: 0 12px 30px rgba(var(--shadow-ink), .25); }
.cx-menu-list button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px;
  border: 0; border-radius: 9px; background: none; font-size: 14px; color: var(--text-primary); cursor: pointer; }
.cx-menu-list button:hover { background: var(--surface-hover); }
.cx-menu-list .r { color: var(--feedback-error); }
.cx-menu-shade { position: fixed; inset: 0; z-index: 29; }
@media (max-width: 350px) {
  .cx-tab svg, .cx-acts .cx-b svg { display: none; }
  .cx-dev h2 { font-size: 18px; }
  .cx .cx-b, a.cx-b { font-size: 13.5px; }
}
@media (min-width: 900px) {
  .cx { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; margin-top: 24px; }
  .cx-col { gap: 20px; }
  .cx-col.right { gap: 12px; }
  .cx-tabs { grid-auto-flow: row; padding: 0; gap: 8px; background: none; }
  .cx .cx-tab { padding: 10px 12px; border-radius: 16px; border: 1.5px solid var(--border-primary); background: var(--surface-default); }
  .cx .cx-tab.on { border-color: var(--accent-primary); background: var(--surface-raised);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent); }
  .cx-apps { grid-template-columns: minmax(0, 1fr); }
  .cx .cx-app { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 14.5px; text-align: left; }
  .cx-app-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-tertiary); }
  .cx-ok { right: -6px; }
  .cx-chips { display: grid; overflow: visible; margin: 0; padding: 0; }
  .cx .cx-chip { width: 100%; }
  .cx .cx-chip.add { width: 100%; gap: 8px; font-size: 13.5px; }
  .cx-chip-add-text { display: inline; }
  .cx-card { padding: 16px; }
  .cx-body.withqr { grid-template-columns: minmax(0, 1fr) 188px; }
  .cx-body.withqr .cx-acts { grid-template-columns: minmax(0, 1fr); }
  .cx-qr { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 10px; border-radius: 16px; text-align: center;
    font-size: 12.5px; color: var(--text-secondary); background: var(--surface-inset); }
  .cx-key .qrbtn { display: none !important; }
  .cx-acts .cx-b { min-height: 52px; }
}
