:root {
  --bg: #0e0e10;
  --bg-elevated: #18181b;
  --bg-card: #1f1f22;
  --border: #2a2a2e;
  --border-strong: #3f3f46;
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-faint: #6f6f76;

  /* Фирменный серый из лого */
  --brand-grey: #a9adb4;
  --brand-grey-light: #c3c6cc;

  /* Единый лаймовый акцент из лого: приглушённо-оливковый -> сочный лайм */
  --accent-dark: #9bbb2a;
  --accent: #c6e838;
  --accent-light: #d7f26a;
  --accent-gradient: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
  --accent-text: #14170a;

  --danger: #e0555c;
  /* Деньги/успех — отдельный семантический зелёный, не путать с лаймовым акцентом */
  --success: #22c55e;
  --success-text: #f0fdf4;
  --warn: #dba43f;
  --info: var(--accent-light);

  --radius-lg: 24px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.24);
  --shadow-accent: 0 8px 20px rgba(198, 232, 56, 0.22);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 200ms var(--ease);
  --transition: 250ms var(--ease);

  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(198, 232, 56, 0.09), transparent 60%),
    radial-gradient(800px 560px at 100% 105%, rgba(169, 173, 180, 0.07), transparent 55%),
    var(--bg);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 8px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 0 18px;
}

.topbar__logo {
  display: block;
  height: 36px;
  width: auto;
}

.topbar__subtitle {
  color: var(--text-faint);
  font-size: 12px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fade-in 0.25s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 10px;
  font-weight: 700;
}

.inventory-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inventory-header .section-title {
  margin: 0 0 10px;
  flex: 1;
}

.inventory-header__total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--accent);
  white-space: nowrap;
  animation: total-pop 0.28s var(--ease);
}

@keyframes total-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--border-strong);
  color: var(--accent-light);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* ---------- Hero (главная) ---------- */

.hero {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 20px 26px;
  margin-bottom: 16px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
  line-height: 1.15;
}

.hero__subtitle {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.perks {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.perk {
  flex: 1;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition-fast);
}

.perk__icon {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.perk__icon svg {
  width: 22px;
  height: 22px;
}

.perk__label {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.3;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}

.step__text {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.45;
  padding-top: 3px;
}

.empty-state {
  text-align: center;
  padding: 40px 16px 28px;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-dim);
}

.empty-state__icon svg {
  width: 28px;
  height: 28px;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
}

.empty-state__text {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), opacity var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn__icon {
  display: inline-flex;
  flex: none;
}

.btn__icon svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--accent-text);
  border: none;
  box-shadow: var(--shadow-accent);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn[disabled]:active {
  transform: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  gap: 10px;
}

input[type='text'],
input[type='search'],
input[type='email'],
input[type='tel'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  min-height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 232, 56, 0.22);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
}

input::placeholder {
  color: var(--text-faint);
}

/* The native calendar icon defaults to a dark glyph in most WebViews —
   invisible against our dark inputs without this. */
input[type='datetime-local']::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field {
  margin-bottom: 12px;
}

.unlock-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.unlock-date-preset {
  flex: none;
  min-height: 32px;
  padding: 6px 12px;
}

.field:last-child {
  margin-bottom: 0;
}

/* Кастомный выпадающий список (замена нативного <select> — его системную
   выпадашку невозможно оформить под тёмную тему приложения). */
.custom-select {
  position: relative;
}

.custom-select__trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-select__trigger:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
}

.custom-select--open .custom-select__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 232, 56, 0.14);
}

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

.custom-select[data-value=""] .custom-select__value {
  color: var(--text-faint);
}

.custom-select__chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  transition: transform var(--transition-fast);
}

.custom-select--open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: 264px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
}

.custom-select__option {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
  background: rgba(198, 232, 56, 0.1);
}

.custom-select__option--selected {
  color: var(--accent);
  font-weight: 700;
}

.hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

.hint.warn {
  color: var(--warn);
}

.error-text {
  font-size: 13px;
  color: var(--danger);
  margin-top: 6px;
}

.link-inline {
  color: var(--accent-light);
  text-decoration: underline;
  word-break: break-all;
}

/* ---------- Продать: гейт (нет trade-ссылки / инвентарь закрыт) ---------- */

.sell-gate {
  text-align: center;
  padding: 30px 18px 26px;
}

.sell-gate__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
}

.sell-gate__icon svg {
  width: 26px;
  height: 26px;
}

.sell-gate__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.sell-gate__text {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 18px;
}

.sell-gate__or {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 14px 0 10px;
}

/* ---------- Продать: поиск/сортировка/выбор всех ---------- */

.inventory-toolbar {
  margin-bottom: 12px;
}

.inventory-search {
  margin-bottom: 8px;
}

.inventory-toolbar__row {
  display: flex;
  gap: 8px;
}

.chip-btn {
  flex: 1;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.chip-btn:hover,
.chip-btn:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip-btn:active {
  transform: scale(0.97);
}

.chip-btn--active {
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(198, 232, 56, 0.18);
}

.chip-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* ---------- Продать: сетка инвентаря ---------- */

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.inventory-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.inventory-item:active {
  border-color: var(--accent);
  transform: scale(0.97);
}

/* Trade-hold items are selectable like any other item (see app.js) — the
   lock badge on the thumbnail is the only visual marker, a dashed border
   makes the card itself distinguishable at a glance without looking
   disabled/unclickable. */
.inventory-item--locked {
  border-style: dashed;
}

.inventory-item--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 232, 56, 0.18);
}

.inventory-item__check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(198, 232, 56, 0.4);
}

.inventory-item__check svg {
  width: 12px;
  height: 12px;
}

/* ---------- Продать: плашка множественного выбора ---------- */

.selection-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 488px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 10px 10px 18px;
  box-shadow: var(--shadow-md);
  z-index: 16;
  animation: fade-in 0.2s var(--ease);
}

.selection-bar__count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

.selection-bar__btn {
  width: auto;
  min-height: 40px;
  padding: 10px 22px;
  font-size: 13px;
}

.inventory-item__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  overflow: hidden;
}

.inventory-item__lock {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(10, 9, 16, 0.75);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-item__lock svg {
  width: 12px;
  height: 12px;
}

.inventory-item__thumb svg {
  width: 26px;
  height: 26px;
}

.inventory-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inventory-item__name {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.inventory-item__exterior {
  font-size: 10px;
  color: var(--text-faint);
}

.inventory-item__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-light);
}

.inventory-item__price-loading {
  color: var(--text-faint);
  font-weight: 500;
}

.inventory-item__price-unknown {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 10.5px;
}

/* ---------- Цена ---------- */

.price-hero {
  position: relative;
  text-align: center;
  padding: 30px 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 12px;
}

.price-hero__badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.price-hero__badge svg {
  width: 24px;
  height: 24px;
}

.price-hero__item {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 10px;
}

.price-hero__value {
  font-family: var(--font-display);
  font-size: clamp(30px, 10.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--success);
}

.price-hero__unknown {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 8px 0;
}

.price-hero__note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

.breakdown-card {
  padding: 16px 18px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-dim);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row--total {
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 16px;
  padding-top: 12px;
}

.breakdown-row--total span:last-child {
  color: var(--success);
}

.price-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.price-item-row:last-child {
  border-bottom: none;
}

.price-item-row__name {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-item-row__value {
  font-weight: 600;
  flex-shrink: 0;
}

.price-item-row__value--unknown {
  color: var(--text-faint);
  font-weight: 500;
}

#confirm-amount {
  color: var(--success);
  font-weight: 700;
}

/* ---------- Способы получения (реквизиты) ---------- */

.method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.method-card--selected,
.method-card--recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 232, 56, 0.14);
}

.method-card--static {
  cursor: default;
}

.method-card__radio {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.method-card__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent-light);
}

.method-card__icon svg {
  width: 18px;
  height: 18px;
}

.method-card__body {
  flex: 1;
  min-width: 0;
}

.method-card__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.method-card__value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.method-card__tag {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-light);
  font-weight: 700;
}

/* ---------- Тип реквизита: плитки ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--pending {
  color: var(--warn);
  border-color: var(--warn);
}

.badge--confirmed,
.badge--awaiting_unlock,
.badge--trade_sent {
  color: var(--accent-light);
  border-color: var(--accent-light);
}

.badge--completed {
  color: var(--success);
  border-color: var(--success);
}

.badge--rejected {
  color: var(--danger);
  border-color: var(--danger);
}

.badge--disputed {
  color: var(--warn);
  border-color: var(--warn);
}

.deal-row {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: 8px;
}

.deal-row__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.deal-row__item {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.deal-row__meta {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
}

.deal-row__reason {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

/* ---------- Успех ---------- */

.success-hero {
  text-align: center;
  padding: 34px 16px 22px;
}

.success-hero__icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  margin: 0 auto 18px;
}

.success-hero__icon svg {
  width: 34px;
  height: 34px;
}

.success-hero__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
}

.success-hero__subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

.back-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  min-height: 44px;
  padding: 6px 4px 14px;
  margin: 0 -4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}

.back-link:active {
  color: var(--accent-light);
}

/* ---------- Профиль ---------- */

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-identity__avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.profile-identity__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.profile-identity__username {
  font-size: 12.5px;
  color: var(--text-faint);
}

.profile-identity__sold {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- Нижняя навигация ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.3);
  z-index: 15;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.bottom-nav__item:active {
  transform: scale(0.97);
}

.bottom-nav__icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
}

.bottom-nav__icon svg {
  width: 21px;
  height: 21px;
}

.bottom-nav__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bottom-nav__item.active {
  color: var(--accent-light);
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  max-width: 488px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--danger);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility 0s linear var(--transition);
  z-index: 20;
}

.toast.visible {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity var(--transition), transform var(--transition), visibility 0s;
}

.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* Plain SVG stroke circles, not a CSS mask/conic-gradient ring — some
   in-app WebViews (Telegram's Android browser included) render mask +
   conic-gradient combinations wrong, collapsing the whole thing into a
   flat bar instead of a ring. A rotating arc with rounded caps over a
   faint full track reads just as soft, with none of that risk. */
.spinner-icon {
  flex: none;
  width: 18px;
  height: 18px;
  transform-origin: 50% 50%;
  animation: spinner-spin 0.85s linear infinite;
}

.spinner-icon__track {
  fill: none;
  stroke: var(--border-strong);
}

.spinner-icon__arc {
  fill: none;
  stroke: var(--accent);
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Юридическая информация (оферта / политика) ---------- */

.legal-hub-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.legal-hub-card:hover,
.legal-hub-card:focus-visible {
  border-color: var(--border-strong);
}

.legal-hub-card__icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--accent);
}

.legal-hub-card__icon svg {
  width: 20px;
  height: 20px;
}

.legal-hub-card__body {
  flex: 1;
  min-width: 0;
}

.legal-hub-card__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 3px;
}

.legal-hub-card__text {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.4;
}

.legal-doc h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.legal-doc__updated {
  color: var(--text-faint);
  font-size: 12px;
  margin: 0 0 20px;
}

.legal-doc h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin: 22px 0 8px;
}

.legal-doc h2:first-of-type {
  margin-top: 0;
}

.legal-doc p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 10px;
}
