:root {
  --bg: #000000;
  --surface: rgba(12, 12, 12, 0.88);
  --surface2: rgba(18, 18, 18, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 255, 157, 0.28);
  --text: #ffffff;
  --text-secondary: #d4d4d4;
  --muted: #8a8a8a;
  --green: #00ff9d;
  --green-soft: rgba(0, 255, 157, 0.14);
  --red: #ff5a65;
  --red-soft: rgba(255, 90, 101, 0.14);
  --accent: #00ff9d;
  --accent-soft: rgba(0, 255, 157, 0.12);
  --neon-cyan: #00ff9d;
  --neon-green: #00ff9d;
  --neon-purple: #00ff9d;
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --header-h: 60px;
  --mobile-nav-h: 72px;
  --transition: 0.22s ease;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px rgba(0, 255, 157, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 157, 0.32) rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 157, 0.28);
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.45);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 157, 0.48);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "SF Pro Display", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── BACKGROUND ─── */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 45% at 12% -8%, rgba(0, 255, 157, 0.1), transparent 55%),
    radial-gradient(ellipse 55% 40% at 88% 8%, rgba(0, 255, 157, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(0, 255, 157, 0.04), transparent 55%);
}

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background: url("/static/img/xtrust-bg.svg") center / 480px repeat;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 85%);
  transition: opacity var(--transition);
}

body.has-custom-bg .bg-pattern { opacity: 0.08; }
body.has-custom-bg .bg-glow { opacity: 0.45; }

.bg-custom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.bg-custom.active { opacity: 1; }

.bg-custom::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3,3,8,0.72) 0%, rgba(3,3,8,0.82) 50%, rgba(3,3,8,0.88) 100%);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

.glass-card {
  background: linear-gradient(145deg, rgba(14, 14, 14, 0.94), rgba(6, 6, 6, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.glow-border {
  position: relative;
}

.glow-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 255, 157, 0.35), rgba(0, 255, 157, 0.12), rgba(255, 255, 255, 0.04));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  border-radius: calc(var(--radius-lg) + 1px);
}

/* ─── AUTH ─── */
#screen-auth.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
}

.auth-wrap.glass-card,
.auth-wrap {
  background: linear-gradient(160deg, rgba(20,20,28,0.92), rgba(10,10,14,0.88));
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.auth-brand { text-align: center; margin-bottom: 2rem; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--neon-green);
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.35rem;
  color: #000;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 255, 157, 0.3);
}

.auth-brand h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.25);
}

.auth-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 0.45rem; }

.auth-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.7rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.auth-tab.active {
  background: rgba(0, 255, 157, 0.12);
  color: var(--neon-green);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.2), inset 0 0 0 1px rgba(0, 255, 157, 0.4);
}

.form-block { display: flex; flex-direction: column; gap: 0.35rem; }

.field-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.6rem;
}

.field-input,
.form-block input,
.form-block textarea,
.glow-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus,
.form-block input:focus,
.form-block textarea:focus,
.amount-input:focus,
.picker.open .picker-btn,
.account-card:focus-visible,
.btn-primary:focus-visible,
.btn-swap:focus-visible,
.nav-link:focus-visible,
.nav-item:focus-visible {
  outline: none;
  border-color: rgba(0, 255, 157, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.22), 0 0 18px rgba(0, 255, 157, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: var(--neon-green);
  color: #000000;
  border: 1px solid var(--neon-green);
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.15s ease, box-shadow var(--transition), background var(--transition);
  box-shadow: 0 0 22px rgba(0, 255, 157, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #33ffb5;
  border-color: #33ffb5;
  box-shadow: 0 0 32px rgba(0, 255, 157, 0.45);
}

.seed-modal {
  margin-top: 1.5rem;
  padding: 1.35rem;
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.25);
}

.seed-label { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }
.seed-code { display: block; font-size: 0.84rem; line-height: 1.8; word-break: break-word; margin-bottom: 0.75rem; }
.seed-id { font-size: 0.76rem; color: var(--muted); margin-bottom: 1rem; }

/* ─── SHELL ─── */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 255, 157, 0.12);
}

.header-left { display: flex; align-items: center; gap: 2rem; }

.logo {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.desktop-nav { display: none; gap: 0.35rem; }

.nav-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.nav-link:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }

.nav-link.active {
  color: var(--neon-green);
  background: rgba(0, 255, 157, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 157, 0.35), 0 0 16px rgba(0, 255, 157, 0.12);
}

.header-right { display: flex; align-items: center; gap: 0.75rem; }

.header-balance {
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.icon-btn, .text-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.icon-btn { padding: 0.45rem 0.55rem; background: transparent; border: none; }
.icon-btn:hover, .text-btn:hover { color: var(--text); border-color: var(--border-glow); }

/* ─── PAGES ─── */
#screen-wallet.active,
#screen-exchange.active,
#screen-history.active,
#screen-more.active,
#screen-p2p.active {
  padding: 1.25rem;
  padding-bottom: calc(var(--mobile-nav-h) + 1.5rem);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

#screen-p2p.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 56px - var(--mobile-nav-h));
  max-width: none;
  padding-top: 1.5rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.page-head h2 { font-size: 1.2rem; font-weight: 700; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.75rem 0 0.9rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.section-hint {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-pill);
}

/* Balance */
.balance-card {
  position: relative;
  padding: 2rem 1.6rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.balance-glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 255, 157, 0.18), transparent 70%);
  pointer-events: none;
}

.balance-label {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.balance-num {
  font-size: 2.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.45rem;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff 30%, #e8e8e8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.balance-num.hidden-val { filter: blur(14px); user-select: none; color: var(--text); }

/* Market preview */
.market-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.preview-card {
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 0.9rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(12, 12, 12, 0.95), rgba(6, 6, 6, 0.9));
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition), border-color var(--transition);
}

.preview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 157, 0.22);
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.preview-sym {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.preview-price {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

.preview-chg {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
}

.preview-chg.up { color: var(--green); background: var(--green-soft); }
.preview-chg.down { color: var(--red); background: var(--red-soft); }

.preview-chart { height: 58px; }
.preview-chart svg { width: 100%; height: 58px; display: block; }

/* Assets table */
.assets-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(12,12,18,0.6);
  backdrop-filter: blur(12px);
}

.assets-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }

.assets-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.assets-table th.align-r, .assets-table td.align-r { text-align: right; }

.assets-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.assets-table tr:last-child td { border-bottom: none; }
.assets-table tbody tr { transition: background var(--transition); }
.assets-table tbody tr:hover td { background: rgba(0, 255, 157, 0.04); }

.asset-sym { font-weight: 700; }
.asset-name-sm { font-size: 0.72rem; color: var(--muted); margin-top: 0.12rem; }

.up { color: var(--green); }
.down { color: var(--red); }

/* ─── EXCHANGE ─── */
.exchange-hero {
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.exchange-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.exchange-tag {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.exchange-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.rate-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(0,214,143,0.25);
}

.rate-badge.down {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(255,90,101,0.25);
}

.exchange-chart { height: 72px; margin: 0 -0.25rem; }
.exchange-chart svg { width: 100%; height: 72px; display: block; }

.swap-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem 1.4rem;
}

.swap-block { margin-bottom: 0.25rem; }

.swap-row-premium {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.picker {
  position: relative;
  flex: 0 0 auto;
  min-width: 148px;
}

.picker-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  height: 100%;
  min-height: 58px;
  padding: 0.65rem 0.85rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.picker-btn:hover,
.picker.open .picker-btn {
  border-color: rgba(0, 255, 157, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.coin-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.coin-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  background: rgba(255,255,255,0.06);
}

.coin-icon-slot {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
}

.coin-icon-lg {
  width: 44px;
  height: 44px;
}

.coin-icon-sm {
  width: 28px;
  height: 28px;
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.panel-hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.icon-upload-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.icon-upload-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.icon-upload-info { flex: 1; min-width: 0; }
.icon-upload-name { font-weight: 700; font-size: 0.9rem; }
.icon-upload-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }

.icon-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.btn-ghost {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-ghost:hover {
  border-color: var(--border-glow);
  color: var(--text);
}

.btn-ghost.danger:hover {
  border-color: rgba(255,90,101,0.45);
  color: var(--red);
}

.icon-file-input { display: none; }

.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.35);
  color: var(--neon-green);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.tg-link:hover {
  background: rgba(0, 255, 157, 0.16);
  color: #fff;
}

.tg-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.3);
  color: var(--neon-green);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.tg-pill:hover {
  background: rgba(0, 255, 157, 0.16);
  color: #fff;
}

.account-card.tg-card {
  text-decoration: none;
  color: inherit;
}

.bg-preview-wrap { margin-bottom: 1rem; }

.bg-preview {
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(20,20,28,0.9), rgba(10,10,14,0.85));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  position: relative;
}

.bg-preview.has-image { color: transparent; }

.bg-upload-actions {
  flex-direction: row;
  flex-wrap: wrap;
}

.bg-upload-actions .btn-ghost { flex: 1; min-width: 120px; text-align: center; }

.icon-file-input { display: none; }

.coin-badge.ton { background: linear-gradient(135deg, #0098ea, #0066aa); }
.coin-badge.sol { background: linear-gradient(135deg, #9945ff, #14f195); color: #000; }
.coin-badge.usdt { background: linear-gradient(135deg, #26a17b, #009e73); }

.picker-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; flex: 1; min-width: 0; }
.picker-label { font-size: 0.92rem; font-weight: 700; line-height: 1.2; }
.picker-sub { font-size: 0.62rem; color: var(--muted); margin-top: 0.1rem; }
.picker-arrow { color: var(--muted); font-size: 0.75rem; margin-left: auto; }

.picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  list-style: none;
  background: rgba(14, 14, 20, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  max-height: 240px;
  overflow-y: auto;
}

.picker-menu li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
}

.picker-menu li:hover { background: rgba(0, 255, 157, 0.1); }
.picker-menu li.active { background: var(--accent-soft); }

.amount-input {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: all var(--transition);
}

.amount-input:focus {
  outline: none;
  border-color: rgba(0, 255, 157, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.amount-input[readonly] { color: var(--text-secondary); font-weight: 500; }

.swap-divider {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0;
  position: relative;
}

.swap-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.swap-flip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-glow);
  background: linear-gradient(145deg, rgba(30,30,40,0.95), rgba(14,14,20,0.95));
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  transition: all var(--transition);
}

.swap-flip:hover {
  transform: rotate(180deg);
  border-color: rgba(0, 255, 157, 0.5);
  box-shadow: 0 8px 24px rgba(0, 255, 157, 0.18);
}

.quote-box {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 1.1rem 0;
  padding: 0.85rem 1rem;
  background: rgba(0, 255, 157, 0.06);
  border: 1px solid rgba(0, 255, 157, 0.15);
  border-radius: var(--radius-sm);
}

.quote-icon { color: var(--accent); font-size: 0.9rem; line-height: 1.4; }

.quote-box p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.btn-swap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.05rem;
  margin-top: 0.75rem;
  border: 1px solid var(--neon-green);
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #000000;
  background: var(--neon-green);
  box-shadow: 0 0 28px rgba(0, 255, 157, 0.35);
  transition: transform 0.15s ease, box-shadow var(--transition), background var(--transition);
}

.btn-swap:hover {
  transform: translateY(-2px);
  background: #33ffb5;
  border-color: #33ffb5;
  box-shadow: 0 0 40px rgba(0, 255, 157, 0.55);
}

.btn-swap:active { transform: scale(0.98); }

.result-box {
  font-size: 0.78rem;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  word-break: break-all;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.3);
}

/* History */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18,18,26,0.9), rgba(10,10,14,0.85));
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.history-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

.history-icon.in { background: var(--green-soft); color: var(--green); box-shadow: 0 0 20px rgba(0,214,143,0.15); }
.history-icon.out { background: var(--red-soft); color: var(--red); box-shadow: 0 0 20px rgba(255,90,101,0.15); }
.history-icon.swap { background: var(--accent-soft); color: var(--accent); }

.history-body { flex: 1; min-width: 0; }
.history-title { font-size: 0.92rem; font-weight: 700; }
.history-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.5; }

.history-amount {
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.history-amount.in { color: var(--green); }
.history-amount.out { color: var(--red); }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 3.5rem 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* Account */
.account-grid { display: grid; gap: 0.7rem; }

.account-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  background: linear-gradient(145deg, rgba(18,18,26,0.9), rgba(10,10,14,0.85));
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: all var(--transition);
}

.account-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}

.form-block input,
.form-block textarea {
  color: #ffffff;
}

.account-title { font-size: 0.95rem; font-weight: 700; color: #ffffff; }
.account-desc { font-size: 0.76rem; color: rgba(255, 255, 255, 0.55); margin-top: 0.3rem; }
.account-card.danger .account-title { color: #ff7a82; }

.account-card.tg-card .account-title { color: #7ee787; }
.account-card.tg-card:hover {
  border-color: rgba(0, 255, 157, 0.55);
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.18);
}

.btn-ghost {
  color: #ffffff;
  border: 1px solid rgba(0, 255, 157, 0.35);
  background: rgba(0, 255, 157, 0.08);
}

.text-btn { color: rgba(255, 255, 255, 0.85); }

.amount-input { color: #ffffff; }

/* Coin strip under balance */
.coin-strip {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.25rem 0 1rem;
  scrollbar-width: none;
}
.coin-strip::-webkit-scrollbar { display: none; }

.coin-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 157, 0.2);
  min-width: 110px;
}

.coin-chip-icon, .coin-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.coin-row-icon { margin-right: 0.5rem; }

.coin-chip-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(0, 255, 157, 0.15);
  color: var(--neon-green);
}

.coin-chip-sym { font-size: 0.72rem; font-weight: 700; color: #fff; display: block; }
.coin-chip-bal { font-size: 0.68rem; color: rgba(255,255,255,0.6); }

.asset-cell { display: flex; align-items: center; gap: 0.5rem; }

/* Language */
.lang-bar { margin-bottom: 1rem; text-align: left; }
.lang-select, .lang-select-header {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
}
.lang-select-header { width: auto; max-width: 130px; font-size: 0.72rem; padding: 0.4rem 0.5rem; }

.turnstile-box { margin: 0.75rem 0; display: flex; justify-content: center; }

.swap-card-top { margin-top: 0; }
.exchange-tag { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* P2P Marketplace */
.p2p-shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
#screen-p2p .page-head h2 { font-size: 1.45rem; }
#screen-p2p .panel-hint { font-size: 0.9rem; margin-bottom: 1rem; }
.p2p-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.p2p-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin: 1.15rem 0 1.25rem;
  width: 100%;
}
.p2p-tab {
  padding: 0.7rem 0.35rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.p2p-tab.active {
  border-color: rgba(0, 255, 157, 0.45);
  color: #fff;
  background: rgba(0, 255, 157, 0.08);
}
.p2p-panel { display: none; width: 100%; }
.p2p-panel.active { display: block; }
.p2p-balance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  width: 100%;
}
.p2p-bal-row { display: flex; flex-direction: column; gap: 0.2rem; color: rgba(255,255,255,0.55); }
.p2p-bal-row strong { color: #fff; font-size: 1.05rem; }
.p2p-bal-row.total strong { color: var(--accent); font-size: 1.15rem; }
.p2p-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.p2p-chip {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
}
.p2p-chip.active { border-color: var(--accent); color: #fff; }
#screen-p2p .field-label { font-size: 0.78rem; margin-bottom: 0.45rem; }
#screen-p2p #p2p-board-view,
#screen-p2p #p2p-listings-view { width: 100%; }
.p2p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.1rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}
.p2p-check { display: flex; align-items: center; gap: 0.4rem; }
.p2p-check input { accent-color: var(--neon-green); }
.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  user-select: none;
}
.auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--neon-green);
  cursor: pointer;
}
.p2p-rating-input {
  width: 3.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
}
.p2p-pay-board { display: flex; flex-direction: column; gap: 0.55rem; width: 100%; }
.p2p-pay-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.p2p-pay-btn:hover { border-color: rgba(0, 255, 157, 0.35); background: rgba(0, 255, 157, 0.06); }
.p2p-pay-name { font-weight: 600; font-size: 1rem; }
.p2p-pay-meta { font-size: 0.88rem; color: rgba(255,255,255,0.55); }
.p2p-pager { display: flex; gap: 0.35rem; justify-content: center; margin-top: 0.75rem; }
.p2p-page-btn {
  min-width: 2.2rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}
.p2p-page-btn.active { border-color: var(--accent); color: #fff; }
.p2p-back-btn {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.p2p-listings-head { font-weight: 700; color: #fff; margin-bottom: 0.65rem; font-size: 0.9rem; }
.p2p-listings, .p2p-deals { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.p2p-listing-card, .p2p-deal-card { padding: 1rem; border-radius: var(--radius); }
.p2p-listing-top, .p2p-deal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
}
.p2p-listing-rate { color: var(--accent); white-space: nowrap; }
.p2p-listing-meta, .p2p-deal-meta { font-size: 0.72rem; color: rgba(255,255,255,0.55); margin: 0.35rem 0; }
.p2p-listing-limits { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-bottom: 0.65rem; }
.p2p-buy-btn { width: 100%; margin-top: 0.25rem; }
.p2p-form { padding: 1.15rem; border-radius: var(--radius); margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.p2p-textarea { min-height: 4rem; resize: vertical; }
.p2p-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.p2p-gate { padding: 1.25rem; text-align: center; margin-bottom: 1rem; }
.p2p-gate p { margin-bottom: 0.85rem; color: rgba(255,255,255,0.65); font-size: 0.85rem; }
.p2p-deal-status { font-size: 0.72rem; color: var(--accent); font-weight: 600; }
.p2p-deal-timer { font-size: 0.7rem; color: #ffb347; margin: 0.25rem 0; }
.p2p-deal-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.p2p-profile-stats { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; font-size: 0.78rem; color: rgba(255,255,255,0.65); }
.p2p-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.p2p-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(6px); }
.p2p-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}
.p2p-modal-hint { font-size: 0.75rem; color: rgba(255,255,255,0.55); margin: 0.25rem 0; }
.p2p-modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.p2p-modal-actions .btn-primary { flex: 1; }

/* Profile card */
.p2p-profile-card { padding: 1.15rem; margin-bottom: 1rem; border-radius: var(--radius); }
.p2p-profile-top { display: flex; gap: 1rem; align-items: flex-start; }
.p2p-avatar-wrap { position: relative; flex-shrink: 0; }
.p2p-avatar, .p2p-avatar-fallback, .p2p-avatar-sm, .p2p-avatar-md, .p2p-avatar-letter {
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 255, 157, 0.12);
  border: 2px solid rgba(0, 255, 157, 0.25);
}
.p2p-avatar, .p2p-avatar-fallback { width: 72px; height: 72px; }
.p2p-avatar-md { width: 56px; height: 56px; }
.p2p-avatar-sm, .p2p-avatar-letter { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 0.9rem; }
.p2p-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: #fff; }
.p2p-avatar-edit {
  display: block; width: 100%; margin-top: 0.35rem; font-size: 0.65rem;
  background: transparent; border: none; color: var(--accent); cursor: pointer;
}
.p2p-profile-card-info h3 { color: #fff; font-size: 1rem; margin-bottom: 0.2rem; }
.p2p-profile-handle { color: rgba(255,255,255,0.5); font-size: 0.78rem; }
.p2p-profile-status, .p2p-profile-meta, .p2p-profile-joined { font-size: 0.72rem; color: rgba(255,255,255,0.55); margin-top: 0.25rem; }
.p2p-profile-bio { font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-top: 0.5rem; line-height: 1.45; }
.p2p-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.65rem; }
.p2p-badge {
  font-size: 0.65rem; padding: 0.25rem 0.5rem; border-radius: 999px;
  background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.25); color: #fff;
}
.p2p-seller-link { cursor: pointer; }
.p2p-seller-link:hover { color: var(--accent); }
.p2p-listing-btns { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.p2p-listing-btns .btn-primary { flex: 1; }

/* Reviews */
.p2p-reviews-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1rem; }
.p2p-review-item { padding: 0.85rem 1rem; border-radius: var(--radius-sm); }
.p2p-review-top { display: flex; justify-content: space-between; font-size: 0.78rem; color: #fff; font-weight: 600; }
.p2p-review-stars { color: #ffb347; }
.p2p-review-text { font-size: 0.78rem; color: rgba(255,255,255,0.65); margin: 0.35rem 0; line-height: 1.4; }
.p2p-review-date { font-size: 0.65rem; color: rgba(255,255,255,0.35); }
.p2p-stars { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.p2p-star { background: none; border: none; font-size: 1.4rem; color: rgba(255,255,255,0.25); cursor: pointer; padding: 0; }
.p2p-star.active { color: #ffb347; }
.p2p-modal-close { position: absolute; top: 0.75rem; right: 0.85rem; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.4rem; cursor: pointer; }
.p2p-user-card {
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 255, 157, 0.15);
}

/* Messages / inbox */
.p2p-inbox { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.p2p-inbox-item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.85rem 1rem;
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.2s;
  border: 1px solid rgba(255,255,255,0.06);
}
.p2p-inbox-item:hover { border-color: rgba(0, 255, 157, 0.3); }
.p2p-inbox-body { flex: 1; min-width: 0; }
.p2p-inbox-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.p2p-inbox-name { font-weight: 600; color: #fff; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2p-inbox-time { font-size: 0.65rem; color: rgba(255,255,255,0.4); flex-shrink: 0; }
.p2p-inbox-preview { font-size: 0.72rem; color: rgba(255,255,255,0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.p2p-unread {
  min-width: 1.25rem; height: 1.25rem; border-radius: 999px; background: var(--neon-green);
  color: #000; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.p2p-chat-head { display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem 1rem; margin-bottom: 0.65rem; border-radius: var(--radius-sm); }
.p2p-chat-sub { font-size: 0.68rem; color: rgba(255,255,255,0.45); margin-top: 0.1rem; }
.p2p-chat-msgs {
  list-style: none; display: flex; flex-direction: column; gap: 0.45rem;
  max-height: 50vh; overflow-y: auto; padding: 0.5rem 0.65rem; margin-bottom: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.p2p-msg { display: flex; flex-direction: column; max-width: 82%; }
.p2p-msg.mine { align-self: flex-end; align-items: flex-end; }
.p2p-msg.theirs { align-self: flex-start; align-items: flex-start; }
.p2p-msg-bubble {
  padding: 0.55rem 0.85rem; border-radius: 14px; font-size: 0.82rem; line-height: 1.4;
  word-break: break-word; color: #fff;
}
.p2p-msg.mine .p2p-msg-bubble { background: rgba(0, 255, 157, 0.18); border: 1px solid rgba(0, 255, 157, 0.3); }
.p2p-msg.theirs .p2p-msg-bubble { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); }
.p2p-msg-time { font-size: 0.6rem; color: rgba(255,255,255,0.35); margin-top: 0.15rem; }
.p2p-chat-form { display: flex; gap: 0.45rem; align-items: stretch; width: 100%; }
.p2p-chat-form .field-input { flex: 1; min-width: 0; margin: 0; border-radius: 14px; }
.p2p-chat-send {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5rem;
  max-width: 8.5rem;
  margin-top: 0;
  padding: 0.65rem 1rem;
  white-space: nowrap;
  align-self: center;
  color: #000;
}
#p2p-chat-view { display: flex; flex-direction: column; gap: 0.65rem; min-height: 380px; width: 100%; }
#p2p-chat-view .p2p-chat-msgs { flex: 1; min-height: 200px; max-height: none; }
.p2p-global-wrap { display: flex; flex-direction: column; width: 100%; min-height: 420px; gap: 0.65rem; }
.p2p-global-wrap .p2p-global-msgs { flex: 1; min-height: 240px; }
.p2p-detail-right .p2p-chat-form { margin-top: auto; padding-top: 0.5rem; }

.p2p-user-search { position: relative; width: 100%; margin-bottom: 0.85rem; padding: 0.65rem 0.85rem; border-radius: 18px; }
.p2p-user-search .field-input { margin: 0; width: 100%; border-radius: 14px; }
.p2p-search-results {
  position: absolute; left: 0.85rem; right: 0.85rem; top: calc(100% - 0.35rem); z-index: 40;
  list-style: none; margin: 0; padding: 0.35rem; border-radius: 14px;
  background: rgba(12, 12, 14, 0.98); border: 1px solid rgba(255,255,255,0.12);
  max-height: 240px; overflow-y: auto;
}
.p2p-search-item {
  display: flex; gap: 0.65rem; align-items: center; padding: 0.55rem 0.65rem;
  border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.p2p-search-item:hover { background: rgba(255,255,255,0.06); }
.p2p-search-sub { display: block; font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.p2p-search-empty { padding: 0.65rem; font-size: 0.8rem; color: rgba(255,255,255,0.45); }

.p2p-admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem; padding: 1rem; margin-bottom: 0.85rem; border-radius: 18px;
}
.p2p-admin-stat { display: flex; flex-direction: column; gap: 0.25rem; }
.p2p-admin-stat span { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.p2p-admin-stat strong { font-size: 1.25rem; color: #fff; }
.p2p-admin-section { padding: 1rem; border-radius: 18px; margin-bottom: 0.85rem; width: 100%; }
.p2p-admin-title { margin: 0 0 0.75rem; font-size: 0.95rem; color: #fff; }
.p2p-admin-row { display: flex; gap: 0.45rem; align-items: center; }
.p2p-admin-row .field-input { flex: 1; min-width: 0; margin: 0; }
.p2p-admin-user-card { margin-top: 0.75rem; padding: 0.75rem; border-radius: 14px; background: rgba(0,0,0,0.25); }
.p2p-admin-user-top { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.65rem; }
.p2p-admin-user-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.p2p-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.p2p-admin-dispute { padding: 0.75rem; border-radius: 14px; }
.p2p-admin-dispute-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.p2p-admin-audit-item {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.65rem;
  font-size: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.p2p-admin-audit-act { color: var(--accent); }
.p2p-admin-audit-meta { grid-column: 1 / -1; color: rgba(255,255,255,0.45); font-size: 0.68rem; }

@media (min-width: 768px) {
  .p2p-detail-grid { grid-template-columns: 1fr 1fr; }
  .p2p-detail-right { min-height: 420px; }
}

/* Listing detail split */
.p2p-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}
.p2p-detail-left, .p2p-detail-right {
  border-radius: 20px;
  padding: 1.15rem;
  overflow: hidden;
}
.p2p-detail-left { display: flex; flex-direction: column; gap: 0.65rem; }
.p2p-detail-right { display: flex; flex-direction: column; min-height: 320px; }
.p2p-detail-right .p2p-chat-msgs { flex: 1; max-height: 280px; min-height: 180px; }
.p2p-detail-title { font-size: 1.15rem; font-weight: 700; color: #fff; }
.p2p-detail-price { font-size: 1.25rem; color: var(--accent); font-weight: 700; }
.p2p-detail-desc {
  font-size: 0.85rem; color: rgba(255,255,255,0.65); line-height: 1.5;
  padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: 14px;
}
.p2p-detail-seller {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem; border-radius: 14px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer;
}
.p2p-mine-badge {
  display: inline-block; font-size: 0.65rem; padding: 0.2rem 0.5rem;
  border-radius: 999px; background: rgba(0, 255, 157, 0.15); color: var(--accent); margin-left: 0.35rem;
}
.p2p-listing-card { border-radius: 18px; cursor: pointer; transition: border-color 0.2s; }
.p2p-listing-card:hover { border-color: rgba(0, 255, 157, 0.35); }

/* Message sub-tabs + global chat */
.p2p-msg-tabs { display: flex; gap: 0.45rem; margin-bottom: 0.85rem; width: 100%; }
.p2p-msg-tab {
  flex: 1; padding: 0.65rem; border-radius: 14px; font-size: 0.8rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.65); cursor: pointer;
}
.p2p-msg-tab.active { border-color: rgba(0, 255, 157, 0.45); color: #fff; background: rgba(0, 255, 157, 0.08); }
.p2p-global-wrap { display: flex; flex-direction: column; width: 100%; }
.p2p-global-msgs {
  max-height: 55vh;
  min-height: 240px;
  border-radius: 18px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.p2p-global-msg { margin-bottom: 0.55rem; }
.p2p-global-msg-head { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-bottom: 0.15rem; }
.p2p-global-msg-body {
  display: inline-block; padding: 0.5rem 0.75rem; border-radius: 14px;
  background: rgba(255,255,255,0.06); color: #fff; font-size: 0.82rem;
}
.p2p-public-id { font-size: 0.72rem; color: var(--accent); font-family: monospace; }

@media (min-width: 768px) {
  .p2p-detail-grid { grid-template-columns: 1fr 1fr; }
  .p2p-detail-right { min-height: 420px; }
  .p2p-detail-right .p2p-chat-msgs { max-height: 340px; }
}

@media (min-width: 768px) {
  #screen-p2p.active {
    min-height: calc(100dvh - 64px);
    padding: 2rem 1.5rem;
    padding-bottom: 2rem;
  }
  .p2p-shell { max-width: 720px; }
  .p2p-modal { align-items: center; }
  .p2p-modal-card { border-radius: var(--radius); }
}

@media (min-width: 900px) {
  .p2p-shell { max-width: 820px; }
  #screen-p2p .page-head h2 { font-size: 1.65rem; }
  .p2p-tab { font-size: 0.85rem; padding: 0.75rem 0.5rem; }
}

.sub-panel {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.sub-panel h3 {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  font-weight: 700;
}

.sub-panel .field-input { margin-bottom: 0.4rem; }

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237a7a8c'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select.field-input option {
  background: #000000;
  color: #fff;
}

.addr-block { margin-bottom: 1rem; }

.addr-code {
  display: block;
  font-size: 0.72rem;
  word-break: break-all;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.6;
  padding: 0.9rem 1rem;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  bottom: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  height: auto;
  display: flex;
  padding: 0.45rem;
  padding-bottom: calc(0.45rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 255, 157, 0.18);
  border-radius: var(--radius-lg);
  z-index: 100;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.55rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-item.active {
  color: var(--neon-green);
  background: rgba(0, 255, 157, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 157, 0.35), 0 0 14px rgba(0, 255, 157, 0.1);
}

.nav-icon { font-size: 1.1rem; line-height: 1; }

.toast {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon-green);
  color: #000000;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 200;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 255, 157, 0.25);
}

/* Desktop */
@media (min-width: 768px) {
  .desktop-nav { display: flex; }
  .mobile-nav { display: none; }

  #screen-wallet.active,
  #screen-exchange.active,
  #screen-history.active,
  #screen-more.active,
  #screen-p2p.active {
    max-width: 560px;
    padding-bottom: 2rem;
  }

  #screen-p2p.active { max-width: none; }

  .market-preview { grid-template-columns: repeat(3, 1fr); }
  .toast { bottom: 24px; }
}

@media (min-width: 900px) {
  #screen-wallet.active,
  #screen-history.active,
  #screen-more.active { max-width: 860px; }
  #screen-exchange.active { max-width: 520px; }
}

.send-fee-box {
  margin: 0.65rem 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
}
.send-fee-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  padding: 0.25rem 0;
}
.send-fee-row.total { color: #fff; font-weight: 600; margin-top: 0.35rem; padding-top: 0.45rem; border-top: 1px solid rgba(255,255,255,0.08); }
.send-fee-row strong { color: #fff; }
.history-fee { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 0.2rem; }
.p2p-chat-attach { flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #fff; cursor: pointer; }

/* Terms of use */
.auth-legal {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
}
.auth-legal a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.auth-legal a:hover { color: var(--neon-green); }

.terms-doc {
  max-height: 65vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}
.terms-doc h1 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.terms-doc h2 {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--neon-green);
  margin: 1.15rem 0 0.45rem;
}
.terms-doc p { margin-bottom: 0.6rem; }
.terms-doc ul {
  margin: 0.45rem 0 0.6rem 1.15rem;
  padding: 0;
}
.terms-doc li { margin-bottom: 0.3rem; }
.terms-doc .terms-date {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.85rem;
}

.terms-page {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1.25rem 2.5rem;
}
.terms-page-wrap {
  width: 100%;
  max-width: 720px;
  padding: 1.35rem 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
}
.terms-page-wrap .terms-doc {
  max-height: none;
  margin-top: 0.75rem;
}
.terms-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neon-green);
  text-decoration: none;
  transition: opacity var(--transition);
}
.terms-back:hover { opacity: 0.8; color: #fff; }
