@font-face {
  font-family: 'Rooftop';
  src: url('/fonts/rooftop-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rooftop';
  src: url('/fonts/rooftop-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Halvar';
  src: url('/fonts/halvar-extrabold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0b;
  --panel: #161616;
  --panel-2: #1e1e1e;
  --white: #ffffff;
  --ink: #101010;
  --muted: #8f8f8f;
  --muted-ink: #6d6d6d;
  --green: #b8ff3d;
  --green-dark: #9be61f;
  --blue: #45c8ff;
  --pink: #ff5aa8;
  --yellow: #ffe14d;
  --line: #ececec;
  --line-dark: #2a2a2a;
  --radius: 24px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .28);
  --font-body: 'Rooftop', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Halvar', 'Rooftop', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { background: #000; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  border-left: 1px solid #181818;
  border-right: 1px solid #181818;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 11, 11, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.brand-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  color: #cfcfcf;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.balance-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: #1d1d1d;
  border: 1px solid #2c2c2c;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.balance-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(184,255,61,.7); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- layout ---------- */
.view {
  padding: 10px 16px calc(104px + env(safe-area-inset-bottom));
  min-height: 70vh;
}
.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e4e4e4;
  border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { padding: 14px 2px 20px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}
.eyebrow .sq { width: 6px; height: 6px; background: var(--green); border-radius: 2px; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 42px);
  line-height: .95;
  font-weight: 800;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.page-sub { margin-top: 11px; color: var(--muted); font-size: 15px; line-height: 1.4; max-width: 380px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 2px 12px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: #fff;
}
.section-head span { font-size: 12px; color: var(--muted); }
.section-head button { font-size: 12px; font-weight: 500; color: var(--green); }

/* ---------- products ---------- */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card {
  position: relative;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 18px 16px 16px;
  min-height: 186px;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease;
  overflow: hidden;
}
.product-card:active { transform: scale(.975); }
.product-card .gb { display: flex; align-items: baseline; gap: 5px; margin-top: 4px; }
.product-card .gb b {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .82;
}
.product-card .gb span { font-size: 14px; font-weight: 500; color: #777; }
.product-card .name { margin-top: 10px; font-size: 12px; font-weight: 400; color: #888; }
.product-card .price-row {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  padding-top: 18px;
}
.product-card .price {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.product-card .plus {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.product-card.featured {
  grid-column: span 2;
  min-height: 150px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  column-gap: 16px;
  background: var(--ink);
  color: #fff;
}
.product-card.featured .gb b { font-size: 64px; color: var(--green); }
.product-card.featured .gb span { color: rgba(255,255,255,.5); }
.product-card.featured .name { display: none; }
.product-card.featured .price-row {
  margin: 0;
  padding: 0;
  justify-self: end;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.product-card.featured .price { color: #fff; font-size: 24px; }
.product-card.featured .plus { background: var(--green); color: var(--ink); }

/* ---------- p2p banner ---------- */
.p2p-banner {
  margin-top: 24px;
  border-radius: 28px;
  background: var(--green);
  color: var(--ink);
  padding: 24px 22px;
}
.p2p-banner .banner-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(16,16,16,.6);
}
.p2p-banner h2 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 36px;
  line-height: .92;
  font-weight: 800;
  letter-spacing: -.03em;
  text-transform: uppercase;
  max-width: 300px;
}
.p2p-banner p { margin-top: 10px; font-size: 14px; line-height: 1.4; color: rgba(16,16,16,.7); max-width: 300px; }
.p2p-banner button {
  margin-top: 18px;
  height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ---------- p2p filters ---------- */
.p2p-safe { margin: -8px 2px 14px; font-size: 12px; line-height: 1.4; color: var(--muted); }

.p2p-filters {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #252525;
  border-radius: 20px;
  background: #131313;
}
.p2p-search,
.p2p-filter-row input,
.p2p-filter-row select {
  width: 100%;
  height: 44px;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  background: #1b1b1b;
  color: #fff;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 400;
  outline: none;
}
.p2p-search::placeholder,
.p2p-filter-row input::placeholder { color: #777; }
.p2p-search:focus,
.p2p-filter-row input:focus,
.p2p-filter-row select:focus { border-color: var(--green); }
.p2p-search::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }

.p2p-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  background: #1b1b1b;
}
.p2p-seg button {
  height: 34px;
  border-radius: 9px;
  color: #999;
  font-size: 12px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.p2p-seg button.active { background: var(--green); color: var(--ink); }
.p2p-seg button:active { color: #fff; }
.p2p-seg button.active:active { color: var(--ink); }

.p2p-filter-row { display: grid; grid-template-columns: minmax(86px, .7fr) minmax(0, 1.3fr); gap: 8px; }
.p2p-filter-row select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f8f8f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.p2p-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 2px 10px;
  font-size: 12px;
  color: var(--muted);
}
.p2p-results-bar button { font-size: 12px; font-weight: 500; color: var(--green); }
.p2p-empty { padding: 34px 18px; }

/* ---------- listings ---------- */
.listing {
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 10px;
}
.listing-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seller { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seller .ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--green);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 34px;
}
.seller b { font-size: 14px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seller span { font-size: 11px; color: #999; font-weight: 400; }
.listing .op {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f0f0f0;
}
.listing-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 12px; }
.listing-price b {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}
.listing-price span {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #999;
}
.listing-amount { text-align: right; }
.listing-amount b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1; }
.listing-amount span { display: block; margin-top: 5px; font-size: 10px; font-weight: 500; color: #999; }
.listing-desc { font-size: 12px; color: #777; line-height: 1.4; margin-bottom: 12px; }
.listing .btn-buy {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.listing .btn-buy:active { background: #000; }
.listing.own { border: 1.5px dashed #cfcfcf; }

.pkg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.pkg-chips span {
  padding: 6px 9px;
  border-radius: 9px;
  background: #f2f2f2;
  font-size: 11px;
  font-weight: 500;
  color: #555;
}
.pkg-min { margin: -2px 0 12px; font-size: 11px; line-height: 1.4; color: #777; }
.pkg-min b { color: var(--ink); font-weight: 500; }

.own-listing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
}
.own-listing b { display: block; font-size: 14px; font-weight: 500; }
.own-listing span { display: block; margin-top: 2px; font-size: 11px; color: #999; }
.own-listing .btn.small { width: auto; height: 36px; padding: 0 12px; flex: 0 0 auto; }

.p2p-sell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed #2e2e2e;
  border-radius: 16px;
  background: #121212;
  color: #fff;
  text-align: left;
}
.p2p-sell span { font-size: 13px; font-weight: 500; }
.p2p-sell small { font-size: 11px; color: var(--muted); }
.p2p-sell:active { border-color: var(--green); }
.pkg-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pkg-option {
  min-height: 64px;
  border-radius: 14px;
  border: 1.5px solid #e9e9e9;
  background: #f7f7f7;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.pkg-option b { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.pkg-option span { font-size: 11px; color: #777; }
.pkg-option.active { border-color: #111; background: var(--green); }
.pkg-option.active span { color: rgba(16,16,16,.65); }

.mode-switch { display: flex; gap: 4px; background: #f1f1f1; border-radius: 14px; padding: 4px; }
.mode-switch button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #888;
}
.mode-switch button.active { background: var(--ink); color: #fff; }

.pkg-editor { display: grid; gap: 8px; }
.pkg-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 8px; align-items: end; }
.pkg-row .field label { font-size: 9px; }
.pkg-row .field input { height: 48px; }
.pkg-remove {
  width: 38px;
  height: 48px;
  border-radius: 12px;
  background: #f1f1f1;
  color: #888;
  font-size: 22px;
  line-height: 1;
}

.pay-list { display: grid; gap: 8px; }
.pay-item {
  width: 100%;
  min-height: 58px;
  border-radius: 15px;
  background: #f5f5f5;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #111;
}
.pay-item .sub { margin-left: auto; font-size: 11px; font-weight: 400; color: #999; }
.pay-item .chev { width: 14px; height: 14px; fill: #aaa; }
.pay-item.disabled { opacity: .55; }
.pay-item.disabled .sub { color: #777; }

/* ---------- orders ---------- */
.segment {
  display: flex;
  gap: 4px;
  background: #1a1a1a;
  border: 1px solid #262626;
  border-radius: 14px;
  padding: 4px;
  margin: 4px 0 16px;
}
.segment button {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8f8f8f;
}
.segment button.active { background: var(--green); color: var(--ink); }

.order-card {
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 10px;
}
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-id { font-size: 11px; font-weight: 500; letter-spacing: .06em; color: #999; text-transform: uppercase; }
.order-title { margin-top: 7px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.order-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 13px; color: #666; }
.order-line b { color: var(--ink); font-weight: 500; }
.order-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.order-actions button {
  flex: 1 1 30%;
  min-width: 0;
  height: 42px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: #f1f1f1;
  color: #111;
}
.order-actions button.primary { background: var(--ink); color: #fff; }
.order-actions button.danger { background: #ffe9f2; color: #c2185b; }
.order-actions button.green { background: var(--green); color: var(--ink); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f0f0f0;
  color: #555;
  white-space: nowrap;
}
.status.done, .status.paid_ok { background: #e8ffc4; color: #3d6b00; }
.status.paid, .status.sent { background: #fff4c2; color: #7a5b00; }
.status.canceled, .status.refunded { background: #eee; color: #777; }
.status.escrow { background: #dff4ff; color: #00618a; }
.status.dispute { background: #ffe1ee; color: #b0135b; }

.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed #2e2e2e;
  border-radius: 24px;
  color: var(--muted);
}
.empty b { display: block; font-family: var(--font-display); color: #fff; font-size: 20px; font-weight: 800; margin-bottom: 7px; text-transform: uppercase; }
.empty p { font-size: 13px; line-height: 1.45; }
.empty button {
  margin-top: 16px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--green);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---------- wallet ---------- */
.balance-card {
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  padding: 24px;
  margin-top: 4px;
}
.balance-card .label { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #888; }
.balance-card .amount {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .95;
}
.balance-card .row { display: flex; gap: 8px; margin-top: 20px; }
.balance-card .row button {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.balance-card .row button.ghost { background: #f0f0f0; color: #111; }

.topup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.topup-grid button {
  height: 66px;
  border-radius: 18px;
  border: 1.5px solid #e4e4e4;
  background: #f7f7f7;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.topup-grid button:active { transform: scale(.97); background: #ececec; border-color: #cfcfcf; }
.topup-grid button span { display: block; font-family: var(--font-body); font-size: 10px; font-weight: 500; color: #999; letter-spacing: .02em; margin-top: 3px; }

.requisites {
  background: #fff;
  color: var(--ink);
  border-radius: 20px;
  padding: 4px 16px;
  margin-bottom: 12px;
}
.req-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.req-row:last-child { border-bottom: 0; }
.req-row span { font-size: 12px; color: #888; }
.req-row b { font-size: 14px; font-weight: 600; text-align: right; word-break: break-word; }
.req-row .copy-btn {
  grid-column: 1 / -1;
  justify-self: start;
  height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #e2e2e2;
  background: #f7f7f7;
  color: #111;
  font-size: 11px;
  font-weight: 500;
}
.req-row .copy-btn:active { background: #ececec; }

.field .file-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: 52px;
  margin-bottom: 0;
  padding: 8px 10px;
  border: 1.5px dashed #d8d8d8;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  line-height: 1.2;
}
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick-btn {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.file-pick-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #888;
}
.file-pick:active { border-color: #bbb; background: #f2f2f2; }

.topup-status { text-align: center; padding: 12px 0 4px; }
.topup-status .spinner { display: block; margin: 0 auto 16px; }
.topup-status h2 { margin-bottom: 6px; }
.topup-status .notice { text-align: left; margin: 14px 0; }
.topup-status .btn { width: 100%; margin-top: 8px; }
.tx-link { cursor: pointer; }
.tx-link:active { background: #fafafa; }

.tx-list { background: #fff; color: var(--ink); border-radius: 22px; overflow: hidden; }
.tx { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.tx:last-child { border-bottom: 0; }
.tx .ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f2f2f2;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 500;
  flex: 0 0 36px;
}
.tx .info { min-width: 0; flex: 1; }
.tx .info b { display: block; font-size: 13px; font-weight: 500; }
.tx .info span { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.tx .sum { font-size: 14px; font-weight: 500; white-space: nowrap; }
.tx .sum.plus { color: #3f7d00; }
.tx .sum.minus { color: #b0135b; }
.tx .sum.pending { color: #999; }

/* ---------- profile ---------- */
.profile-card {
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-card .ava {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  flex: 0 0 60px;
}
.profile-card .who { min-width: 0; }
.profile-card .who b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.profile-card .who span { display: block; font-size: 12px; color: #888; margin-top: 3px; }

.menu-list { background: #fff; color: var(--ink); border-radius: 22px; overflow: hidden; margin-top: 12px; }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 15px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #f3f3f3;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
}
.menu-item .mi svg { width: 18px; height: 18px; fill: var(--ink); }
.menu-item .chev { margin-left: auto; width: 16px; height: 16px; fill: #bbb; }
.menu-item .sub { display: block; font-size: 11px; font-weight: 400; color: #999; margin-top: 2px; }
.menu-item.danger { color: #c2185b; }
.menu-item.danger .mi svg { fill: #c2185b; }
.menu-item.card-row { background: #fff; color: var(--ink); border-radius: 20px; border-bottom: 0; }

.legal { margin: 20px 4px 0; font-size: 11px; line-height: 1.5; color: #5f5f5f; }
.legal a { color: #8a8a8a; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 12, .94);
  border-top: 1px solid #232323;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  color: #6f6f6f;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .02em;
  border-radius: 12px;
  transition: color .15s ease;
}
.tab svg { width: 22px; height: 22px; fill: currentColor; }
.tab.active { color: var(--green); }

/* ---------- sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--ink);
  border-radius: 28px 28px 0 0;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slideUp .24s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .4);
}
@keyframes slideUp { from { transform: translate(-50%, 100%); } }
.sheet-grab { width: 38px; height: 4px; border-radius: 99px; background: #ddd; margin: 0 auto 14px; }
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f1f1;
  display: grid;
  place-items: center;
}
.sheet-close svg { width: 14px; height: 14px; fill: #555; }
.sheet h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: .95;
  text-transform: uppercase;
  padding-right: 34px;
}
.sheet .sheet-sub { margin-top: 9px; font-size: 13px; color: #777; line-height: 1.45; }
.sheet .big-amount { font-family: var(--font-display); font-size: 44px; font-weight: 800; letter-spacing: -.03em; margin: 18px 0 4px; }
.sheet .section-head { margin: 20px 0 10px; }
.sheet .section-head h2 { color: var(--ink); font-size: 17px; }
.sheet .section-head span { color: #999; }

.form { margin-top: 18px; display: grid; gap: 12px; }
.form .field { min-width: 0; }
.field label { display: block; font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid #e9e9e9;
  background: #f6f6f6;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 400;
  color: #111;
  outline: none;
  appearance: none;
}
.field textarea { height: auto; min-height: 84px; padding: 13px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #111; background: #fff; }
.hint { margin-top: 8px; font-size: 11px; color: #999; line-height: 1.4; }
.field .hint { margin-top: 6px; }
.consent { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.45; color: #777; cursor: pointer; }
.consent input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #111; margin: 0; }
.consent span { padding-top: 1px; }
.pkg-editor + .btn { margin-top: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  width: 100%;
  height: 52px;
  border-radius: 15px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.accent { background: var(--green); color: var(--ink); }
.btn.blue { background: var(--blue); color: var(--ink); }
.btn.ghost { background: #f2f2f2; color: #111; }
.btn.outline { background: transparent; border: 1.5px solid #ddd; color: #111; }
.btn.small { height: 44px; border-radius: 12px; font-size: 10px; }

.summary {
  background: #f6f6f6;
  border-radius: 16px;
  padding: 14px;
  margin-top: 16px;
}
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #777; padding: 5px 0; }
.summary-row b { color: #111; font-weight: 500; }
.summary-row.total { border-top: 1px solid #e4e4e4; margin-top: 6px; padding-top: 10px; font-size: 14px; }
.summary-row.total b { font-family: var(--font-display); font-size: 20px; font-weight: 800; }

.notice {
  padding: 13px 15px;
  border-radius: 16px;
  background: #f4f4f4;
  font-size: 13px;
  line-height: 1.45;
  color: #666;
  margin-top: 12px;
}
.notice.green { background: #eeffd2; color: #3f6b00; }
.notice.blue { background: #e4f7ff; color: #005f85; }
.notice.pink { background: #ffe9f3; color: #a80f54; }
.notice b { color: inherit; }
.notice.pre { white-space: pre-line; }

.chat {
  margin-top: 16px;
  height: min(46vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f6f6f6;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty { margin: auto; text-align: center; font-size: 12px; color: #999; line-height: 1.5; padding: 20px; }
.msg { max-width: 84%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg .bubble {
  display: inline-block;
  text-align: left;
  padding: 9px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #111;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.msg.mine .bubble { background: var(--green); border-radius: 14px 14px 4px 14px; }
.msg-meta { margin-top: 3px; font-size: 9px; color: #999; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input {
  flex: 1;
  height: 50px;
  border-radius: 14px;
  border: 1.5px solid #e9e9e9;
  background: #f6f6f6;
  padding: 0 14px;
  font-size: 16px;
  color: #111;
  outline: none;
}
.chat-form input:focus { border-color: #111; background: #fff; }
.chat-form button {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 14px;
  background: var(--green);
  display: grid;
  place-items: center;
}
.chat-form button svg { width: 20px; height: 20px; fill: var(--ink); }
.chat-form button .btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, .2);
  border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}
.deal-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f6f6;
}
.deal-summary b { display: block; font-size: 15px; font-weight: 600; color: #111; }
.deal-summary span { display: block; margin-top: 3px; font-size: 11px; color: #888; }

.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reason-chip {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: #f4f4f4;
  color: #111;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}
.reason-chip.active { border-color: var(--green); background: #eeffd2; }
.reason-chip:active { transform: scale(.98); }
.form textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border: 1.5px solid #e9e9e9;
  border-radius: 14px;
  background: #f6f6f6;
  color: #111;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  resize: vertical;
}
.form textarea:focus { border-color: #111; background: #fff; }

.login-box { text-align: center; padding-top: 6px; }
.login-methods { display: grid; gap: 8px; margin-top: 16px; }
.auth-switch {
  display: flex;
  gap: 4px;
  margin: 16px 0 2px;
  padding: 4px;
  border-radius: 12px;
  background: #f2f2f2;
}
.auth-switch button {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #777;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.auth-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.btn.vk { background: #0077ff; color: #fff; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  color: #999;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: #ececec; }
.login-box .form { text-align: left; margin-top: 12px; }
.login-note { margin-top: 12px; font-size: 10.5px; color: #999; line-height: 1.45; }
.login-box .tg-ico {
  width: 72px;
  height: 72px;
  margin: 4px auto 16px;
  border-radius: 50%;
  background: var(--green);
  display: grid;
  place-items: center;
}
.login-box .tg-ico svg { width: 30px; height: 30px; fill: var(--ink); }
.login-box h2 { text-align: center; padding: 0; }
.login-box p { margin-top: 9px; font-size: 13px; color: #777; line-height: 1.5; }
.login-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 11px; color: #999; }
.login-status .spinner { width: 16px; height: 16px; border-width: 2px; border-color: #ddd; border-top-color: #111; }

.check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  display: grid;
  place-items: center;
  margin: 6px auto 16px;
}
.check svg { width: 32px; height: 32px; fill: var(--ink); }
.success-box { text-align: center; padding: 10px 0 4px; }
.success-box h2 { text-align: center; padding: 0; }
.success-box p { margin-top: 9px; font-size: 13px; color: #777; line-height: 1.5; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: 88vw;
  padding: 12px 16px;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--pink); color: #fff; }

.hidden { display: none !important; }

/* ---------- desktop ---------- */
@media (min-width: 560px) {
  body { background: #000; padding: 18px 0; }
  .app { border-radius: 30px; overflow: hidden; min-height: calc(100vh - 36px); }
  .topbar { border-radius: 30px 30px 0 0; }
  .tabbar { bottom: 18px; border-radius: 0 0 30px 30px; }
  .sheet { bottom: 18px; border-radius: 28px; }
  .sheet-backdrop { backdrop-filter: blur(6px); }
}

@media (max-width: 380px) {
  .p2p-filter-row { grid-template-columns: 1fr; }
  .p2p-seg button { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
