/* Proxima Nova — платный шрифт, файлы качать нельзя автоматически (нет
   доступа к внешним CDN из песочницы). Положи лицензионные файлы шрифта
   рядом со style.css (например static/fonts/ProximaNova-BlackItalic.woff2)
   и раскомментируй правило ниже — тогда .balance-label/.balance-value
   переключатся на него, сейчас у них жирный курсив на системном шрифте
   как временный fallback. */
/*
@font-face {
  font-family: "Proxima Nova";
  src: url("fonts/ProximaNova-BlackItalic.woff2") format("woff2"),
       url("fonts/ProximaNova-BlackItalic.woff") format("woff");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
*/

:root {
  --bg: #000000;
  --line: rgba(255, 255, 255, 0.075);
  --line-soft: rgba(255, 255, 255, 0.045);
  --text: rgba(255, 255, 255, 0.96);
  --text-soft: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.48);
  --faint: rgba(255, 255, 255, 0.3);
  --red: #ff385c;
  --accent: #ff385c;
  --accent-hover: #e02447;
  --accent-glow: rgba(255, 56, 92, 0.4);
  --accent-soft: rgba(255, 56, 92, 0.12);
  --green: #ff385c;
  --red: #ff404b;
  --radius: 22px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --page-x: 17px;
  --blur: blur(24px) saturate(145%);
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.48);
  --inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.004)), rgba(5, 5, 5, 0.93);
}

body.light-theme {
  --bg: #f1f1ef;
  --line: rgba(15, 15, 15, 0.09);
  --line-soft: rgba(15, 15, 15, 0.05);
  --text: rgba(10, 10, 10, 0.94);
  --text-soft: rgba(10, 10, 10, 0.72);
  --muted: rgba(10, 10, 10, 0.5);
  --faint: rgba(10, 10, 10, 0.32);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 246, 244, 0.96));
  --shadow-soft: 0 18px 40px rgba(20, 20, 20, 0.1);
  --inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); overflow-x: hidden; }

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -16%, rgba(255, 255, 255, 0.055), transparent 34%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 200ms ease, color 200ms ease;
}
body.light-theme { background: var(--bg); }

button, input { font: inherit; }
button { color: inherit; appearance: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 190ms cubic-bezier(.2,.8,.2,1); }
button:active { transform: scale(0.982); }
a { text-decoration: none; color: inherit; }

.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
}

.app {
  position: relative;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) var(--page-x) calc(120px + env(safe-area-inset-bottom));
}

.screen { display: none; }
.screen.active { display: block; animation: screen-in 320ms cubic-bezier(.16,.84,.22,1) both; }
@keyframes screen-in { from { opacity: 0; transform: translate3d(0,16px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }

/* ============ TOPBAR ============ */
.screen-topbar {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-mark { display: grid; gap: 2px; justify-self: start; background: none; border: 0; padding: 0; text-align: left; color: var(--text); }
.brand-main {
  display: block;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 850;
  letter-spacing: -0.06em;
  line-height: 0.92;
}
.brand-sub { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.02em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-action {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: var(--inset-light);
  color: var(--text-soft);
}
.topbar-action .icon svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: none; }
body.light-theme .theme-toggle .icon-moon { display: none; }
body.light-theme .theme-toggle .icon-sun { display: block; }

/* ============ SECTIONS ============ */
.screen-header { padding: 6px 4px 18px; }
.screen-title { margin: 0; color: var(--text); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.screen-subtitle { margin: 10px 0 0; max-width: 320px; color: var(--muted); font-size: 0.92rem; font-weight: 400; letter-spacing: -0.02em; line-height: 1.38; }

.section { margin-top: 30px; }
.section.compact { margin-top: 24px; }
.section-heading { margin-bottom: 4px; }
.section-title { margin: 0 0 14px; color: var(--muted); font-size: 0.84rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.plans-subtitle { margin: -6px 0 16px; font-size: 0.86rem; }

/* ============ BALANCE CARD ============ */
.home-hero { padding-top: 2px; }

.balance-card {
  position: relative;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass);
  box-shadow: var(--inset-light), var(--shadow-soft);
  isolation: isolate;
}
.balance-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 0%, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 46%);
  pointer-events: none;
}
body.light-theme .balance-card::after {
  background: radial-gradient(circle at 26% 0%, rgba(255, 255, 255, 0.85), transparent 40%);
}

.balance-card-content { position: relative; min-height: 210px; display: flex; flex-direction: column; justify-content: center; padding: 30px 28px 27px; }
.balance-label {
  display: block;
  margin: 0 0 16px;
  color: var(--text-soft);
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.balance-frame { display: flex; overflow: visible; }
.balance-value {
  margin: 0;
  color: var(--text);
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.7rem, 13vw, 3.7rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 0.9;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.balance-currency { margin-right: 0.05em; }
.balance-cents { margin-left: 0.12em; font-size: 0.4em; font-weight: 100; opacity: 0.88; }
.balance-id { display: block; margin-top: 16px; color: var(--faint); font-size: 0.84rem; font-weight: 300; letter-spacing: -0.01em; }

.profile-balance { margin-top: 16px; }
.profile-balance .balance-card,
.profile-balance .balance-card-content { min-height: 178px; }
.profile-balance .balance-value { font-size: clamp(2.4rem, 11.6vw, 3.15rem); }

/* ============ PROMO ============ */
.promo-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: var(--inset-light);
}
.promo-icon { display: flex; color: var(--muted); flex-shrink: 0; }
.promo-icon svg { width: 18px; height: 18px; }
.promo-row input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  /* >=16px — иначе iOS Safari зумит страницу при фокусе на инпуте, а после
     возврата масштаба position:fixed-элементы (нижнее меню) остаются сбитыми */
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.promo-row input::placeholder { color: var(--faint); }
.promo-apply {
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)), rgba(24, 24, 24, 0.95);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}
body.light-theme .promo-apply { background: linear-gradient(180deg, #1c1c1c, #0d0d0d); color: #fff; }

/* ============ QUICK ACTIONS ============ */
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-action {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: var(--inset-light);
  color: var(--muted);
  text-align: center;
}
.quick-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-soft); }
.quick-icon svg { width: 22px; height: 22px; }
.quick-label { font-size: 0.8rem; font-weight: 600; letter-spacing: -0.015em; color: var(--muted); }

/* ============ PRO / SUBSCRIPTION CARDS ============ */
.pro-card {
  position: relative;
  margin-bottom: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 255, 255, 0.08), transparent 28%),
    var(--glass);
  box-shadow: var(--inset-light), var(--shadow-soft);
  overflow: hidden;
}
.pro-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.pro-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.pro-badge svg { width: 21px; height: 21px; }
.pro-badge-ultimate { color: var(--green); border-color: rgba(255, 56, 92, 0.28); }
.pro-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  text-align: right;
  white-space: normal;
  line-height: 1.25;
  max-width: 58%;
}
.pro-status-ultimate { color: var(--green); border-color: rgba(255, 56, 92, 0.26); }

.pro-card h2 { margin: 0; color: var(--text); font-size: 2.3rem; font-weight: 850; letter-spacing: -0.06em; line-height: 0.92; }

.price-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.price-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.price-option strong { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
.price-option span { font-size: 0.76rem; color: var(--muted); }
.pro-card-ultimate .price-option { border-color: rgba(255, 56, 92, 0.18); }

.plan-features { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-features li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.87rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.pro-card-ultimate .plan-features li::before { background: var(--green); }

.plan-buy-group { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

/* ============ BUTTONS ============ */
.soft-button {
  min-height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.014)), rgba(20, 20, 20, 0.95);
  box-shadow: var(--inset-light), 0 15px 34px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}
body.light-theme .soft-button {
  background: linear-gradient(180deg, #1c1c1c, #0a0a0a);
  color: #fff;
  border-color: rgba(0, 0, 0, 0.06);
}
.ghost-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}
.ghost-button.wide { width: 100%; min-height: 48px; font-size: 0.9rem; }

/* ============ LIST / EMPTY STATE ============ */
.list-surface { display: grid; gap: 12px; }
.glass-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--glass); box-shadow: var(--inset-light), var(--shadow-soft); }
.glass-panel.list-surface { padding: 16px; }
.empty-state {
  padding: 26px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--inset-light);
  color: var(--faint);
  font-size: 0.86rem;
  text-align: center;
}

/* ============ PROFILE ============ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--inset-light);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
}
.profile-card-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-name { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.row-meta { font-size: 0.86rem; color: var(--muted); }

/* ============ PAYMENT METHODS / DEPOSIT ============ */
.payment-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.method-button {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--inset-light);
  color: var(--muted);
  text-align: center;
}
.method-button.selected { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
body.light-theme .method-button.selected { border-color: rgba(0, 0, 0, 0.2); }
.method-mark { width: 26px; height: 26px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text-soft); }
.method-mark svg { width: 18px; height: 18px; }
.method-name { font-size: 0.76rem; font-weight: 600; letter-spacing: -0.01em; }

.deposit-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); box-shadow: var(--inset-light); padding: 14px; }
.amount-input {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.amount-input input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.amount-input input::placeholder { color: var(--faint); }
.currency { font-size: 0.86rem; font-weight: 700; color: var(--muted); }
.summary { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); }
.summary-row strong { color: var(--text); font-weight: 700; }

/* ============ REFERRAL ============ */
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ref-stat { padding: 2px 4px; }
.ref-stat + .ref-stat { box-shadow: inset 1px 0 0 var(--line-soft); padding-left: 14px; }
.ref-stat span { display: block; font-size: 0.76rem; color: var(--muted); }
.ref-stat strong { display: block; margin-top: 6px; font-size: 1.1rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
.ref-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--line-soft);
  /* .ref-link — элемент CSS-грида (.list-surface { display:grid }). У грид-
     элементов min-width по умолчанию "auto" = ширина содержимого без
     переносов, поэтому трек раздувался под длинную ссылку ещё до того, как
     флекс ниже успевал её обрезать. min-width:0 снимает это ограничение. */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.ref-link span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; color: var(--muted); }
/* Кнопка "Скопировать" раньше не имела flex-shrink:0 — в узком флекс-ряду
   она могла сжаться уже своего текста, и текст вылезал за край экрана. */
.ref-link .ghost-button { flex-shrink: 0; }
/* Все ряды внутри .list-surface (grid) — та же защита на будущее, чтобы
   любой другой длинный текст в карточке не повторил этот баг. */
.glass-panel.list-surface > * { min-width: 0; }

/* ============ SETTINGS ROWS ============ */
.notification-setting, .language-setting, .channel-setting {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--inset-light);
  margin-bottom: 10px;
}
.notification-setting-icon, .language-setting-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--text-soft);
}
.notification-setting-icon svg, .language-setting-icon svg { width: 18px; height: 18px; }
.notification-setting-copy, .language-setting-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notification-setting-copy strong, .language-setting-copy strong { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.notification-setting-copy > span, .language-setting-copy > span { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

.notification-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}
.notification-toggle i { display: block; width: 30px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); position: relative; }
.notification-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 180ms ease; }
.notification-setting.is-enabled .notification-toggle { color: var(--text); }
.notification-setting.is-enabled .notification-toggle i { background: var(--green); }
.notification-setting.is-enabled .notification-toggle i::after { transform: translateX(12px); }

.language-segment { flex-shrink: 0; display: flex; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.language-segment button { border: none; background: none; color: var(--muted); font-size: 0.76rem; font-weight: 700; padding: 7px 12px; border-radius: 9px; }
.language-segment button.active { background: rgba(255, 255, 255, 0.14); color: var(--text); }
body.light-theme .language-segment button.active { background: #111; color: #fff; }

.channel-setting-arrow, .help-arrow { flex-shrink: 0; color: var(--faint); }
.channel-setting-arrow svg, .help-arrow svg { width: 16px; height: 16px; }

.channel-setting.urgent {
  border-color: rgba(255, 64, 75, 0.4);
  background: linear-gradient(180deg, rgba(255, 64, 75, 0.1), rgba(255, 64, 75, 0.02)), var(--glass);
  box-shadow: var(--inset-light), 0 0 0 1px rgba(255, 64, 75, 0.12);
}
.channel-setting.urgent .language-setting-icon { color: var(--red); }
.channel-setting.urgent strong { color: var(--red); }

.help-list { display: flex; flex-direction: column; gap: 10px; }
.help-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--inset-light);
}
.help-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--text-soft);
}
.help-icon svg { width: 18px; height: 18px; }
.help-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.help-title { font-size: 0.94rem; font-weight: 700; color: var(--text); }
.help-note { font-size: 0.78rem; color: var(--muted); }

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(300px, calc(100vw - 34px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--inset-light), 0 22px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: var(--blur);
  transform: translateX(-50%);
}
body.light-theme .bottom-nav { box-shadow: var(--inset-light), 0 22px 44px rgba(20,20,20,0.14); }
.nav-button {
  width: 100%;
  height: 56px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: transparent;
  color: var(--faint);
}
.nav-button .icon svg { width: 20px; height: 20px; }
.nav-label { font-size: 0.66rem; font-weight: 500; letter-spacing: -0.015em; }
.nav-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
body.light-theme .nav-button.active { background: rgba(0, 0, 0, 0.06); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(340px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: var(--inset-light), var(--shadow-soft);
  backdrop-filter: var(--blur);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 570;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.2,.8,.2,1);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 374px) {
  .balance-value { font-size: clamp(2.3rem, 12vw, 3.15rem); }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}

/* ============ PURCHASE "THANK YOU" MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 var(--page-x) calc(24px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.modal-overlay[hidden] { display: flex; } /* keep flex layout while fading out, JS toggles [hidden] after transition */
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--inset-light), var(--shadow-soft);
  backdrop-filter: var(--blur);
  text-align: center;
  transform: translate3d(0, 24px, 0);
  transition: transform 220ms cubic-bezier(.16,.84,.22,1);
}
.modal-overlay.visible .modal-card { transform: translate3d(0, 0, 0); }
.modal-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; }
.modal-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.modal-text { margin: 0 0 20px; font-size: 0.92rem; line-height: 1.4; color: var(--muted); }
.modal-card .soft-button.wide { margin-bottom: 10px; }


/* =====================================================================
   BOLVIYEV STOREFRONT: DEAL TYPES, CATEGORIES & PRODUCT CARDS
   ===================================================================== */

/* 2 Вида сделок: Покупка / Аренда */
.deal-type-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: 14px 0 16px;
  gap: 4px;
}
.deal-type-btn {
  flex: 1;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-pill);
  text-align: center;
  background: transparent;
  color: var(--muted);
  transition: all 200ms cubic-bezier(.2,.8,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.deal-type-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* Баннер активной категории */
.category-hero-banner {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  background: #000;
}
.category-hero-banner img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 200ms ease;
}

/* 3 Подтемы (Категории): NFT-username, NFT-Подарки, Удалённые подарки */
.categories-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.categories-bar::-webkit-scrollbar { display: none; }
.category-chip {
  white-space: nowrap;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-soft);
  transition: all 180ms ease;
}
.category-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 56, 92, 0.2);
}

/* Сетка карточек товаров (По примеру пользователя: Image 1) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 340px) {
  .products-grid { grid-template-columns: 1fr; }
}

.product-card {
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.product-card:hover {
  border-color: rgba(255, 56, 92, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.product-card:active {
  transform: scale(0.985);
}

/* Фото / превью товара */
.product-thumb-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #151515;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}
.product-card:hover .product-thumb {
  transform: scale(1.05);
}

.product-badge-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.product-price-box {
  margin-bottom: 12px;
}
.product-price {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.product-price-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

/* Кнопка действия (Купить / Арендовать в стиле Image 1) */
.product-action-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: #171717;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  transition: all 180ms ease;
}
.product-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.product-action-btn:hover,
.product-action-btn:active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* Модальное окно покупки/аренды */
.order-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  text-align: left;
}
.order-modal-thumb {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.order-modal-info {
  flex: 1;
}
.order-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}
.order-modal-cat {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.order-modal-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.order-days-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.order-days-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.order-day-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.order-day-count {
  font-size: 16px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Дополнительные стили для витрины NFT & Gifts Market */
.catalog-section {
  margin-top: 10px;
}
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.deal-type-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 4px;
  margin-bottom: 16px;
}
.deal-type-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 160ms ease;
  text-align: center;
}
.deal-type-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.trust-banner {
  background: linear-gradient(135deg, rgba(255, 56, 92, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 56, 92, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.trust-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.trust-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.trust-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* User Orders list in Profile */
.user-order-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.user-order-thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}
.user-order-info {
  flex: 1;
  min-width: 0;
}
.user-order-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.user-order-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-status {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
}
.badge-status.pending { background: rgba(255, 180, 34, 0.15); color: #ffb422; }
.badge-status.completed { background: rgba(43, 214, 111, 0.15); color: #2bd66f; }
.badge-status.processing { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-status.cancelled { background: rgba(255, 56, 92, 0.15); color: #ff385c; }

