/* ═══ DASHBOARD — Bloomberg Terminal Theme ═══
   Подключается ПОСЛЕ style.css. Меняет только визуал, не трогая разметку.
*/

/* ── BACKGROUND TONE — match edge ────────────────────────── */
body {
  background: #08080e;
  font-family: var(--mono);
}

/* ── HEADER — darker, sharper ────────────────────────────── */
.header {
  background: rgba(8,8,14,0.96);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.logo-icon {
  background: linear-gradient(135deg, rgba(99,120,255,0.85), rgba(167,139,250,0.85));
  border-radius: 7px;
}
.logo-sub {
  color: rgba(255,255,255,0.32);
  letter-spacing: .08em;
}

/* ── STATS CARDS — institutional dark ─────────────────────── */
.stats-section { margin-bottom: 10px; }
.stat-card {
  background: rgba(12,12,16,0.95);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s;
}
.stat-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(14,14,20,0.95);
}
.stat-card::before { height: 1px; opacity: 0.7; }
.accent-green::before  { background: linear-gradient(90deg, rgba(74,222,128,0.55), transparent); }
.accent-red::before    { background: linear-gradient(90deg, rgba(248,113,113,0.55), transparent); }
.accent-blue::before   { background: linear-gradient(90deg, rgba(99,120,255,0.55), transparent); }
.accent-amber::before  { background: linear-gradient(90deg, rgba(251,191,36,0.55), transparent); }
.accent-purple::before { background: linear-gradient(90deg, rgba(167,139,250,0.55), transparent); }
.accent-cyan::before   { background: linear-gradient(90deg, rgba(34,211,238,0.55), transparent); }

.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: .14em;
  font-family: var(--mono);
}
.stat-value {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value.green  { color: rgba(74,222,128,0.92); }
.stat-value.red    { color: rgba(248,113,113,0.92); }
.stat-value.blue   { color: rgba(99,120,255,0.92); }
.stat-value.amber  { color: rgba(251,191,36,0.92); }
.stat-value.purple { color: rgba(167,139,250,0.92); }
.stat-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
}

/* ── EV CARD ─────────────────────────────────────────────── */
.ev-value {
  font-family: var(--head);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 5px;
}
.ev-value.green { color: rgba(74,222,128,0.92); }
.ev-value.red   { color: rgba(248,113,113,0.92); }
.ev-row { color: rgba(255,255,255,0.55); font-family: var(--mono); font-size: 12px; }
.ev-item .green { color: rgba(74,222,128,0.88); }
.ev-item .red   { color: rgba(248,113,113,0.88); }

/* ── STREAK ROW ──────────────────────────────────────────── */
.streak-row { gap: 8px; }
.streak-card {
  background: rgba(12,12,16,0.95);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
}
.streak-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: .14em;
  font-family: var(--mono);
}
.streak-val {
  font-family: var(--head);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.streak-val.green { color: rgba(74,222,128,0.92); }
.streak-val.red   { color: rgba(248,113,113,0.92); }
.streak-cur {
  font-family: var(--head);
  font-size: 18px;
  font-weight: 700;
}
.streak-cur.green { color: rgba(74,222,128,0.92); }
.streak-cur.red   { color: rgba(248,113,113,0.92); }

/* ── TAPE (20 trades dots) ───────────────────────────────── */
.streak-tape { gap: 3px; }
.tape-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-block;
}
.tape-dot.win  { background: rgba(74,222,128,0.85); }
.tape-dot.loss { background: rgba(248,113,113,0.85); }
.tape-legend  { font-size: 12px; color: rgba(255,255,255,0.55); }

/* ── UP/DOWN CARD ────────────────────────────────────────── */
.updown-label.up   { color: rgba(74,222,128,0.85); font-family: var(--mono); }
.updown-label.down { color: rgba(248,113,113,0.85); font-family: var(--mono); }
.updown-val {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 700;
}
.updown-sub  { color: rgba(255,255,255,0.55); font-family: var(--mono); font-size: 12px; }
.updown-pnl  { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.updown-pnl.green { color: rgba(74,222,128,0.88); }
.updown-pnl.red   { color: rgba(248,113,113,0.88); }
.updown-divider   { background: rgba(255,255,255,0.06); }

/* ── CHARTS SECTION ──────────────────────────────────────── */
.charts-section { margin-bottom: 12px; }
.chart-card {
  background: rgba(12,12,16,0.95);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
}
.chart-title {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: var(--mono);
  margin-bottom: 10px;
  font-weight: 600;
}

/* ── VOL GRID (W/L block) — no inner borders/backgrounds ──── */
.vol-item {
  background: transparent;
  border: none;
  border-radius: 0;
}
.vol-label { color: rgba(255,255,255,0.55); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.vol-val   { font-family: var(--head); font-weight: 700; }
.vol-val.green  { color: rgba(74,222,128,0.92); }
.vol-val.red    { color: rgba(248,113,113,0.92); }
.vol-val.blue   { color: rgba(99,120,255,0.92); }
.vol-val.amber  { color: rgba(251,191,36,0.92); }
.vol-sub        { font-size: 11px; color: rgba(255,255,255,0.6); font-family: var(--mono); margin-top: 4px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── TRADES SECTION ──────────────────────────────────────── */
.trades-section {
  background: rgba(12,12,16,0.95);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
}
.section-title {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.dot { background: rgba(99,120,255,0.6); }

.ftab {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  color: rgba(255,255,255,0.35);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
  transition: all .15s;
}
.ftab:hover {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
}
.ftab.active {
  background: rgba(99,120,255,0.12);
  border-color: rgba(99,120,255,0.3);
  color: rgba(99,120,255,0.9);
}
.ftab.active.win  { background: rgba(74,222,128,0.1);  border-color: rgba(74,222,128,0.28);  color: rgba(74,222,128,0.9); }
.ftab.active.loss { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.24); color: rgba(248,113,113,0.88); }
.ftab.active.open { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.24);  color: rgba(251,191,36,0.88); }

.btn-export {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  color: rgba(255,255,255,0.6);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
}
.btn-export:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.15);
}
.sort-select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  color: rgba(255,255,255,0.6);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
}

/* ── TRADE CARDS ─────────────────────────────────────────── */
.trade-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.045);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  transition: border-color .15s, background .15s;
}
.trade-card:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}
.trade-card.win  { border-left: 2px solid rgba(74,222,128,0.5); }
.trade-card.loss { border-left: 2px solid rgba(248,113,113,0.5); }
.trade-card.open { border-left: 2px solid rgba(251,191,36,0.5); }

.tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.tag.win  { background: rgba(74,222,128,0.1);   color: rgba(74,222,128,0.9);  border: 1px solid rgba(74,222,128,0.2); }
.tag.loss { background: rgba(248,113,113,0.08); color: rgba(248,113,113,0.9); border: 1px solid rgba(248,113,113,0.2); }
.tag.open { background: rgba(251,191,36,0.08);  color: rgba(251,191,36,0.88); border: 1px solid rgba(251,191,36,0.2); }

.trade-market-name { color: rgba(255,255,255,0.7); font-size: 12px; }
.trade-meta        { color: rgba(255,255,255,0.4); font-family: var(--mono); font-size: 10px; }
.trade-pnl         { font-family: var(--head); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.trade-pnl.green   { color: rgba(74,222,128,0.92); }
.trade-pnl.red     { color: rgba(248,113,113,0.92); }

/* ── PAGINATION ──────────────────────────────────────────── */
.pg-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 5px;
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 11px;
  transition: all .15s;
}
.pg-btn:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.15);
}
.pg-btn.active {
  background: rgba(99,120,255,0.12);
  border-color: rgba(99,120,255,0.3);
  color: rgba(99,120,255,0.95);
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state    { padding: 40px; }
.empty-icon     { color: rgba(255,255,255,0.18); font-size: 32px; }
.empty-text     { color: rgba(255,255,255,0.45); font-family: var(--head); }
.empty-sub      { color: rgba(255,255,255,0.28); font-family: var(--mono); font-size: 11px; }

/* ── WALLET INPUT ────────────────────────────────────────── */
.wallet-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  font-family: var(--mono);
}
.wallet-input:focus {
  border-color: rgba(99,120,255,0.4);
  background: rgba(255,255,255,0.06);
  outline: none;
}
.wallet-input::placeholder { color: rgba(255,255,255,0.25); }
.wallet-load-btn {
  background: rgba(99,120,255,0.18);
  border: 1px solid rgba(99,120,255,0.35);
  border-radius: 6px;
  color: rgba(99,120,255,0.95);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  transition: all .15s;
}
.wallet-load-btn:hover {
  background: rgba(99,120,255,0.28);
  border-color: rgba(99,120,255,0.5);
}
.wallet-save-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.4);
  width: 28px; height: 28px;
  cursor: pointer;
}
.wallet-save-btn.saved {
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.35);
  color: rgba(251,191,36,0.9);
}

/* ── BTC HEADER BADGE ────────────────────────────────────── */
.hdr-btc {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 5px 12px;
}
.hdr-btc-label { color: rgba(255,255,255,0.3); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.hdr-btc-price { color: rgba(251,191,36,0.9); font-family: var(--mono); font-weight: 600; font-size: 13px; }

/* ── POLLING INDICATOR — gentle pulse on BTC badge during refresh ── */
.hdr-btc.polling {
  animation: btcPulse 1.5s ease-in-out infinite;
}
@keyframes btcPulse {
  0%, 100% { border-color: rgba(255,255,255,0.05); }
  50%      { border-color: rgba(99,120,255,0.35); }
}

/* Pagination "…" gap indicator */
.pg-gap {
  display: inline-flex; align-items: center;
  padding: 0 6px;
  color: rgba(255,255,255,0.3);
  font-family: var(--mono);
  font-size: 12px;
  user-select: none;
}

/* Pagination wrap: keep all buttons on one line */
.pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

/* ─────────────────────────────────────────────────────────────
   SHARE BUTTON + MODAL
   ───────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────
   FLOATING SHARE BUTTON — fixed bottom-right, visible always
   ───────────────────────────────────────────────────────────── */

.fab-share {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 950;
  background: linear-gradient(135deg, rgba(99,120,255,0.95), rgba(167,139,250,0.92));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 13px 22px 13px 18px;
  letter-spacing: .02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(99,120,255,0.35);
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.fab-share:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 30px rgba(99,120,255,0.55), 0 0 0 6px rgba(167,139,250,0.15);
}
.fab-icon {
  font-size: 17px;
  font-weight: 800;
  display: inline-block;
  transform: translateY(-1px);
}
.fab-text {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.005em;
}

@media (max-width: 640px) {
  .fab-share { bottom: 18px; right: 18px; padding: 11px 18px 11px 14px; font-size: 12px; }
  .fab-text  { font-size: 13px; }
}

/* Modal */
.share-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.share-modal.open { display: flex; }

.share-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}

.share-box {
  position: relative;
  background: #0c0c12;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.share-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  width: 32px; height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.share-close:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.share-title {
  font-family: var(--head);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin: 0 0 16px;
  letter-spacing: -.01em;
}

.share-preview {
  background: #08080c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}
.share-preview canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.share-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.share-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: .02em;
}
.share-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
.share-btn.primary {
  background: rgba(99,120,255,0.15);
  border-color: rgba(99,120,255,0.5);
  color: rgba(99,180,255,1);
}
.share-btn.primary:hover {
  background: rgba(99,120,255,0.25);
  border-color: rgba(99,120,255,0.7);
}

.share-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(255,255,255,0.35);
  letter-spacing: .02em;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .share-actions { grid-template-columns: 1fr 1fr; }
  .share-box { padding: 18px; }
  .share-title { font-size: 16px; }
}

/* ─────────────────────────────────────────────────────────────
   WIN-RATE HEATMAP (day × hour-bucket)
   ───────────────────────────────────────────────────────────── */

.heatmap-row { margin-top: 8px; }

.heatmap-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 16px 18px;
}

.hm-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.hm-title {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: -.005em;
}
.hm-sub {
  font-family: var(--mono);
  font-size: 12.5px;
  color: rgba(255,255,255,0.4);
  letter-spacing: .04em;
}

.hm-grid {
  display: grid;
  grid-template-columns: 42px repeat(4, 1fr);
  grid-template-rows: 22px repeat(7, 32px);
  gap: 3px;
  position: relative;
}
.hm-grid.empty { min-height: 200px; }
.hm-empty {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  padding: 30px;
}
.hm-corner { background: transparent; }
.hm-h-label, .hm-v-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.hm-h-label { justify-content: center; }
.hm-v-label { justify-content: flex-end; padding-right: 8px; }

.hm-cell {
  position: relative;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: default;
  transition: transform .12s;
}
.hm-cell:hover { transform: scale(1.06); z-index: 2; }
.hm-cell.no-data    { background: rgba(255,255,255,0.025); color: rgba(255,255,255,0.18); }
.hm-cell.low-data   { opacity: 0.55; }
.hm-cell.loss { background: rgba(248,113,113,0.36); color: rgba(255,235,235,0.95); }
.hm-cell.low  { background: rgba(248,113,113,0.18); color: rgba(255,225,225,0.85); }
.hm-cell.neu  { background: rgba(255,255,255,0.07);  color: rgba(255,255,255,0.7); }
.hm-cell.ok   { background: rgba(74,222,128,0.22);   color: rgba(225,255,235,0.92); }
.hm-cell.win  { background: rgba(74,222,128,0.42);   color: rgba(235,255,240,1); }

.hm-cell .hm-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,12,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s;
  z-index: 5;
  font-weight: 500;
}
.hm-cell:hover .hm-tip { opacity: 1; }
.hm-tip-pnl.green { color: rgba(74,222,128,0.92); }
.hm-tip-pnl.red   { color: rgba(248,113,113,0.92); }

.hm-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.hm-leg-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}
.hm-leg-swatch {
  width: 14px; height: 10px; border-radius: 2px;
}
.hm-leg-swatch.loss { background: rgba(248,113,113,0.36); }
.hm-leg-swatch.low  { background: rgba(248,113,113,0.18); }
.hm-leg-swatch.neu  { background: rgba(255,255,255,0.07); }
.hm-leg-swatch.ok   { background: rgba(74,222,128,0.22); }
.hm-leg-swatch.win  { background: rgba(74,222,128,0.42); }
.hm-leg-spacer { flex: 1; min-width: 8px; }
.hm-leg-note {
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
  .hm-grid { grid-template-columns: 36px repeat(4, 1fr); }
  .hm-h-label, .hm-v-label { font-size: 9px; }
  .hm-cell { font-size: 9.5px; }
}

/* Visually hidden, readable by crawlers and screen readers (a11y standard) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Clickable vol-item (Best/Worst Day) */
.vol-item.clickable {
  cursor: pointer;
  position: relative;
  transition: background .15s, transform .12s;
}
.vol-item.clickable:hover {
  background: rgba(255,255,255,0.035);
  transform: translateY(-1px);
}
.vol-item.clickable::after {
  content: '↗';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  transition: color .15s, transform .12s;
}
.vol-item.clickable:hover::after {
  color: rgba(255,255,255,0.65);
  transform: translate(2px, -2px);
}

/* Active date-filter badge in trades header */
.date-filter-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px;
  padding: 4px 10px;
  background: rgba(99,120,255,0.14);
  border: 1px solid rgba(99,120,255,0.4);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(160,180,255,1);
  letter-spacing: .02em;
  white-space: nowrap;
}
.date-filter-badge b {
  color: rgba(200,215,255,1);
  font-weight: 700;
  margin: 0 2px;
}
.date-filter-clear {
  background: transparent;
  border: none;
  color: rgba(160,180,255,0.7);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px 0 4px;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.date-filter-clear:hover { color: rgba(255,255,255,1); }

/* ─── Share modal: field selector chips ──────────────────── */
.share-fields-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.share-fields-label {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.share-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.share-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.share-chip:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}
.share-chip input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin: 0;
  transition: all .15s;
}
.share-chip input[type="checkbox"]:checked {
  background: rgba(99,120,255,0.85);
  border-color: rgba(99,120,255,1);
}
.share-chip input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -2px; left: 1px;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}
.share-chip:has(input:checked) {
  background: rgba(99,120,255,0.14);
  border-color: rgba(99,120,255,0.5);
  color: rgba(180,200,255,1);
}

/* ─────────────────────────────────────────────────────────────
   MOBILE: dashboard layout, stats grid, heatmap, FAB
   ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Reduce overall padding on small screens */
  main, .stats-grid, .charts-section, .heatmap-row { padding: 0 6px; }

  /* Stats grid: 4 cards → 2 wide → 1 wide on phones */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stat-card {
    padding: 12px 14px;
    min-height: 100px;
  }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .stat-sub   { font-size: 11px; }

  /* Streak-row stacks vertically */
  .streak-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .streak-card { padding: 12px 14px; min-height: 90px; }
  .streak-tape-card,
  .updown-card {
    grid-column: 1 / -1; /* full width below the small streak cards */
  }

  /* Charts: stack vertically */
  .charts-section { grid-template-columns: 1fr !important; gap: 6px; }
  .chart-card { padding: 12px 14px 16px; }
  .chart-card.wide { grid-column: span 1 !important; }
  .chart-wrap { height: 180px !important; padding: 4px 2px 0; }
  .vol-grid { grid-template-columns: 1fr 1fr; gap: 6px; }

  /* Heatmap — smaller cells */
  .hm-grid {
    grid-template-columns: 32px repeat(4, 1fr);
    grid-template-rows: 30px repeat(7, 28px);
    gap: 2px;
  }
  .hm-cell { font-size: 9.5px; }
  .hm-h-label, .hm-v-label { font-size: 8.5px; }
  .hm-v-label { padding-right: 4px; }
  .hm-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hm-legend { gap: 6px 10px; }
  .hm-leg-item { font-size: 9px; }
  .hm-leg-note { display: none; } /* not enough room */

  /* FAB share btn — compact, doesn't get cut off */
  .fab-share {
    bottom: 12px;
    right: 12px;
    padding: 9px 14px 9px 12px;
    font-size: 11.5px;
    gap: 6px;
    max-width: calc(100vw - 24px);
  }
  .fab-text { font-size: 12px; white-space: nowrap; }
  .fab-icon { font-size: 14px; }

  /* Trades section: tighter padding, smaller font in rows */
  .trades-section { padding: 12px; }
  .trade-row { padding: 10px 8px; font-size: 11.5px; }
  .trades-header { flex-wrap: wrap; gap: 6px; }
  .ftab { padding: 6px 10px; font-size: 11px; }

  /* Share modal full-screen on phone */
  .share-modal .share-box {
    max-width: 100% !important;
    margin: 10px;
    padding: 16px;
  }
  .share-chips { gap: 4px; }
  .share-chip  { font-size: 11px; padding: 5px 10px; }
  .share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .share-actions .share-btn { font-size: 11px; padding: 9px 12px; }

  /* SR-only block remains hidden anyway */
}

@media (max-width: 480px) {
  /* Stats can stay 2 cols here, but tighter spacing */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .streak-row { grid-template-columns: 1fr 1fr; }
  .vol-grid   { grid-template-columns: 1fr 1fr; }
  /* Heatmap labels even smaller */
  .hm-grid {
    grid-template-columns: 28px repeat(4, 1fr);
    grid-template-rows: 26px repeat(7, 24px);
  }
  .hm-cell { font-size: 9px; }
  .hm-h-label { font-size: 8px; line-height: 1.05; }
}

/* Single column only on really tiny screens */
@media (max-width: 340px) {
  .stats-grid { grid-template-columns: 1fr; }
  .streak-row { grid-template-columns: 1fr; }
}



/* ─── Safety net: if vol-grid is rendered inside chart-wrap, let chart-wrap grow ─── */
.chart-wrap:has(.vol-grid) {
  height: auto !important;
  min-height: 120px;
}
.vol-grid {
  height: auto !important;
  padding: 0 !important;
}
.vol-item { padding: 6px 0; }
.vol-val { font-size: 18px; }

/* Trade Size chart: ensure y-axis labels don't overlap title */
.chart-card:has(#sizeChart) .chart-wrap { padding-top: 2px; }

/* ─── Mobile: gap between header (wallet input row) and first stat block ─── */
@media (max-width: 768px) {
  .main { padding-top: 28px; }
  .stats-grid { margin-top: 8px; }
}

/* ─── Clean 2-col Avg W / Avg L grid (replaces old inline ev-row) ─── */
.ev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.ev-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.ev-cell-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}
.ev-cell-val {
  font-family: var(--head);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.ev-cell-val.green { color: rgba(74,222,128,0.95); }
.ev-cell-val.red   { color: rgba(248,113,113,0.95); }

@media (max-width: 480px) {
  .ev-grid { gap: 8px; padding-top: 8px; margin-top: 8px; }
  .ev-cell-val { font-size: 16px; }
  .ev-cell { min-width: 0; overflow: hidden; }
  .ev-cell-val { text-overflow: ellipsis; overflow: hidden; }
}
@media (max-width: 360px) {
  .ev-cell-val { font-size: 14px; }
}

/* ═══ HEADER CLEANUP — скрыть BTC-бейдж, перекомпоновать шапку (desktop) ═══ */
.hdr-btc { display: none; }

@media (min-width: 769px) {
  .header        { gap: 7px; }
  .logo          { margin-right: 12px; }
  .header-center { order: 5; }
  .app-social    { order: 10; }
  .lang-switcher { order: 11; }
  .header-right  {
    order: 20;
    gap: 8px;
    margin-left: 0;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,0.08);
  }
}
