/* ── Variables ── */
:root {
  --bg-from: #0f0c29;
  --bg-to: #302b63;
  --accent: #00f5a0;
  --accent2: #00c97d;
  --purple: #7b2ff7;
  --purple2: #9d55ff;
  --danger: #ff4757;
  --warn: #ffa502;
  --green: #00f5a0;
  --red: #ff4757;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.5);
  --glass-bg: rgba(255,255,255,0.06);
  --glass-bg2: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.1);
  --border: rgba(255,255,255,0.08);
  /* legacy compat */
  --bg: #0f0c29;
  --bg2: rgba(255,255,255,0.06);
  --bg3: rgba(255,255,255,0.04);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
html {
  height: 100%;
  /* solid fallback for overscroll on iOS */
  background: #0f0c29;
}
body { overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: transparent;
  color: var(--text);
  min-height: 100vh;
}
/* Fixed gradient background — works on iOS Safari unlike background-attachment:fixed */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 100%);
}
a { text-decoration: none; color: inherit; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,12,41,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1.25rem; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--accent), var(--purple2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: 12px; font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00c97d);
  color: #0a0e1a;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--accent);
  border: 1px solid rgba(0,245,160,0.4);
}
.btn-outline:hover { background: rgba(0,245,160,0.1); }
.btn-danger { background: linear-gradient(135deg, #ff4757, #c0392b); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-purple { background: linear-gradient(135deg, var(--purple), var(--purple2)); color: #fff; }
.btn-purple:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; border-radius: 10px; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; filter: none !important; }

/* ── Glass Card ── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
/* legacy compat */
.card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 1.5rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .4rem; font-weight: 500; }
.form-input {
  width: 100%; padding: .75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--text); font-size: .95rem;
  outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: rgba(0,245,160,0.5); }
.form-input::placeholder { color: var(--muted); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: rgba(0,245,160,0.12); color: var(--green); border: 1px solid rgba(0,245,160,0.25); }
.badge-red { background: rgba(255,71,87,0.12); color: var(--red); border: 1px solid rgba(255,71,87,0.25); }
.badge-warn { background: rgba(255,165,2,0.12); color: var(--warn); border: 1px solid rgba(255,165,2,0.25); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--muted); border: 1px solid var(--glass-border); }

/* ── Toggle ── */
.toggle { position: relative; width: 52px; height: 28px; }
.toggle input { display: none; }
.toggle-slider { position: absolute; inset: 0; background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); border-radius: 999px; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; background: var(--muted); border-radius: 50%; top: 3px; left: 3px; transition: .3s; }
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { background: #0a0e1a; transform: translateX(24px); }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; padding-top: 58px; }

/* ── Sidebar (desktop) ── */
.sidebar {
  width: 220px;
  background: rgba(15,12,41,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem 1rem;
  position: fixed; top: 58px; bottom: 0; overflow-y: auto;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: 12px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: all .2s; margin-bottom: .25rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sidebar-link.active { background: rgba(0,245,160,0.1); color: var(--accent); }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.main-content { margin-left: 220px; flex: 1; padding: 1.5rem 1.5rem 2rem; }

/* ── Stats Scroll ── */
.stats-scroll {
  display: flex; gap: .85rem;
  overflow-x: auto; padding-bottom: .35rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.stats-scroll::-webkit-scrollbar { display: none; }
.stat-pill {
  flex: 0 0 auto; min-width: 140px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .35s ease both;
}
.stat-pill .s-label { font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.stat-pill .s-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.5px; }
.stat-pill .s-value.green { color: var(--green); }
.stat-pill .s-value.red { color: var(--red); }
.stat-pill .s-value.purple { color: var(--purple2); }

/* legacy compat */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px; padding: 1rem 1.2rem; }
.stat-label { font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.stat-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.5px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

/* ── Agent Card ── */
.agent-card {
  background: linear-gradient(135deg, rgba(123,47,247,0.2), rgba(0,245,160,0.08));
  border: 1px solid rgba(123,47,247,0.3);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .4s ease both;
}
.agent-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.agent-info { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.agent-activity {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: .5rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .71rem;
  max-height: 6.2rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.agent-activity::-webkit-scrollbar { width: 3px; }
.agent-activity::-webkit-scrollbar-track { background: transparent; }
.agent-activity::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.agent-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

/* ── Winrate Card ── */
.winrate-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: .85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .85rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .45s ease both;
}
.mini-donut-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.mini-donut-wrap canvas { position: absolute; inset: 0; }
.winrate-info { flex: 1; }
.winrate-pct { font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: -.5px; line-height: 1; }
.winrate-sub { font-size: .72rem; color: var(--muted); margin-top: .12rem; }
.winrate-legend-row { display: flex; gap: .65rem; }
.winrate-legend-row span { font-size: .7rem; color: var(--muted); display: flex; align-items: center; gap: .25rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Position Items ── */
.positions-list { display: flex; flex-direction: column; gap: .6rem; }
.position-item {
  display: flex; flex-direction: row; align-items: center; gap: .6rem;
  padding: .6rem .85rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .3s ease both;
  transition: background .2s;
}
.position-item:hover { background: rgba(255,255,255,0.06); }
.pos-badge {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 24px; border-radius: 5px; flex-shrink: 0; font-size: .65rem; font-weight: 800;
}
.pos-badge.long { background: rgba(0,245,160,0.18); border: 1px solid rgba(0,245,160,0.35); color: var(--green); }
.pos-badge.short { background: rgba(255,71,87,0.22); border: 1px solid rgba(255,71,87,0.4); color: var(--red); }
.pos-badge-arrow { display:none; }
.pos-badge-dir { font-size: .62rem; font-weight: 800; }
.pos-mid { display: flex; flex-direction: column; gap: 0; min-width: 0; flex: 1; }
.pos-symbol { font-weight: 700; font-size: .75rem; color: var(--text); white-space:nowrap; }
.pos-pnl { font-weight: 700; font-size: .75rem; }
.pos-right { display: flex; align-items: center; flex-shrink: 0; }
.close-pos-btn, .pnd-close-btn, .trend-close-btn {
  font-size: .62rem; padding: .25rem .5rem; border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.5);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.close-pos-btn:active, .pnd-close-btn:active, .trend-close-btn:active { background: rgba(255,255,255,0.15); }

/* ── Positions Section ── */
.positions-section { animation: fadeUp .5s ease both; margin-bottom: 1.5rem; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .85rem;
}
.section-header h3 { font-size: .95rem; font-weight: 700; }
.refresh-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border);
  color: var(--muted); padding: .3rem .7rem; border-radius: 8px;
  cursor: pointer; font-size: .78rem; transition: all .2s;
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .icon { font-size: 2.2rem; margin-bottom: .6rem; }
.empty-state p { font-size: .88rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; padding: .75rem 1rem; color: var(--muted); font-weight: 600; font-size: .78rem; border-bottom: 1px solid var(--glass-border); }
td { padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Alerts ── */
.alert { padding: .75rem 1rem; border-radius: 12px; font-size: .88rem; margin-bottom: 1rem; }
.alert-error { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.25); color: #ff7a85; }
.alert-success { background: rgba(0,245,160,0.1); border: 1px solid rgba(0,245,160,0.25); color: var(--accent); }

/* ── Misc ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.pos-side.long { color: var(--green); font-weight: 700; }
.pos-side.short { color: var(--red); font-weight: 700; }
.pnl-pos { color: var(--green); font-weight: 600; }
.pnl-neg { color: var(--red); font-weight: 600; }
.pos-pnl-wrap { display: flex; flex-direction: column; align-items: flex-end; flex: 1; gap: .05rem; }
.pos-pct { font-size: .68rem; font-weight: 600; opacity: .8; }

/* ── Auth ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 2.2rem; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--purple2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-logo p { color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }
.auth-footer a { color: var(--accent); }

/* ── Spinner ── */
.spinner { width: 18px; height: 18px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom Nav (mobile only) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,12,41,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: .45rem 0;
  padding-bottom: calc(.45rem + env(safe-area-inset-bottom));
}
.bottom-nav-inner { display: flex; justify-content: space-around; }
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: .4rem .8rem; border-radius: 12px;
  color: var(--muted); font-size: .65rem; font-weight: 600;
  text-decoration: none; transition: color .2s;
  cursor: pointer; background: none; border: none;
}
.bnav-item.active { color: var(--accent); }
.bnav-item svg { width: 22px; height: 22px; }
.mobile-menu-btn { background: none; border: none; color: var(--text); cursor: pointer; padding: .25rem; display: none; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 49; display: none; }

/* ── Card Header ── */
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: .92rem; font-weight: 700; }

/* ── History page ── */
.summary-row { display: flex; gap: .85rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1.25rem; scrollbar-width: none; }
.summary-row::-webkit-scrollbar { display: none; }
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: .3rem .85rem; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); color: var(--muted); cursor: pointer; font-size: .8rem; transition: all .2s; }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(0,245,160,0.08); }
.chart-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 20px; padding: 1.25rem; margin-bottom: 1.25rem; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.chart-card h3 { font-size: .92rem; font-weight: 700; margin-bottom: 1rem; }
.history-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 20px; overflow: hidden; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.load-more { width: 100%; padding: .85rem; background: none; border: none; border-top: 1px solid var(--glass-border); color: var(--muted); cursor: pointer; font-size: .88rem; transition: color .2s; }
.load-more:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; z-index: 50; top: 58px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding: 1rem 1rem 6rem; }
  .mobile-menu-btn { display: none; }
  .bottom-nav { display: block; }
  .hide-mobile { display: none; }
  .agent-top { flex-wrap: wrap; }
}
@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
}

@media (max-width: 480px) {
  .winrate-pct { font-size: 1.35rem; }
  .stat-pill { min-width: 130px; }
  .stat-pill .s-value { font-size: 1.25rem; }
  .agent-card { gap: .6rem; }
  .agent-top { width: 100%; }
  .nav { padding: 0 1rem; }
}
/* ── Mobile Overflow Fix ── */
*, *::before, *::after { box-sizing: border-box; }
canvas { max-width: 100%; display: block; }
img, video, iframe { max-width: 100%; }
.app-layout { overflow-x: hidden; max-width: 100vw; }
.main-content { min-width: 0; max-width: 100%; }
.stats-scroll, .summary-row { max-width: 100%; }
.winrate-card { max-width: 100%; }
.agent-card { max-width: 100%; overflow: hidden; }
.blp-card { max-width: 100%; }
.blp-report-card { max-width: 100%; }
input[type=number], input[type=text], input[type=email], input[type=password], select, textarea { width: 100%; min-width: 0; }
.positions-list { max-width: 100%; }

@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .main-content { margin-left: 0 !important; width: 100% !important; max-width: 100vw; padding: .85rem .85rem 6rem; }
  .winrate-pct { font-size: 1.3rem; }
  .stat-pill { min-width: 125px; padding: .85rem 1rem; }
  .stat-pill .s-value { font-size: 1.2rem; }
  .agent-card { padding: .9rem 1rem; }
  .positions-section { max-width: 100%; }
  .position-item { padding: .7rem .85rem; }
  table { font-size: .82rem; }
  th, td { padding: .6rem .75rem; }
  .blp-report-card { padding: .9rem 1rem; }
  .blp-report-header { flex-direction: column; gap: .65rem; }
  .blp-saved-box { text-align: left; width: 100%; }
  .blp-saved-value { font-size: 1.15rem; }
  .blp-report-row { flex-wrap: wrap; gap: .3rem; }
  .blp-report-time { text-align: left; flex: none; width: 100%; }
}

/* ── Agent Activity Feed ── */
.act-line {
  color: rgba(255,255,255,0.5);
  line-height: 1.4rem;
  padding: 0 .1rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.act-line:last-child { color: rgba(255,255,255,0.88); }
.act-line.slide-in { animation: slideInLine .25s ease both; }
@keyframes slideInLine {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BLP Agent Card ── */
.blp-card {
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(251,191,36,0.04));
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .5s ease both;
}
.blp-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.blp-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.blp-intensity-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding-top: .4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.blp-intensity-label { font-size: .72rem; font-weight: 700; color: var(--muted); }
.blp-intensity-hint  { font-size: .68rem; color: rgba(255,255,255,0.3); margin-left: .25rem; }
.intensity-pills { display: flex; gap: .3rem; }
.intensity-btn {
  padding: .22rem .7rem; font-size: .72rem; font-weight: 700;
  border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(217,119,6,0.25);
  background: transparent; color: var(--muted);
  transition: all .15s;
}
.intensity-btn.active {
  background: rgba(217,119,6,0.18);
  border-color: #d97706;
  color: #f59e0b;
}
.intensity-btn:hover:not(.active) { border-color: rgba(217,119,6,0.5); color: #f59e0b; }

/* BLP toggle buttons */
.btn-blp-off {
  background: rgba(217,119,6,0.1); color: #f59e0b;
  border: 1px solid rgba(217,119,6,0.35);
}
.btn-blp-off:hover { background: rgba(217,119,6,0.2); }
.btn-blp-on {
  background: rgba(220,38,38,0.12); color: #f87171;
  border: 1px solid rgba(220,38,38,0.3);
}
.btn-blp-on:hover { background: rgba(220,38,38,0.22); }

/* Dot colors */
.dot-orange { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-gray   { background: rgba(255,255,255,0.2); box-shadow: none; }

@media (max-width: 480px) {
  .blp-card { padding: .9rem 1rem; }
  .blp-intensity-row { gap: .45rem; }
}

/* BLP Toggle Switch */
.blp-switch { position:relative; display:inline-block; width:58px; height:32px; cursor:pointer; flex-shrink:0; }
.blp-switch input { opacity:0; width:0; height:0; position:absolute; }
.blp-slider { position:absolute; top:0; left:0; right:0; bottom:0; background:#555; border-radius:32px; transition:.3s; }
.blp-slider:before { content:""; position:absolute; height:26px; width:26px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; box-shadow:0 2px 6px rgba(0,0,0,.3); }
.blp-switch input:checked + .blp-slider { background:#4a9eff; }
.blp-switch input:checked + .blp-slider:before { transform:translateX(26px); }
.blp-switch input:disabled + .blp-slider { opacity:0.45; cursor:not-allowed; }

/* ── BLP Report Card ─────────────────────────────────────────────────────── */
.blp-report-card {
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(251,191,36,0.04));
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .55s ease both;
}
.blp-report-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.blp-report-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.blp-saved-box {
  text-align: right;
}
.blp-saved-label {
  font-size: .68rem; color: var(--muted); margin-bottom: .25rem;
}
.blp-saved-value {
  font-size: 1.4rem; font-weight: 800;
  color: #f59e0b;
  letter-spacing: -.5px;
}
.blp-saved-unit {
  font-size: .8rem; font-weight: 600; color: rgba(245,158,11,0.7);
}
.blp-report-divider {
  height: 1px; background: rgba(255,255,255,0.06);
}
.blp-report-list-label {
  font-size: .72rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.blp-report-list {
  display: flex; flex-direction: column; gap: .45rem;
  max-height: 205px;
  overflow-y: auto;
}
.blp-report-empty {
  font-size: .8rem; color: rgba(255,255,255,0.2);
  text-align: center; padding: .8rem 0;
}
.blp-report-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(217,119,6,0.15);
  border-radius: 10px;
  padding: .5rem .8rem;
}
.blp-report-symbol {
  font-weight: 700; font-size: .88rem; color: #e2e8f0; flex-shrink: 0;
}
.blp-report-dir {
  font-size: .7rem; font-weight: 700; padding: .15rem .45rem;
  border-radius: 5px; flex-shrink: 0;
}
.blp-report-dir.long  { background: rgba(34,197,94,0.15); color: #4ade80; }
.blp-report-dir.short { background: rgba(239,68,68,0.15);  color: #f87171; }
.blp-report-time {
  font-size: .7rem; color: rgba(255,255,255,0.3); flex: 1; text-align: right;
}
@media (max-width: 480px) {
  .blp-report-card { padding: .9rem 1rem; }
  .blp-saved-value { font-size: 1.15rem; }
}


/* ── BLP Accuracy Card ──────────────────────────────────────────────────── */
.blp-accuracy-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(217,119,6,0.10), rgba(251,191,36,0.04));
  border: 1px solid rgba(217,119,6,0.22);
  border-radius: 20px;
  padding: .85rem 1.2rem;
  margin-bottom: 1.25rem;
}

/* ── BLP Report rows ────────────────────────────────────────────────────── */
.blp-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: .5rem;
}
.blp-report-row:last-child { border-bottom: none; }

.blp-row-left {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}
.blp-row-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.blp-acc-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.blp-acc-correct { background: rgba(245,158,11,0.2); color: #f59e0b; }
.blp-acc-wrong   { background: rgba(255,71,87,0.2);  color: #ff4757; }
.blp-acc-pending { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }

@media (max-width: 768px) {
  .blp-accuracy-card { padding: .7rem 1rem; }
  .blp-report-row { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .blp-row-right { justify-content: flex-start; }
}

/* ── Wallet Strip ── */
.wallet-strip {
  display: flex; align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: .6rem 1.1rem;
  margin-bottom: 1rem;
  animation: fadeUp .35s ease both;
}
.wstrip-item { flex: 1; display: flex; flex-direction: column; gap: .08rem; min-width: 0; }
.wstrip-total .wstrip-val { color: var(--accent); }
.wstrip-label { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.wstrip-val { font-size: .92rem; font-weight: 700; white-space: nowrap; }
.wstrip-sep { width: 1px; height: 26px; background: var(--glass-border); margin: 0 .75rem; flex-shrink: 0; }

/* ── Unrealized PnL Strip ── */
.upnl-strip {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .45rem .9rem;
  margin-bottom: 1rem;
  animation: fadeUp .35s ease both;
}
.upnl-strip-label { font-size: .7rem; color: var(--muted); }
.upnl-strip-val { font-size: .88rem; font-weight: 700; }
.upnl-strip-val.green { color: var(--green); }
.upnl-strip-val.red   { color: var(--red); }

/* ── Bottom Stats Strip ── */
.bottom-stats-strip {
  display: flex; align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: .6rem 1.1rem;
  margin-top: 1rem; margin-bottom: 1rem;
  animation: fadeUp .35s ease both;
}
.bstat-item { flex: 1; display: flex; flex-direction: column; gap: .05rem; }
.bstat-label { font-size: .62rem; color: var(--muted); }
.bstat-val { font-size: .9rem; font-weight: 700; }
.bstat-val.green  { color: var(--green); }
.bstat-val.red    { color: var(--red); }
.bstat-val.purple { color: var(--purple2); }
.bstat-sep { width: 1px; height: 32px; background: var(--glass-border); margin: 0 .75rem; flex-shrink: 0; }

/* ── Unified Positions ── */
.apos-cat-header {
  display: flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 700;
  padding: .28rem .65rem; border-radius: 6px;
  margin-bottom: .45rem;
}
.apos-cat-header.trend { color: #a78bfa; background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.22); }
.apos-cat-header.pnd   { color: #f59e0b; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.22); }
.apos-cat-items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .7rem; }
.pos-type-badge {
  font-size: .58rem; font-weight: 800; border-radius: 3px;
  padding: .05rem .28rem; flex-shrink: 0; letter-spacing: .02em;
}
.pos-type-badge.auto   { background: rgba(79,70,229,.25);  color: #a78bfa; border: 1px solid rgba(139,92,246,.4); }
.pos-type-badge.manual { background: rgba(245,158,11,.2);  color: #f59e0b; border: 1px solid rgba(245,158,11,.4); }
.position-item.trend-item { border-color: rgba(139,92,246,.22); }
.position-item.trend-item:hover { background: rgba(139,92,246,.07); }
.position-item.pnd-item   { border-color: rgba(245,158,11,.3); background: linear-gradient(135deg, rgba(180,83,9,.12), rgba(245,158,11,.05)); }
.position-item.pnd-item:hover   { background: linear-gradient(135deg, rgba(180,83,9,.2), rgba(245,158,11,.1)); }

/* ── PnD Positions Section — amber theme ── */
.pnd-positions-section {
  animation: fadeUp .5s ease both;
  margin-bottom: 1.5rem;
}
.pnd-positions-section .section-header { margin-bottom: .85rem; }
.pnd-positions-section .section-header h3 { color: #f59e0b; }
.pnd-positions-section .position-item { border-color: rgba(245,158,11,.22); }
.pnd-positions-section .position-item:hover { background: rgba(245,158,11,.08); }
