/* Ronin Scalp PRO — terminal de trading profesional */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* Integración escritorio Ronin AI */
.app-body.scalp-mode { background: #07080f; }
.app-body.scalp-mode .main-panel {
  padding: 0 !important;
  overflow: hidden !important;
  background: #07080f;
}
#view-scalp {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #07080f;
}
#view-scalp .sp-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}
#view-scalp .sp-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
}
#view-scalp .sp-toast {
  position: absolute;
  top: 64px;
}
.sp-auth-banner {
  position: absolute;
  top: 58px;
  left: 12px;
  right: 12px;
  z-index: 140;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 71, 87, 0.12);
  border: 1px solid rgba(255, 71, 87, 0.35);
  color: #ff4757;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.sp-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(7, 8, 15, 0.82);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}
.sp-rank-bot td { background: rgba(139, 92, 246, 0.08); }

.sp-demo-badge {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.sp-demo-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.sp-demo-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.sp-cartera-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.sp-stats-grid--cartera { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .sp-stats-grid--cartera { grid-template-columns: 1fr 1fr; } }
.sp-port-dist {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.sp-port-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.sp-port-row:last-child { border-bottom: none; }

/* ===== Retos / Partidas ===== */
.sp-reto-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px 0; }
.sp-reto-preset {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 18px 16px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: var(--txt); cursor: pointer; text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sp-reto-preset:hover { border-color: var(--gold-line); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.3); }
.sp-reto-preset-icon {
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 2px; background: rgba(255,255,255,0.06);
}
.sp-reto-preset strong { font-size: 13.5px; font-weight: 800; letter-spacing: 0.01em; }
.sp-reto-preset span { font-size: 10px; color: var(--txt-2); font-weight: 600; }
.sp-reto-preset--0 { border-top: 2px solid #60a5fa; }
.sp-reto-preset--0 .sp-reto-preset-icon { background: rgba(96,165,250,0.14); }
.sp-reto-preset--1 { border-top: 2px solid var(--gold); }
.sp-reto-preset--1 .sp-reto-preset-icon { background: var(--gold-dim); }
.sp-reto-preset--2 { border-top: 2px solid #fb923c; }
.sp-reto-preset--2 .sp-reto-preset-icon { background: rgba(251,146,60,0.14); }
.sp-reto-preset--3 { border-top: 2px solid var(--purple); }
.sp-reto-preset--3 .sp-reto-preset-icon { background: rgba(139,92,246,0.16); }
.sp-reto-hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 22px 24px; margin: 14px 0 4px;
  border: 1px solid var(--line);
}
.sp-reto-hero--idle { display: flex; align-items: center; gap: 16px; background: var(--panel-2); }
.sp-reto-hero-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(255,255,255,0.06);
}
.sp-reto-hero-title { font-size: 16px; font-weight: 800; letter-spacing: 0.01em; }
.sp-reto-hero-sub { font-size: 11.5px; color: var(--txt-2); margin-top: 3px; }
.sp-reto-hero--live {
  background: linear-gradient(135deg, rgba(240,196,32,0.16), rgba(139,92,246,0.1) 60%, var(--panel-2));
  border-color: var(--gold-line);
  box-shadow: 0 10px 30px rgba(240,196,32,0.08);
}
.sp-reto-hero--live::before {
  content: ''; position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,196,32,0.22), transparent 70%); pointer-events: none;
}
.sp-reto-hero--live .sp-reto-hero-icon { background: var(--gold-dim); }
.sp-reto-hero-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.sp-reto-hero-info { flex: 1; min-width: 0; }
.sp-reto-hero-live-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; color: var(--gold);
  background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: 5px; padding: 3px 7px; margin-left: 6px;
  vertical-align: middle;
}
.sp-reto-hero-sub strong { font-weight: 800; }
.sp-reto-hero-time {
  font-family: var(--mono); font-size: 30px; font-weight: 800; color: var(--gold); flex-shrink: 0;
  letter-spacing: 0.02em;
}
.sp-reto-hero-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 16px; position: relative; z-index: 1; }
.sp-reto-hero-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--green)); border-radius: 6px; transition: width 0.4s ease; box-shadow: 0 0 10px rgba(240,196,32,0.4); }
.sp-match-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.sp-match-stats .sp-stat-card { padding: 16px 14px; }
.sp-match-list { display: flex; flex-direction: column; gap: 8px; }
.sp-match-card {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px;
  border-radius: 13px; border: 1px solid var(--line); background: var(--panel-2);
  transition: border-color 0.15s ease;
}
.sp-match-card:hover { border-color: rgba(255,255,255,0.14); }
.sp-match-card.win { border-left: 3px solid var(--green); }
.sp-match-card.lose { border-left: 3px solid var(--red); }
.sp-match-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.sp-match-card.win .sp-match-icon { background: var(--green-dim); }
.sp-match-card.lose .sp-match-icon { background: var(--red-dim); }
.sp-match-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sp-match-info strong { font-size: 12.5px; font-weight: 700; }
.sp-match-info span { font-size: 10px; color: var(--txt-2); }
.sp-match-pnl { font-size: 14px; font-weight: 800; font-family: var(--mono); }

/* ===== Ronin IA — command center ===== */
.sp-ronin-bg-glow {
  position: absolute; left: 12px; right: 12px; top: 72px; height: 220px; border-radius: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(139,92,246,0.18), transparent 70%);
  pointer-events: none; z-index: 0;
}
.sp-page-wrap { position: relative; }
.sp-page-wrap--ronin {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
.sp-page-wrap--mercado {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
}
.sp-page-wrap--aprendizaje {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
}
.sp-ronin-hero {
  position: relative; overflow: hidden;
  padding: 24px 26px 20px; border-radius: 20px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.sp-ronin-hero--on {
  background:
    radial-gradient(circle at 100% 0%, rgba(139,92,246,0.24), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(240,196,32,0.12), transparent 50%),
    linear-gradient(160deg, var(--panel-2), var(--panel));
  border-color: rgba(139,92,246,0.4);
  box-shadow: 0 14px 34px rgba(139,92,246,0.1), inset 0 1px 0 rgba(255,255,255,0.04);
}
.sp-ronin-corner {
  position: absolute; width: 34px; height: 34px; border: 2px solid var(--gold); opacity: 0.55; pointer-events: none; z-index: 1;
}
.sp-ronin-corner--tl { top: 10px; left: 10px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.sp-ronin-corner--br { bottom: 10px; right: 10px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
.sp-ronin-rank-strip { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sp-ronin-rank-badge {
  font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; color: #0a0b14;
  background: linear-gradient(90deg, var(--gold), #ffe27a); padding: 5px 12px; border-radius: 20px;
  box-shadow: 0 4px 12px rgba(240,196,32,0.35); flex-shrink: 0; white-space: nowrap;
}
.sp-ronin-xp-track { flex: 1; min-width: 90px; height: 6px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sp-ronin-xp-fill { height: 100%; background: linear-gradient(90deg, var(--purple), #22d3ee); border-radius: 5px; box-shadow: 0 0 8px rgba(139,92,246,0.5); }
.sp-ronin-xp-label { font-size: 9.5px; color: var(--txt-3); font-weight: 700; flex-shrink: 0; }
.sp-ronin-hero-grid { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.sp-ronin-avatar {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(135deg, var(--purple), #22d3ee 130%);
  box-shadow: 0 8px 20px rgba(139,92,246,0.4);
}
.sp-ronin-avatar.pulse::after {
  content: ''; position: absolute; inset: -5px; border-radius: 19px; border: 2px solid var(--purple);
  opacity: 0.6; animation: spRoninPulse 1.8s ease-out infinite;
}
@keyframes spRoninPulse { 0% { transform: scale(0.9); opacity: 0.7; } 100% { transform: scale(1.3); opacity: 0; } }
.sp-ronin-hero-info { flex: 1; min-width: 0; }
.sp-ronin-hero-name { font-size: 17px; font-weight: 900; letter-spacing: 0.05em; }
.sp-ronin-hero-name span { background: linear-gradient(90deg, var(--purple), #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-ronin-status { font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.sp-ronin-status.on { color: var(--green); }
.sp-ronin-status.off { color: var(--txt-3); }
.sp-ronin-eq { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sp-ronin-eq span { font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sp-ronin-eq strong { font-size: 22px; font-weight: 900; color: var(--gold); }
.sp-ronin-kpis {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.08);
}
.sp-ronin-kpi { display: flex; flex-direction: column; gap: 2px; }
.sp-ronin-kpi strong { font-size: 19px; font-weight: 900; }
.sp-ronin-kpi span { font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.sp-ronin-kpi:nth-child(1) strong { color: #60a5fa; }
.sp-ronin-kpi:nth-child(2) strong { color: var(--green); }
.sp-ronin-kpi:nth-child(3) strong { color: var(--purple); }
.sp-ronin-kpi:nth-child(4) strong { color: #22d3ee; }
.sp-ronin-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.sp-ronin-toggle, .sp-ronin-run {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 16px; border-radius: 14px; font-size: 13px; font-weight: 900; letter-spacing: 0.03em; text-transform: uppercase; cursor: pointer;
  border: 1px solid var(--line); color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sp-ronin-toggle .ico, .sp-ronin-run .ico { font-size: 16px; }
.sp-ronin-toggle:hover, .sp-ronin-run:hover { transform: translateY(-2px); }
.sp-ronin-toggle.active {
  background: linear-gradient(135deg, #3a0d13, #7a1420 55%, #2a0a0e);
  border: 1px solid rgba(240,196,32,0.5);
  box-shadow: 0 10px 24px rgba(122,20,32,0.45);
  color: #ffdede;
}
.sp-ronin-toggle:not(.active) {
  background: linear-gradient(135deg, #34e8a0, var(--green) 60%, #009d63);
  box-shadow: 0 10px 22px rgba(0,208,132,0.32);
  color: #012414;
}
.sp-ronin-run {
  background: linear-gradient(135deg, #ffe27a, var(--gold) 55%, #b9860f);
  box-shadow: 0 10px 22px rgba(240,196,32,0.35);
  color: #211500; border: none;
}
.sp-ronin-learn {
  margin-top: 4px; padding: 20px 22px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 12px;
}
.sp-ronin-learn h3 { margin: 0 0 14px; font-size: 13px; font-weight: 800; color: var(--txt); }
.sp-ronin-lessons { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.sp-ronin-lessons li {
  display: flex; gap: 12px; align-items: flex-start; font-size: 12px; color: var(--txt-2); line-height: 1.5;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.025); border: 1px solid var(--line-soft);
}
.sp-ronin-lesson-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ffe27a); color: #0a0b14;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.sp-ronin-timeline { position: relative; padding-left: 6px; }
.sp-ronin-timeline::before {
  content: ''; position: absolute; left: 20px; top: 8px; bottom: 8px; width: 1px; background: var(--line);
}
.sp-ronin-act-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sp-ronin-act { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 0; }
.sp-ronin-act-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 13px; position: relative; z-index: 1;
}
.sp-ronin-act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sp-ronin-act-body span { font-size: 12.5px; font-weight: 700; }
.sp-ronin-act-body time { font-size: 9.5px; color: var(--txt-3); }
.sp-ronin-vision {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.sp-ronin-vision-row { padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.sp-ronin-vision-row:last-child { border-bottom: none; }
.sp-ronin-vision-meta { color: var(--txt-3); font-size: 10px; display: block; margin-top: 2px; }
.sp-ronin-vision-sig { color: var(--txt-2); font-size: 10px; margin-top: 3px; }
.sp-ronin-vision-pos-wrap { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sp-ronin-vision-pos { font-size: 11px; color: var(--txt-2); padding: 4px 0; }
.sp-ronin-liq-warn { color: var(--red) !important; font-weight: 700; }

.sp-root {
  --bg: #07080f;
  --panel: #0d0e1a;
  --panel-2: #12131f;
  --line: rgba(255, 255, 255, 0.06);
  --line-soft: rgba(255, 255, 255, 0.035);
  --gold: #f0c420;
  --gold-grad: linear-gradient(135deg, #f0c420, #d4a017);
  --gold-dim: rgba(240, 196, 32, 0.12);
  --gold-line: rgba(240, 196, 32, 0.35);
  --green: #00d084;
  --green-dim: rgba(0, 208, 132, 0.1);
  --red: #ff4757;
  --red-dim: rgba(255, 71, 87, 0.1);
  --purple: #8b5cf6;
  --txt: #eef0f6;
  --txt-2: #8b8fa3;
  --txt-3: #4a4e66;
  --mono: 'JetBrains Mono', monospace;
  position: relative;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 30px;
  padding-bottom: 46px;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--txt);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.sp-root *, .sp-root *::before, .sp-root *::after { box-sizing: border-box; }
.sp-root button { font-family: inherit; }
.sp-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ===== Top bar ===== */
.sp-topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.sp-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sp-logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--gold-grad); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
}
.sp-logo-name { font-weight: 800; font-size: 14px; letter-spacing: 0.04em; }
.sp-logo-name span { color: var(--gold); }
.sp-logo-badge {
  font-size: 8px; font-weight: 800; letter-spacing: 0.1em; padding: 2px 6px;
  border-radius: 5px; border: 1px solid var(--gold-line); color: var(--gold); background: var(--gold-dim);
}
.sp-top-symbol { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; min-width: max-content; }
.sp-top-pair { font-weight: 800; font-size: 15px; white-space: nowrap; }
.sp-top-live {
  font-size: 8px; font-weight: 800; color: var(--green);
  display: inline-flex; align-items: center; gap: 4px; animation: spPulse 1.4s ease-in-out infinite;
}
.sp-top-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
@keyframes spPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.sp-top-price { font-size: 19px; font-weight: 800; }
.sp-top-chg { font-size: 12px; font-weight: 700; }
.sp-top-stats { display: flex; gap: 20px; margin-left: 4px; }
.sp-top-stat { display: flex; flex-direction: column; gap: 1px; }
.sp-top-stat span { font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.sp-top-stat strong { font-size: 12px; font-weight: 700; }
.sp-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.sp-acct { display: flex; gap: 16px; padding: 6px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sp-acct-item { display: flex; flex-direction: column; gap: 1px; }
.sp-acct-item span { font-size: 8px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sp-acct-item strong { font-size: 12px; font-weight: 800; }
.sp-acct-item strong.gold { color: var(--gold); }
.sp-reto-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(240,196,32,0.14), rgba(139,92,246,0.12));
  border: 1px solid var(--gold-line); font-size: 11px; font-weight: 700; cursor: default;
}
.sp-reto-chip .sp-reto-time { color: var(--gold); }
.sp-reto-mini-bar { width: 46px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.sp-reto-mini-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--green)); }
.sp-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--gold-grad);
  color: #000; font-weight: 900; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ===== Body grid ===== */
.sp-body {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 308px;
  grid-template-rows: 100%;
  gap: 1px;
  background: var(--line-soft);
  min-height: 0;
}
.sp-col { background: var(--bg); min-height: 0; display: flex; flex-direction: column; }

/* ===== Watchlist ===== */
.sp-watch-head { padding: 14px 14px 10px; }
.sp-panel-title {
  font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--txt-3); margin-bottom: 9px;
}
.sp-search {
  width: 100%; padding: 8px 10px; border-radius: 8px; outline: none;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--txt); font-size: 12px;
}
.sp-search::placeholder { color: var(--txt-3); }
.sp-cats { display: flex; gap: 4px; margin-top: 8px; }
.sp-cat {
  padding: 4px 10px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: var(--txt-2); font-size: 10px; font-weight: 700; cursor: pointer;
}
.sp-cat.active { background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold); }
.sp-watch-cols {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 4px 12px;
  font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line-soft);
}
.sp-watch-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #23253a transparent; }
.sp-watch-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 9px 14px; cursor: pointer; border-left: 2px solid transparent;
}
.sp-watch-row:hover { background: var(--panel); }
.sp-watch-row.active { background: var(--panel); border-left-color: var(--gold); }
.sp-watch-sym { font-weight: 800; font-size: 12px; }
.sp-watch-name { font-size: 9px; color: var(--txt-3); font-weight: 500; margin-top: 1px; }
.sp-watch-price { font-size: 11px; font-weight: 600; text-align: right; }
.sp-watch-chg { font-size: 10px; font-weight: 700; text-align: right; min-width: 48px; }

/* ===== Center: chart + positions ===== */
.sp-center { display: grid; grid-template-rows: minmax(320px, 1fr) minmax(180px, 300px); gap: 1px; background: var(--line-soft); min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.sp-chart-panel { background: var(--bg); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sp-chart-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.sp-periods { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); flex-wrap: wrap; }
.sp-period {
  padding: 4px 10px; border-radius: 6px; border: none; background: transparent;
  color: var(--txt-2); font-size: 10px; font-weight: 800; cursor: pointer;
}
.sp-period.active { background: var(--gold-grad); color: #000; }
.sp-inds { display: flex; gap: 4px; flex-wrap: wrap; }
.sp-ind {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); background: transparent;
  color: var(--txt-2); font-size: 10px; font-weight: 700; cursor: pointer;
}
.sp-ind i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; opacity: 0.45; }
.sp-ind.active { border-color: var(--gold-line); color: var(--txt); background: var(--panel-2); }
.sp-ind.active i { opacity: 1; }
.sp-chart-reset {
  margin-left: auto; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--txt-2); cursor: pointer; font-size: 13px;
}
.sp-chart-reset:hover { color: var(--gold); border-color: var(--gold-line); }
.sp-chart-host { flex: 1; min-height: 0; position: relative; padding: 4px 6px 6px; overflow: hidden; }
.rt-tv-stack { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rt-tv-pane { position: relative; }
.rt-tv-pane--main { flex: 1; min-height: 0; }
.rt-tv-pane--sub { flex-shrink: 0; border-top: 1px solid var(--line-soft); }
.sp-chart-empty, .sp-chart-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--txt-3); font-size: 12px; gap: 8px;
}
.sp-spin { display: inline-block; animation: spSpin 0.8s linear infinite; }
@keyframes spSpin { to { transform: rotate(360deg); } }

/* Bottom panel */
.sp-bottom { background: var(--bg); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; z-index: 50; }
.sp-bottom-tabs { display: flex; gap: 2px; padding: 6px 12px 0; border-bottom: 1px solid var(--line-soft); }
.sp-btab {
  padding: 7px 14px; border: none; background: transparent; color: var(--txt-2);
  font-size: 11px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent;
}
.sp-btab.active { color: var(--gold); border-bottom-color: var(--gold); }
.sp-btab small { color: var(--txt-3); font-weight: 700; margin-left: 3px; }
.sp-bottom-body { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: #23253a transparent; padding: 0 12px 10px; position: relative; z-index: 1; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 720px; }
.sp-table th {
  font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  text-align: left; padding: 8px 8px 6px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--bg);
}
.sp-table td { padding: 8px; font-size: 11px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.sp-table th.r, .sp-table td.r { text-align: right; }
.sp-side-tag { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 5px; }
.sp-side-tag.long { background: var(--green-dim); color: var(--green); }
.sp-side-tag.short { background: var(--red-dim); color: var(--red); }
.sp-lev-tag { color: var(--purple); font-weight: 800; font-size: 10px; }
.sp-mini-input {
  width: 74px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); font-size: 10px; outline: none; font-family: var(--mono);
}
.sp-mini-btn {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--gold); font-size: 9px; font-weight: 800; cursor: pointer;
}
.sp-close-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,71,87,0.35);
  background: var(--red-dim); color: var(--red); font-size: 10px; font-weight: 800; cursor: pointer;
  position: relative; z-index: 2;
}
.sp-close-btn:disabled { opacity: 0.5; cursor: wait; }
.sp-empty { color: var(--txt-3); font-size: 11px; text-align: center; padding: 24px 0; }

/* ===== Order ticket ===== */
.sp-ticket { padding: 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #23253a transparent; display: flex; flex-direction: column; gap: 13px; }
.sp-side-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sp-side-btn {
  padding: 9px; border-radius: 7px; border: none; background: transparent;
  color: var(--txt-2); font-size: 12px; font-weight: 800; cursor: pointer; letter-spacing: 0.03em;
}
.sp-side-btn.long.active { background: var(--green); color: #00160c; }
.sp-side-btn.short.active { background: var(--red); color: #fff; }
.sp-field-label { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 6px; display: flex; justify-content: space-between; }
.sp-field-label em { font-style: normal; color: var(--txt-2); font-weight: 600; text-transform: none; letter-spacing: 0; }
.sp-amount-wrap { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sp-amount-wrap:focus-within { border-color: var(--gold-line); }
.sp-amount-row { display: flex; align-items: baseline; gap: 6px; }
.sp-amount-row input {
  flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--txt);
  font-size: 20px; font-weight: 800; font-family: var(--mono);
}
.sp-amount-unit { font-size: 11px; color: var(--txt-3); font-weight: 700; }
.sp-quick-row { display: flex; gap: 4px; margin-top: 8px; }
.sp-quick {
  flex: 1; padding: 5px 2px; border-radius: 6px; border: 1px solid var(--line); background: transparent;
  color: var(--txt-2); font-size: 9px; font-weight: 800; cursor: pointer;
}
.sp-quick:hover { color: var(--gold); border-color: var(--gold-line); }
.sp-levs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sp-lev {
  padding: 7px 2px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--txt-2); font-size: 10px; font-weight: 800; cursor: pointer;
}
.sp-lev.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.sp-sltp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-sltp-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.sp-sltp-box:focus-within { border-color: var(--gold-line); }
.sp-sltp-box label { display: block; font-size: 8px; font-weight: 800; letter-spacing: 0.08em; color: var(--txt-3); margin-bottom: 3px; }
.sp-sltp-box input { width: 100%; background: none; border: none; outline: none; color: var(--txt); font-size: 12px; font-weight: 700; font-family: var(--mono); }
.sp-info-rows { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.sp-info-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--txt-2); }
.sp-info-row strong { color: var(--txt); font-weight: 700; }
.sp-info-row strong.liq { color: var(--red); }
.sp-submit {
  padding: 13px; border-radius: 11px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 900; letter-spacing: 0.04em;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.sp-submit small { font-size: 9px; font-weight: 700; opacity: 0.75; font-family: var(--mono); }
.sp-submit.long { background: linear-gradient(135deg, var(--green), #00b870); color: #00160c; box-shadow: 0 6px 18px rgba(0,208,132,0.25); }
.sp-submit.short { background: linear-gradient(135deg, var(--red), #e03e4e); color: #fff; box-shadow: 0 6px 18px rgba(255,71,87,0.25); }
.sp-submit:disabled { opacity: 0.55; cursor: default; }

/* Order book */
.sp-ob { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.sp-ob-cols { display: flex; justify-content: space-between; font-size: 9px; color: var(--txt-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 2px 5px; }
.sp-ob-row { position: relative; display: flex; justify-content: space-between; padding: 2.5px 4px; font-size: 10.5px; font-family: var(--mono); }
.sp-ob-row .sp-ob-depth { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 2px; }
.sp-ob-row.ask .sp-ob-depth { background: rgba(255, 71, 87, 0.09); }
.sp-ob-row.bid .sp-ob-depth { background: rgba(0, 208, 132, 0.09); }
.sp-ob-row span { position: relative; z-index: 1; }
.sp-ob-row.ask span:first-child { color: var(--red); }
.sp-ob-row.bid span:first-child { color: var(--green); }
.sp-ob-row span:last-child { color: var(--txt-2); }
.sp-ob-mid {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 0; margin: 3px 0; font-family: var(--mono);
  font-weight: 800; font-size: 13px; color: var(--gold);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}

/* ===== Ticker footer ===== */
.sp-ticker { background: var(--panel); border-top: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; }
.sp-ticker-track { display: flex; gap: 26px; white-space: nowrap; animation: spTicker 30s linear infinite; padding: 0 12px; font-size: 10.5px; font-weight: 600; }
.sp-tick em { font-style: normal; margin-left: 5px; font-family: var(--mono); font-weight: 700; }
@keyframes spTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== Nav inferior ===== */
.sp-nav {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: center; gap: 6px;
  background: var(--panel); border-top: 1px solid var(--line);
  padding: 6px 10px;
}
.sp-nav-item {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 9px; border: none; background: transparent;
  color: var(--txt-2); font-size: 10px; font-weight: 700; cursor: pointer;
}
.sp-nav-item svg { width: 16px; height: 16px; }
.sp-nav-item:hover { color: var(--txt); }
.sp-nav-item.active { background: var(--gold-dim); color: var(--gold); }

/* ===== Páginas (Mercado / Partidas / Ranking / Perfil) ===== */
.sp-page-wrap { overflow-y: auto; min-height: 0; background: var(--bg); scrollbar-width: thin; scrollbar-color: #23253a transparent; }
.sp-page { max-width: 860px; margin: 0 auto; padding: 20px 18px 34px; }
.sp-page-title { font-size: 19px; font-weight: 900; letter-spacing: 0.02em; }
.sp-page-sub { font-size: 11px; color: var(--txt-2); margin: 3px 0 16px; }
.sp-page-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.sp-page-tools .sp-search { flex: 1; max-width: 320px; }
.sp-page-tools .sp-cats { margin-top: 0; }
.sp-hist-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.sp-rank-me td { background: var(--gold-dim); }
.sp-rank-me td:first-child { border-radius: 8px 0 0 8px; }
.sp-rank-me td:last-child { border-radius: 0 8px 8px 0; }
.sp-profile-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; margin-bottom: 12px;
  border-radius: 16px; border: 1px solid var(--gold-line);
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
}
.sp-profile-avatar {
  width: 54px; height: 54px; border-radius: 50%; background: var(--gold-grad); color: #000;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px;
}
.sp-profile-name { font-size: 17px; font-weight: 800; }
.sp-profile-role { font-size: 11px; color: var(--gold); font-weight: 700; }
.sp-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.sp-stat-card {
  display: flex; flex-direction: column; gap: 3px; padding: 14px; text-align: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.sp-stat-card strong { font-size: 19px; font-weight: 900; color: var(--gold); }
.sp-stat-card span { font-size: 9px; color: var(--txt-2); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.sp-reset-btn {
  width: 100%; padding: 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(255, 71, 87, 0.4); background: var(--red-dim);
  color: var(--red); font-weight: 800; font-size: 12px;
}

/* Toast */
.sp-toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-130px);
  background: var(--panel); border: 1px solid var(--gold-line); border-radius: 10px;
  padding: 10px 16px; z-index: 300; transition: transform 0.3s ease;
  font-size: 12px; font-weight: 600; max-width: 90%;
}
.sp-toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1280px) {
  .sp-reto-chip .sp-reto-name { display: none; }
}
@media (max-width: 1000px) and (min-width: 881px) {
  .sp-reto-chip { display: none; }
  .sp-topbar { gap: 14px; }
  .sp-acct { gap: 10px; padding: 5px 10px; }
}
@media (max-height: 720px) and (min-width: 881px) {
  .sp-center { grid-template-rows: minmax(300px, 1fr) minmax(110px, 190px); }
  .sp-ticker { display: none; }
  .sp-root { grid-template-rows: 58px minmax(0, 1fr) 0; }
}
@media (max-width: 1100px) {
  .sp-body { grid-template-columns: 200px minmax(0, 1fr) 262px; }
  .sp-top-stats { display: none; }
}

/* ===== Móvil: columna única ===== */
@media (max-width: 880px) {
  .sp-ronin-bg-glow { left: 0; right: 0; top: 0; }
  .sp-root { grid-template-rows: auto minmax(0, 1fr) 28px; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .sp-topbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px 14px; row-gap: 8px; }
  .sp-logo-name { font-size: 13px; }
  .sp-top-symbol { flex-basis: 100%; order: 3; min-width: 0; }
  .sp-top-price { font-size: 22px; }
  .sp-top-right { gap: 10px; }
  .sp-acct { padding: 5px 10px; gap: 12px; }
  .sp-avatar { display: none; }
  .sp-reto-chip .sp-reto-name { display: none; }

  .sp-body { display: flex; flex-direction: column; overflow-y: auto; gap: 0; }
  .sp-col, .sp-center { min-height: auto; }

  /* Watchlist → cinta horizontal */
  .sp-watch { order: 1; border-bottom: 1px solid var(--line); }
  .sp-watch .sp-panel-title, .sp-watch-cols { display: none; }
  .sp-watch-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px 8px; }
  .sp-watch-head .sp-search { flex: 1; margin: 0; }
  .sp-cats { margin-top: 0; flex-shrink: 0; }
  .sp-watch-list { display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 8px 10px; gap: 6px; }
  .sp-watch-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    min-width: 118px; flex-shrink: 0; padding: 8px 10px;
    border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  }
  .sp-watch-row.active { border-color: var(--gold-line); background: var(--gold-dim); }
  .sp-watch-price, .sp-watch-chg { text-align: left; min-width: 0; }

  /* la cadena de alturas de escritorio no aplica en columna única */
  .sp-center { order: 2; display: contents; height: auto; overflow: visible; }
  .sp-chart-panel { flex: none; order: 2; background: var(--bg); }
  .sp-chart-host { flex: none; height: 320px; }
  .sp-chart-bar { padding: 8px 10px; gap: 8px; }

  /* Ticket antes que el histórico en móvil */
  .sp-ticket-col { order: 3; border-top: 1px solid var(--line); }
  .sp-ticket { overflow: visible; }
  .sp-bottom { order: 4; border-top: 1px solid var(--line); }
  .sp-bottom-body { max-height: 420px; }
  .sp-reto-presets { grid-template-columns: 1fr 1fr; }
  .sp-reto-hero-time { font-size: 20px; }
  .sp-ronin-kpis { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .sp-ronin-eq strong { font-size: 18px; }
  .sp-match-stats { grid-template-columns: 1fr; }
  .sp-submit { padding: 15px; font-size: 14px; }
  .sp-side-btn { padding: 12px; }
  .sp-lev { padding: 10px 2px; }

  .sp-nav { justify-content: space-around; gap: 2px; padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .sp-nav-item { flex-direction: column; gap: 3px; padding: 5px 10px; font-size: 9px; flex: 1; }
  .sp-nav-item svg { width: 18px; height: 18px; }
  .sp-stats-grid { grid-template-columns: 1fr 1fr; }
  .sp-reto-presets { grid-template-columns: 1fr 1fr; }
  .sp-page { padding: 16px 14px 28px; }
  .sp-page-tools { flex-wrap: wrap; }
}
