/* ─── Root variables ─────────────────────────────────────────────────── */
:root {
  --bg:    #0a0e1a;
  --bg2:   #0d1525;
  --card:  #111c2e;
  --card-border: #1a2d45;
  --glass: #121f33;
  --glass-hover: #172540;
  --glass-border: #1e3050;
  --glass-border-bright: #254070;
  --blue: #0088CC;
  --blue-dark: #006699;
  --blue-glow: transparent;
  --blue-glow-strong: transparent;
  --purple: #0099DD;
  --text: #ffffff;
  --text-60: rgba(255,255,255,0.55);
  --text-40: rgba(255,255,255,0.38);
  --text-20: rgba(255,255,255,0.18);
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;
  --r: 16px;
  --r-sm: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --nav-h: 80px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Reset & base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  min-height: 100dvh;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}

/* ─── Loading screen ─────────────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px;
  background: var(--bg);
  z-index: 100;
}

.loading-logo { text-align: center; }
.logo-shield { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.logo-name { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.logo-sub { font-size: 14px; color: var(--text-40); margin-top: 4px; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(0,136,204,0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Hidden / visible ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Overlay (currency select) ──────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end;
}
.overlay-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}
.overlay-sheet {
  position: relative; width: 100%;
  background: #1e1e1e;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--card-border);
  padding: 12px 20px calc(24px + var(--safe-b));
  animation: slideUp 0.3s ease;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.overlay-handle {
  width: 40px; height: 4px;
  background: var(--text-20);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.currency-header { text-align: center; margin-bottom: 24px; }
.currency-icon { font-size: 40px; margin-bottom: 10px; }
.currency-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.currency-header p { font-size: 14px; color: var(--text-60); }

.currency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.currency-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 14px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.currency-item:active { transform: scale(0.95); }
.currency-item.selected {
  background: rgba(0,136,204,0.15);
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.currency-emoji { display: flex; align-items: center; justify-content: center; height: 36px; }
.currency-emoji img { width: 30px; height: 30px; object-fit: contain; }
.currency-emoji span { font-size: 24px; font-weight: 700; line-height: 1; }
.currency-code { font-size: 13px; font-weight: 700; }
.currency-name { font-size: 10px; color: var(--text-40); text-align: center; }
.currency-rate { font-size: 9px; color: var(--text-40); text-align: center; opacity: 0.75; }

/* ─── Main app ───────────────────────────────────────────────────────── */
#main-app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page { display: none; padding: 0 0 8px; }
.page.active { display: block; }

/* ─── Bottom nav ─────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(60px + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #181818;
  border-top: 1px solid #2a2a2a;
  display: flex; align-items: center;
  padding-left: 4px; padding-right: 4px;
  z-index: 50;
}

.pages-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(60px + var(--safe-b) + 16px);
}

.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  background: none; border: none;
  color: rgba(255,255,255,0.32);
  cursor: pointer;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
  position: relative;
}
.nav-btn.active { color: var(--blue); }

.nav-icon { line-height: 1; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 24px; height: 24px; }
.nav-label { font-size: 10px; font-weight: 500; }

.nav-create-btn {
  color: rgba(255,255,255,0.5);
  padding: 0;
  justify-content: center;
}
.nav-create-inner {
  width: 46px; height: 46px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.nav-create-btn.active .nav-create-inner { background: var(--blue-dark); }
.nav-create-btn .nav-label { display: none; }

/* ─── Cards — playerok flat style ───────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top-color: #3a3a3a;
  border-radius: var(--r);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}

.card-blue {
  background: rgba(0,136,204,0.1);
  border-color: rgba(0,136,204,0.22);
}

/* ─── Page header ────────────────────────────────────────────────────── */
.page-header {
  padding: 56px 20px 16px;
  display: flex; align-items: center; gap: 12px;
}
.page-header h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.back-btn {
  width: 36px; height: 36px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.back-btn:active { background: var(--glass-hover); transform: scale(0.95); }

/* ─── Profile page ───────────────────────────────────────────────────── */
.profile-top {
  padding: 52px 20px 0;
}

.profile-hero {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}

.avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #005588 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-username { font-size: 13px; color: var(--text-60); margin-top: 2px; }

.profile-rating {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px;
}
.stars { color: var(--blue); font-size: 13px; }
.rating-val { font-size: 13px; color: var(--text-60); }

/* Balance card */
.balance-card {
  padding: 22px 20px;
  margin: 0 20px 16px;
  background: linear-gradient(135deg, #006699 0%, #0088CC 45%, #33AADD 100%) !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0,136,204,0.35) !important;
}
.balance-label { font-size: 11px; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.balance-amount { font-size: 36px; font-weight: 700; letter-spacing: -1px; color: #fff; }
.balance-currency { font-size: 16px; color: rgba(255,255,255,0.7); margin-left: 6px; }
.balance-change-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px;
  font-size: 12px; color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 12px;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}
.balance-change-btn:active { background: rgba(255,255,255,0.25); }

/* Stats row */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 20px 20px;
}
.stat-card {
  padding: 14px 12px;
  text-align: center;
}
.stat-val { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--text-40); margin-top: 2px; }

/* Deals section */
.section { margin: 0 20px 20px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 17px; font-weight: 600; }
.section-link { font-size: 13px; color: var(--blue); background: none; border: none; cursor: pointer; padding: 0; }

/* ─── Deal card ──────────────────────────────────────────────────────── */
.deal-card {
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.deal-card:active { transform: scale(0.98); }

.deal-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.deal-cat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(0,136,204,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.deal-card-info { flex: 1; min-width: 0; }
.deal-card-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-card-meta { font-size: 12px; color: var(--text-40); margin-top: 2px; }

.deal-card-bottom { display: flex; align-items: center; justify-content: space-between; }
.deal-card-amount { font-size: 15px; font-weight: 600; color: var(--blue); }
.deal-status-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

/* Status badge colors */
.badge-pending { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-active  { background: rgba(0,136,204,0.15); color: var(--blue); }
.badge-paid    { background: rgba(52,211,153,0.15); color: var(--success); }
.badge-completed { background: rgba(52,211,153,0.15); color: var(--success); }
.badge-cancelled { background: rgba(248,113,113,0.1); color: var(--error); }
.badge-refunded  { background: rgba(248,113,113,0.1); color: var(--error); }
.badge-disputed  { background: rgba(251,191,36,0.15); color: var(--warning); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--r);
  padding: 14px 24px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 13px 24px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.btn-secondary:active { transform: scale(0.97); background: var(--glass-hover); }

.btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 13px 24px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.btn-danger:active { transform: scale(0.97); }

.btn-warning {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 13px 24px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.btn-warning:active { transform: scale(0.97); }

.btn-full { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: var(--r-sm); }

/* ─── Form elements ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: var(--text-40); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #262626;
  border: 1px solid var(--card-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0,136,204,0.2);
}
.form-input::placeholder { color: var(--text-20); }
.form-textarea { resize: none; height: 90px; line-height: 1.5; }
.form-select option { background: #1a1a3a; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Role selector */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-btn {
  padding: 14px;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r);
  color: var(--text-60);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.role-btn.selected {
  background: rgba(0,136,204,0.12);
  border-color: var(--blue);
  color: var(--text);
}
.role-btn-icon { font-size: 28px; margin-bottom: 6px; }
.role-btn-label { font-size: 15px; font-weight: 600; }
.role-btn-sub { font-size: 12px; opacity: 0.6; margin-top: 2px; }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat-btn {
  padding: 12px 8px;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r);
  color: var(--text-60);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
  font-family: inherit;
}
.cat-btn.selected {
  background: rgba(0,136,204,0.12);
  border-color: var(--blue);
  color: var(--text);
}
.cat-btn:active { transform: scale(0.96); }
.cat-icon { font-size: 22px; margin-bottom: 4px; height: 32px; display: flex; align-items: center; justify-content: center; }
.cat-icon img { width: 28px; height: 28px; object-fit: contain; }
.cat-name { font-size: 11px; font-weight: 600; }

.deal-cat-icon img { width: 22px; height: 22px; object-fit: contain; }

/* Step indicator */
.steps { display: flex; align-items: center; gap: 8px; padding: 0 20px 20px; }
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-20);
  transition: var(--transition);
}
.step-dot.active { background: var(--blue); width: 20px; border-radius: 4px; }
.step-dot.done { background: var(--success); }

/* Amount input with currency */
.amount-wrap { position: relative; }
.amount-input { padding-right: 64px !important; font-size: 18px !important; font-weight: 600; }
.amount-currency-badge {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; font-weight: 700;
  color: var(--blue);
  pointer-events: none;
}

/* ─── Deal detail page ───────────────────────────────────────────────── */
.deal-header-section {
  padding: 52px 20px 20px;
}

.deal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.deal-title-text h2 { font-size: 22px; font-weight: 700; }
.deal-title-text .deal-cat-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--blue);
  background: rgba(0,136,204,0.12);
  border: 1px solid rgba(0,136,204,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  margin-top: 6px;
}

.deal-amount-big {
  font-size: 40px; font-weight: 700;
  letter-spacing: -1px;
  color: var(--blue);
  margin: 12px 0 4px;
}
.deal-date { font-size: 13px; color: var(--text-40); }

.deal-info-card {
  margin: 0 20px 14px;
  padding: 16px;
}
.deal-info-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
}
.deal-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.deal-info-key { font-size: 13px; color: var(--text-40); }
.deal-info-val { font-size: 13px; font-weight: 500; text-align: right; }

.user-card {
  margin: 0 20px 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.user-card-ava {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #005588);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.user-card-info { flex: 1; }
.user-card-name { font-size: 15px; font-weight: 600; }
.user-card-role { font-size: 12px; color: var(--text-40); }
.user-card-rating { font-size: 12px; color: var(--blue); }

.deal-actions { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }

.status-banner {
  margin: 0 20px 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  display: flex; align-items: center; gap: 10px;
}
.status-banner-pending { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); }
.status-banner-active  { background: rgba(0,136,204,0.1); border: 1px solid rgba(0,136,204,0.2); }
.status-banner-paid    { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); }
.status-banner-completed { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); }
.status-banner-disputed { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); }
.status-banner-icon { font-size: 22px; flex-shrink: 0; }
.status-banner-text { font-size: 13px; line-height: 1.4; color: var(--text); }
.status-banner-text b { display: block; font-size: 14px; margin-bottom: 2px; }
.status-banner-link { cursor: pointer; transition: transform 0.1s, filter 0.1s; }
.status-banner-link:active { transform: scale(0.985); filter: brightness(1.15); }
.status-banner-cta {
  margin-top: 8px; font-size: 12px; font-weight: 600;
  color: var(--blue); display: flex; align-items: center; gap: 4px;
}

/* ─── Problem page ───────────────────────────────────────────────────── */
.problem-list { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.problem-item {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.problem-item:active { transform: scale(0.98); }
.problem-icon { font-size: 22px; }
.problem-text { flex: 1; }
.problem-title { font-size: 15px; font-weight: 500; }
.problem-sub { font-size: 12px; color: var(--text-40); margin-top: 2px; }
.problem-arrow { color: var(--text-20); }

/* ─── Rating page ────────────────────────────────────────────────────── */
.rating-page { padding: 0 20px; text-align: center; }
.rating-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.rating-sub { font-size: 14px; color: var(--text-60); margin-bottom: 32px; }
.rating-stars-big { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; }
.star-big {
  font-size: 40px; cursor: pointer;
  filter: grayscale(1) opacity(0.3);
  transition: var(--transition);
}
.star-big.active { filter: none; transform: scale(1.15); }

/* ─── Chats (Deals list) page ────────────────────────────────────────── */
.deals-tabs {
  display: flex; gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.deals-tabs::-webkit-scrollbar { display: none; }
.deals-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-60);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.deals-tab.active {
  background: rgba(0,136,204,0.15);
  border-color: var(--blue);
  color: var(--text);
}

.deals-list { padding: 0 20px; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-40);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-60); }
.empty-sub { font-size: 14px; }

/* ─── Wallet page ────────────────────────────────────────────────────── */
.wallet-balance-section {
  padding: 52px 20px 20px;
  text-align: center;
}
.wallet-balance-label { font-size: 13px; color: var(--text-40); margin-bottom: 8px; }
.wallet-balance-big { font-size: 48px; font-weight: 700; letter-spacing: -2px; }
.wallet-balance-currency { font-size: 20px; color: var(--text-60); margin-left: 8px; }
.wallet-balance-converted { font-size: 14px; color: var(--text-40); margin-top: 6px; }

.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px 20px; }

.tx-list { padding: 0 20px; }
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.tx-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tx-icon-in  { background: rgba(52,211,153,0.12); }
.tx-icon-out { background: rgba(248,113,113,0.12); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: 12px; color: var(--text-40); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 600; }
.tx-amount.pos { color: var(--success); }
.tx-amount.neg { color: var(--error); }

/* ─── Support page ───────────────────────────────────────────────────── */
.support-section { padding: 52px 20px 20px; }
.support-hero { text-align: center; padding-bottom: 28px; }
.support-hero-icon { font-size: 52px; margin-bottom: 12px; }
.support-hero-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.support-hero-sub { font-size: 14px; color: var(--text-60); }

.faq-list { margin-bottom: 20px; }
.faq-item {
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.faq-q { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.faq-a { font-size: 13px; color: var(--text-60); margin-top: 8px; line-height: 1.5; display: none; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-arrow { transition: var(--transition); }

/* ─── Create deal steps ──────────────────────────────────────────────── */
.create-section { padding: 52px 20px 20px; }
.create-header { margin-bottom: 24px; }
.create-header h1 { font-size: 26px; font-weight: 700; }
.create-header p { font-size: 14px; color: var(--text-60); margin-top: 4px; }
.create-step { display: none; }
.create-step.active { display: block; }
.create-footer { margin-top: 24px; display: flex; gap: 10px; }

/* ─── Share modal ────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end;
}
.modal-sheet {
  width: 100%;
  background: #1e1e1e;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--card-border);
  padding: 12px 20px calc(32px + var(--safe-b));
  animation: slideUp 0.3s ease;
}
.modal-handle { width: 40px; height: 4px; background: var(--text-20); border-radius: 2px; margin: 0 auto 20px; }

.link-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-60);
  word-break: break-all;
  margin-bottom: 12px;
  font-family: monospace;
}

/* ─── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%; transform: translateX(-50%);
  background: rgba(30,30,60,0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  z-index: 300;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ─── Chats list ─────────────────────────────────────────────────────── */
.chats-page { padding-top: 52px; }
.chats-header { padding: 0 20px 16px; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }

.chat-list { display: flex; flex-direction: column; }

.chat-section-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-40);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 10px 20px 6px;
}

.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.chat-item:active { background: rgba(255,255,255,0.04); }

.chat-ava-support {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #0088CC 0%, #005588 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,136,204,0.3);
}
.chat-ava-support-sm {
  width: 38px; height: 38px; font-size: 17px;
  box-shadow: none;
}

.chat-ava-user {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.chat-info { flex: 1; min-width: 0; }
.chat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-row + .chat-row { margin-top: 3px; }
.chat-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 12px; color: var(--text-40); flex-shrink: 0; }
.chat-last { font-size: 13px; color: var(--text-40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
}

/* ─── Chat room ──────────────────────────────────────────────────────── */
.chat-room {
  display: flex; flex-direction: column;
  height: 100dvh;
}

.chat-room-header {
  display: flex; align-items: center; gap: 10px;
  padding: 52px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.chat-room-name { font-size: 16px; font-weight: 700; }
.chat-room-status { font-size: 12px; color: var(--success); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 8px;
}

.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg-in  { align-self: flex-start; align-items: flex-start; }
.msg-out { align-self: flex-end;   align-items: flex-end;   }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px; line-height: 1.45;
  word-break: break-word;
}
.msg-in  .msg-bubble { background: #2a2a2a; border-bottom-left-radius: 4px; }
.msg-out .msg-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 11px; color: var(--text-40); margin-top: 3px; padding: 0 4px; }

.chat-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: var(--bg);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: #262626;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 16px;
  outline: none;
  font-family: inherit;
}
.chat-input::placeholder { color: var(--text-20); }
.chat-input:focus { border-color: var(--blue); }
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}
.chat-send-btn:active { transform: scale(0.92); opacity: 0.85; }

/* ─── Divider ────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--glass-border); margin: 8px 0; }

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ─── Animations ─────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ─── Info banner ────────────────────────────────────────────────────── */
.info-banner {
  margin: 0 20px 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(0,136,204,0.08);
  border: 1px solid rgba(0,136,204,0.15);
  font-size: 13px; color: var(--text-60);
  line-height: 1.5;
}

/* ─── Step numbers in deal ───────────────────────────────────────────── */
.deal-steps {
  margin: 0 20px 14px;
  padding: 16px;
}
.deal-step-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
}
.deal-step-item:last-child { border-bottom: none; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,136,204,0.15);
  border: 1px solid rgba(0,136,204,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}
.step-num.done { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3); color: var(--success); }
.step-text { flex: 1; }
.step-title { font-size: 14px; font-weight: 600; }
.step-desc { font-size: 12px; color: var(--text-40); margin-top: 2px; }
