/* ===== CABINET ===== */
.cabinet-body {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 40px;
  overflow-x: hidden;
  max-width: 100vw;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

/* ─── Header ─── */
.cab-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,12,24,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(60px + env(safe-area-inset-top, 0px));
  flex-wrap: nowrap; overflow-x: auto;
}
/* Nudge content down from safe area on the page itself */
.cab-main {
  padding-top: 24px;
}
.cab-logo {
  font-family: var(--font-tech); font-size: 18px; font-weight: 700;
  color: var(--text); white-space: nowrap; flex-shrink: 0;
}
.cab-logo span { color: var(--orange); }

.cab-nav-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
.cab-nav-tabs::-webkit-scrollbar { display: none; }
.cnt {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  color: var(--text2); font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: var(--transition); flex-shrink: 0;
}
.cnt i { font-size: 12px; }
.cnt:hover { color: var(--text); background: var(--bg4); }
.cnt.active { color: var(--orange); background: var(--orange-dim); }

.cab-header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }
.cab-balance {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg4); border: 1px solid var(--orange-glow);
  border-radius: 8px; padding: 6px 12px;
  font-family: var(--font-tech); font-size: 15px; font-weight: 700; color: var(--orange);
}
.cab-balance i { font-size: 13px; }
.cab-balance-unit { font-size: 11px; color: var(--text3); }
.cab-user-info { display: flex; align-items: center; gap: 8px; }
.cab-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #000; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-tech);
}
.cab-username { font-size: 13px; font-weight: 600; color: var(--text); }
.cab-exit-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.cab-exit-btn:hover { border-color: var(--orange); color: var(--orange); }

/* ─── Main ─── */
.cab-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* ─── Tabs ─── */
.cab-tab { display: none; animation: fade-in-up 0.35s ease; }
.cab-tab.active { display: block; }

.cab-section-title {
  font-family: var(--font-heading); font-size: 22px; font-weight: 700;
  color: var(--text); display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.cab-section-title i { color: var(--orange); }
.cab-refresh-btn {
  margin-left: auto; width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid var(--border);
  color: var(--text3); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.cab-refresh-btn:hover { border-color: var(--orange); color: var(--orange); }

/* ─── Portfolio Overview ─── */
.port-overview-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.port-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.port-total { border-color: var(--orange-glow); background: linear-gradient(135deg, var(--card), #1a2a50); }
.port-card-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.port-card-val { font-family: var(--font-tech); font-size: 22px; font-weight: 700; color: var(--text); }
.port-card-change { font-size: 12px; font-weight: 600; margin-top: 4px; }
.port-card-change.up { color: var(--green); }
.port-card-change.down { color: var(--red); }
.port-card-change.neutral { color: var(--text3); }

.port-chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 24px; }
.port-chart-card, .port-alloc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.pcc-title { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 12px; }
.pcc-chart-wrap { height: 160px; position: relative; }
.alloc-chart-wrap { height: 160px; position: relative; }

.port-holdings-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.port-holdings { display: flex; flex-direction: column; gap: 8px; }
.port-empty {
  text-align: center; padding: 48px 20px;
  color: var(--text3);
}
.port-empty i { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }
.port-empty p { font-size: 14px; margin-bottom: 16px; }
.btn-goto-market {
  padding: 10px 24px; background: var(--orange-dim);
  border: 1px solid var(--orange); border-radius: var(--radius);
  color: var(--orange); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-goto-market:hover { background: var(--orange); color: #000; }

.holding-card {
  display: grid; grid-template-columns: auto 1fr auto auto auto;
  gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
  transition: var(--transition); cursor: default;
}
.holding-card:hover { border-color: var(--border-bright); background: var(--card-hover); }
.hc-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: var(--bg4); }
.hc-info .hc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.hc-info .hc-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.hc-val { text-align: right; }
.hc-price { font-family: var(--font-tech); font-size: 14px; font-weight: 700; color: var(--text); }
.hc-buy-price { font-size: 11px; color: var(--text3); }
.hc-pl { text-align: right; }
.hc-pl-val { font-size: 13px; font-weight: 700; }
.hc-pl-val.up { color: var(--green); }
.hc-pl-val.down { color: var(--red); }
.hc-roi { font-size: 11px; }
.hc-roi.up { color: var(--green); }
.hc-roi.down { color: var(--red); }
.hc-actions { display: flex; gap: 6px; }
.hc-sell-btn {
  padding: 6px 12px; background: var(--red-dim);
  border: 1px solid var(--red); border-radius: 6px;
  color: var(--red); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.hc-sell-btn:hover { background: var(--red); color: #fff; }
.hc-exch-btn {
  padding: 6px 12px; background: var(--cyan-dim);
  border: 1px solid var(--cyan); border-radius: 6px;
  color: var(--cyan); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.hc-exch-btn:hover { background: var(--cyan); color: #000; }

/* ─── Market in cabinet ─── */
.cab-market-controls {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.cab-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 12px; height: 38px; flex: 1;
}
.cab-search:focus-within { border-color: var(--orange); }
.cab-search i { color: var(--text3); font-size: 13px; }
.cab-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.cab-select {
  height: 38px; padding: 0 32px 0 12px;
  background: var(--bg4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238896b3'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 13px; appearance: none; outline: none;
}
.cab-select:focus { border-color: var(--orange); }
.cab-select option { background: var(--bg3); }

.cab-market-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.cab-item-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition); cursor: pointer;
}
.cab-item-card:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 20px var(--orange-dim); }
.cab-item-card .item-rarity-bar { height: 3px; }
.cab-item-card .ci-art { height: 85px; display: flex; align-items: center; justify-content: center; }
.cab-item-card .ci-art img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cab-item-card .ci-info { padding: 0 10px 10px; }
.cab-item-card .ci-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-item-card .ci-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cab-item-card .ci-price { font-family: var(--font-tech); font-size: 13px; font-weight: 700; color: var(--text); }
.cab-item-card .ci-change { font-size: 11px; font-weight: 700; }
.cab-item-card .ci-change.up { color: var(--green); }
.cab-item-card .ci-change.down { color: var(--red); }
.cab-buy-btn {
  width: calc(100% - 20px); margin: 0 10px 10px;
  padding: 8px; background: var(--orange-dim);
  border: 1px solid var(--orange); border-radius: 6px;
  color: var(--orange); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.cab-buy-btn:hover { background: var(--orange); color: #000; }

/* ─── Sell ─── */
.sell-info-bar {
  background: rgba(0,200,240,0.08); border: 1px solid rgba(0,200,240,0.2);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; color: var(--text2); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.sell-info-bar i { color: var(--cyan); }
.cab-sell-grid { display: flex; flex-direction: column; gap: 8px; }
.sell-item-card {
  display: grid; grid-template-columns: auto 1fr auto auto auto;
  gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
}
.si-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: var(--bg4); }
.si-name { font-size: 13px; font-weight: 600; color: var(--text); }
.si-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.si-buy-price { font-size: 12px; color: var(--text3); text-align: right; }
.si-cur-price { font-family: var(--font-tech); font-size: 14px; font-weight: 700; color: var(--text); text-align: right; }
.si-payout { font-size: 12px; color: var(--text3); }
.si-sell-btn {
  padding: 8px 16px; background: var(--red-dim);
  border: 1px solid var(--red); border-radius: 6px;
  color: var(--red); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.si-sell-btn:hover { background: var(--red); color: #fff; }

/* ─── Exchange ─── */
.exchange-layout {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 16px; align-items: start; margin-bottom: 20px;
}
.exchange-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  min-height: 200px;
}
.ex-panel-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.ex-panel-title i { color: var(--orange); }
.ex-panel-hint { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.exchange-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--orange); padding-top: 80px;
}
.ex-item-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.ex-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
  cursor: pointer; transition: var(--transition);
}
.ex-item:hover { border-color: var(--orange); background: var(--orange-dim); }
.ex-item.selected { border-color: var(--orange); background: var(--orange-dim); }
.ex-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: var(--bg3); }
.ex-item-info { flex: 1; }
.ex-item-name { font-size: 12px; font-weight: 600; color: var(--text); }
.ex-item-price { font-size: 11px; color: var(--orange); font-family: var(--font-tech); }

.exchange-summary {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  margin-top: 16px;
}
.ex-sum-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text2);
}
.ex-sum-row:last-of-type { border-bottom: none; }
.ex-sum-row.bold { color: var(--text); font-weight: 700; font-size: 16px; }
.btn-exchange-confirm {
  width: 100%; margin-top: 16px; padding: 14px;
  background: linear-gradient(135deg, var(--cyan), #0090b0);
  color: #000; font-size: 15px; font-weight: 800;
  border-radius: var(--radius-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.btn-exchange-confirm:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ─── Deposit ─── */
/* TRC20 banner */
.dep-trc20-banner {
  display: flex; align-items: center; gap: 14px;
  background: rgba(38,161,123,0.08); border: 1px solid rgba(38,161,123,0.3);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 20px;
  max-width: 480px;
}
.dep-trc20-icon { font-size: 22px; color: #26a17b; flex-shrink: 0; }
.dep-trc20-title { font-size: 14px; font-weight: 700; color: #26a17b; }
.dep-trc20-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.dep-trc20-badge {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-tech); font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(38,161,123,0.15); color: #26a17b;
  border: 1px solid rgba(38,161,123,0.4);
}

.deposit-crypto-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.dct {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; background: var(--bg4);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text2); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition); font-family: var(--font-tech);
}
.dct:hover { border-color: var(--border-bright); color: var(--text); }
.dct.active { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.dct-icon {
  font-size: 16px; font-weight: 900;
}
.usdt-icon { color: #26a17b; }
.btc-icon { color: #f7931a; }
.eth-icon { color: #627eea; }
.dct-net {
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 4px; background: rgba(38,161,123,0.12); color: #26a17b;
  border: 1px solid rgba(38,161,123,0.25);
}

.deposit-form {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px;
  max-width: 480px;
}
.dep-amount-label { font-size: 13px; color: var(--text3); margin-bottom: 8px; }
.dep-amount-input-wrap {
  display: flex; align-items: center; gap: 0;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.dep-amount-input-wrap:focus-within { border-color: var(--orange); }
.dep-amount-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 20px; font-weight: 700;
  font-family: var(--font-tech); padding: 12px 14px;
}
.dep-unit {
  padding: 0 14px; font-size: 13px; font-weight: 700;
  color: var(--orange); background: var(--orange-dim);
  border-left: 1px solid var(--orange-glow); align-self: stretch;
  display: flex; align-items: center;
}
.dep-quick-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.dep-quick-btns button {
  padding: 6px 14px; background: var(--bg4);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text2); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition); font-family: var(--font-tech);
}
.dep-quick-btns button:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }
.dep-rate-info {
  font-size: 12px; color: var(--text3);
  background: var(--bg4); border-radius: 6px;
  padding: 8px 12px; margin-bottom: 14px;
}
.btn-dep-generate {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #000; font-size: 14px; font-weight: 800;
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.btn-dep-generate:hover { filter: brightness(1.05); }

.dep-address-card {
  max-width: 480px; background: var(--card);
  border: 1px solid var(--orange-glow); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 24px;
}
.dac-header { text-align: center; margin-bottom: 16px; }
.dac-crypto-badge {
  display: inline-block; font-family: var(--font-tech);
  font-size: 12px; font-weight: 800; padding: 4px 12px;
  border-radius: 4px; background: var(--orange-dim); color: var(--orange);
  border: 1px solid var(--orange); margin-bottom: 8px;
}
.dac-amount { font-family: var(--font-tech); font-size: 28px; font-weight: 700; color: var(--text); }
.dac-bucks { font-size: 13px; color: var(--text3); margin-top: 4px; }

.dac-network-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); margin-bottom: 16px;
  background: var(--bg4); border-radius: var(--radius); padding: 8px 12px;
}
.dac-network-row i { color: var(--cyan); }
.dac-network-row strong { color: #26a17b; }

/* QR image */
.dac-qr-wrap { text-align: center; margin-bottom: 16px; }
.dac-qr-img {
  width: 160px; height: 160px;
  border-radius: 12px; padding: 8px;
  background: #fff; display: block; margin: 0 auto;
}

/* QR code grid (fallback) */
.dac-qr {
  width: 140px; height: 140px; margin: 0 auto 16px;
  display: grid; background: #fff; padding: 10px;
  border-radius: 8px;
  grid-template-columns: repeat(14, 1fr);
  gap: 0;
}
.qr-cell { background: #fff; }
.qr-cell.b { background: #000; }

/* Deposit steps */
.dac-steps {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
}
.dac-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text2);
}
.dac-step-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--orange-dim); border: 1px solid var(--orange);
  color: var(--orange); font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.dac-address-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.dac-address {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  margin-bottom: 12px;
}
#dacAddressText {
  flex: 1; font-family: monospace; font-size: 12px;
  color: var(--cyan); word-break: break-all;
}
.dac-copy {
  flex-shrink: 0; padding: 4px 8px;
  background: var(--cyan-dim); border: 1px solid var(--cyan);
  border-radius: 4px; color: var(--cyan); font-size: 12px;
  cursor: pointer; transition: var(--transition);
}
.dac-copy:hover { background: var(--cyan); color: #000; }
.dac-warning {
  background: rgba(255,193,7,0.07); border: 1px solid rgba(255,193,7,0.25);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: #ffc107;
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 14px;
}
.btn-dep-confirm {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--green), #00a86b);
  color: #000; font-size: 15px; font-weight: 800;
  border-radius: var(--radius-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.btn-dep-confirm:hover { filter: brightness(1.08); transform: translateY(-1px); }

.dep-history-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.dep-history-list { display: flex; flex-direction: column; gap: 8px; max-width: 480px; }
.dep-hist-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.dhi-crypto {
  font-family: var(--font-tech); font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px; min-width: 48px; text-align: center;
}
.dhi-crypto.usdt { background: rgba(38,161,123,0.15); color: #26a17b; border: 1px solid rgba(38,161,123,0.3); }
.dhi-crypto.btc { background: rgba(247,147,26,0.15); color: #f7931a; border: 1px solid rgba(247,147,26,0.3); }
.dhi-crypto.eth { background: rgba(98,126,234,0.15); color: #627eea; border: 1px solid rgba(98,126,234,0.3); }
.dhi-amount { font-family: var(--font-tech); font-size: 14px; font-weight: 700; color: var(--green); }
.dhi-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.dhi-status.pending { background: rgba(255,193,7,0.1); color: #ffc107; }
.dhi-status.confirmed { background: var(--green-dim); color: var(--green); }
.dhi-date { font-size: 11px; color: var(--text3); margin-left: auto; }

/* ─── History ─── */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.hist-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: var(--transition);
}
.hist-item:hover { border-color: var(--border-bright); }
.hist-type-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.hist-type-icon.buy { background: var(--green-dim); color: var(--green); }
.hist-type-icon.sell { background: var(--red-dim); color: var(--red); }
.hist-type-icon.deposit { background: rgba(0,200,240,0.1); color: var(--cyan); }
.hist-type-icon.bonus { background: var(--orange-dim); color: var(--orange); }
.hist-type-icon.exchange { background: rgba(136,71,255,0.1); color: var(--restricted); }
.hist-info { flex: 1; }
.hist-notes { font-size: 13px; font-weight: 500; color: var(--text); }
.hist-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
.hist-amount { font-family: var(--font-tech); font-size: 14px; font-weight: 700; }
.hist-amount.pos { color: var(--green); }
.hist-amount.neg { color: var(--red); }
.hist-item-img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: var(--bg4); flex-shrink: 0; }

/* ─── Buy Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 2000;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.trade-modal {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: min(480px, 100%); background: var(--bg2);
  border: 1px solid var(--border); border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 2001; transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
}
.trade-modal.open { transform: translateX(-50%) translateY(0); }
.tm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tm-header h3 { font-size: 18px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tm-header h3 i { color: var(--orange); }
.tm-close { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.08); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.tm-close:hover { background: rgba(255,255,255,0.15); }
.tm-item-row { display: flex; align-items: center; gap: 14px; background: var(--bg4); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.tm-item-row img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--bg3); }
.tm-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.tm-item-price { font-size: 13px; color: var(--orange); margin-top: 4px; font-family: var(--font-tech); }
.tm-qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; color: var(--text2); }
.qty-control { display: flex; align-items: center; gap: 0; }
.qty-control button { width: 36px; height: 36px; background: var(--bg4); border: 1px solid var(--border); color: var(--text); font-size: 18px; cursor: pointer; transition: var(--transition); }
.qty-control button:first-child { border-radius: 8px 0 0 8px; }
.qty-control button:last-child { border-radius: 0 8px 8px 0; }
.qty-control button:hover { border-color: var(--orange); color: var(--orange); }
.qty-control input { width: 50px; height: 36px; background: var(--bg4); border: 1px solid var(--border); border-left: none; border-right: none; color: var(--text); font-size: 14px; font-weight: 700; text-align: center; outline: none; font-family: var(--font-tech); }
.tm-total-row { font-size: 14px; color: var(--text2); margin-bottom: 8px; }
.tm-total-row strong { color: var(--orange); font-family: var(--font-tech); font-size: 16px; }
.tm-balance-row { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.btn-buy-confirm {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #000; font-size: 15px; font-weight: 800;
  border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition); box-shadow: 0 4px 20px var(--orange-glow);
}
.btn-buy-confirm:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ─── Toast ─── */
.cab-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 20px;
  font-size: 14px; font-weight: 600; color: var(--text);
  z-index: 3000; opacity: 0; pointer-events: none;
  transition: all 0.3s ease; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.cab-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cab-toast.success { border-color: var(--green); color: var(--green); }
.cab-toast.error { border-color: var(--red); color: var(--red); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .port-overview-grid { grid-template-columns: 1fr 1fr; }
  .port-chart-row { grid-template-columns: 1fr; }
  .exchange-layout { grid-template-columns: 1fr; }
  .exchange-arrow { padding-top: 0; padding: 8px 0; transform: rotate(90deg); }
  .holding-card { grid-template-columns: auto 1fr; }
  .holding-card > :nth-child(3), .holding-card > :nth-child(4) { display: none; }
}
@media (max-width: 600px) {
  .port-overview-grid { grid-template-columns: 1fr 1fr; }
  .cab-market-grid { grid-template-columns: repeat(2, 1fr); }
  .deposit-crypto-tabs { flex-wrap: wrap; }
  .cab-header { padding: 0 12px; gap: 8px; }
  .cnt span { display: none; }
  .cnt { padding: 8px; }
  .sell-item-card { grid-template-columns: auto 1fr auto; }
  .sell-item-card > :nth-child(4) { display: none; }
}
