/* Ronin Trading · Mercado en directo — recreación fiel del mockup */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

.mk-root {
  --bg: #05070c;
  --panel: #0b0f16;
  --panel-2: #0f141d;
  --line: rgba(255,255,255,0.07);
  --line-soft: rgba(255,255,255,0.04);
  --gold: #f0b429;
  --green: #22c55e;
  --red: #ef4444;
  --txt: #f1f4f8;
  --txt-2: #9aa3b2;
  --txt-3: #5a6474;
  --btc: #f7931a;
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--txt);
  font-family: 'Inter', sans-serif; font-size: 15px;
  overflow: hidden;
}
.mk-root *, .mk-root *::before, .mk-root *::after { box-sizing: border-box; }
.mk-root button { font-family: inherit; cursor: pointer; }
.mk-up { color: var(--green); }
.mk-down { color: var(--red); }

/* ===== Header ===== */
.mk-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px 12px; flex-shrink: 0; }
.mk-burger { width: 30px; height: 22px; display: flex; flex-direction: column; justify-content: space-between; background: none; border: none; padding: 0; }
.mk-burger i { height: 2.5px; border-radius: 2px; background: var(--txt); display: block; }
.mk-burger i:nth-child(2) { width: 70%; }
.mk-brand { font-size: 24px; font-weight: 800; letter-spacing: 0.01em; }
.mk-brand b { color: var(--gold); font-weight: 800; }
.mk-beta { font-size: 11px; font-weight: 700; color: var(--txt-2); padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); margin-left: 2px; }
.mk-head-r { margin-left: auto; display: flex; align-items: center; gap: 18px; color: var(--txt-2); }
.mk-head-r button { position: relative; background: none; border: none; color: var(--txt-2); display: flex; }
.mk-head-r button:hover { color: var(--txt); }
.mk-head-r svg { width: 24px; height: 24px; }
.mk-bell-dot { position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }

/* ===== Scroll body ===== */
.mk-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 26px; scrollbar-width: thin; scrollbar-color: #1a2130 transparent; }

.mk-title-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.mk-title { font-size: 22px; font-weight: 800; }
.mk-live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--txt-2); font-weight: 500; }
.mk-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.mk-fav { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 14px; font-weight: 600; }
.mk-fav svg { width: 16px; height: 16px; color: var(--gold); }

/* Index cards */
.mk-idx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mk-idx { padding: 16px 18px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mk-idx-h { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--txt-2); margin-bottom: 8px; }
.mk-idx-coin { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.mk-idx-price { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.mk-idx-chg { font-size: 15px; font-weight: 700; margin-top: 3px; }
.mk-idx-spark { height: 60px; margin-top: 6px; position: relative; }
.mk-idx-spark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.mk-updated { display: flex; align-items: center; gap: 8px; margin: 14px 0 18px; font-size: 13.5px; color: var(--txt-3); }
.mk-updated svg { width: 15px; height: 15px; }
.mk-updated .mk-open { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--txt-2); }
.mk-updated .mk-open i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }

/* Tabs */
.mk-tabs { display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--line); padding-bottom: 0; margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.mk-tabs::-webkit-scrollbar { display: none; }
.mk-tab { padding: 12px 0 14px; background: none; border: none; color: var(--txt-2); font-size: 15px; font-weight: 600; white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.mk-tab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }
.mk-tabs-tools { margin-left: auto; display: flex; gap: 10px; padding-bottom: 6px; }
.mk-tool { width: 44px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--txt-2); display: flex; align-items: center; justify-content: center; }
.mk-tool svg { width: 18px; height: 18px; }

/* Section */
.mk-sec-h { display: flex; align-items: center; gap: 10px; margin: 24px 0 6px; }
.mk-sec-ic { font-size: 18px; }
.mk-sec-title { font-size: 16px; font-weight: 800; letter-spacing: 0.02em; }
.mk-sec-all { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: 14px; font-weight: 600; background: none; border: none; }
.mk-sec-all svg { width: 15px; height: 15px; }

/* Table */
.mk-thead { display: grid; grid-template-columns: 2.4fr 1.1fr 1.3fr 1.4fr 1fr 40px; gap: 12px; padding: 12px 4px 8px; font-size: 13px; color: var(--txt-3); font-weight: 500; }
.mk-thead .r { text-align: right; }
.mk-row { display: grid; grid-template-columns: 2.4fr 1.1fr 1.3fr 1.4fr 1fr 40px; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line-soft); }
.mk-asset { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mk-logo { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.mk-logo.round { border-radius: 50%; }
.mk-asset-name { font-size: 16px; font-weight: 700; }
.mk-asset-tick { font-size: 13px; color: var(--txt-3); margin-top: 1px; }
.mk-price { text-align: right; }
.mk-price strong { font-size: 16px; font-weight: 700; }
.mk-price span { display: block; font-size: 12px; color: var(--txt-3); margin-top: 1px; }
.mk-chg { text-align: right; }
.mk-chg strong { font-size: 15px; font-weight: 700; }
.mk-chg span { display: block; font-size: 12.5px; margin-top: 1px; }
.mk-spark { height: 40px; position: relative; }
.mk-spark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-vol { text-align: right; font-size: 16px; font-weight: 700; }
.mk-star { justify-self: end; background: none; border: none; color: var(--txt-3); display: flex; }
.mk-star svg { width: 20px; height: 20px; }
.mk-star.on { color: var(--gold); }

/* Ronin comment */
.mk-comment { display: flex; align-items: center; gap: 18px; margin-top: 26px; padding: 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.mk-bot { width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 40% 35%, #2b3444, #131922); display: flex; align-items: center; justify-content: center; }
.mk-bot svg { width: 40px; height: 40px; }
.mk-comment-body { flex: 1; min-width: 0; }
.mk-comment-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-bottom: 5px; }
.mk-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.mk-eq i { width: 3px; border-radius: 2px; background: var(--gold); animation: mkEq 1s ease-in-out infinite; }
.mk-eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.mk-eq i:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.mk-eq i:nth-child(3) { height: 60%; animation-delay: 0.4s; }
.mk-eq i:nth-child(4) { height: 85%; animation-delay: 0.15s; }
@keyframes mkEq { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
.mk-comment-text { font-size: 14.5px; color: var(--txt-2); line-height: 1.55; }
.mk-talk { flex-shrink: 0; display: inline-flex; align-items: center; gap: 10px; padding: 15px 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--txt); font-size: 15px; font-weight: 600; }
.mk-talk svg { width: 18px; height: 18px; }

/* Bottom nav */
.mk-nav { display: flex; flex-shrink: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px)); }
.mk-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; background: none; border: none; color: var(--txt-3); font-size: 12.5px; font-weight: 600; }
.mk-nav-item svg { width: 24px; height: 24px; }
.mk-nav-item.active { color: var(--gold); }

@media (max-width: 720px) {
  .mk-idx-grid { grid-template-columns: 1fr 1fr; }
  .mk-thead { display: none; }
  .mk-row { grid-template-columns: 1.6fr auto auto; grid-template-areas: 'a p c' 'a v s'; row-gap: 4px; }
  .mk-asset { grid-area: a; }
  .mk-price { grid-area: p; }
  .mk-chg { grid-area: c; }
  .mk-spark { display: none; }
  .mk-vol { grid-area: v; text-align: left; font-size: 13px; color: var(--txt-3); font-weight: 600; }
  .mk-star { grid-area: s; align-self: center; }
  .mk-comment { flex-wrap: wrap; }
  .mk-talk { width: 100%; justify-content: center; }
  .mk-brand { font-size: 20px; }
  .mk-title { font-size: 19px; }
  .mk-fav span { display: none; }
}

/* Embed en Scalp Pro */
#sp-mercado-root { position: relative; flex: 1; min-height: 0; height: 100%; width: 100%; }
.sp-page-wrap--mercado { padding: 0 !important; overflow: hidden !important; flex: 1; min-height: 0; height: 100%; }
.mk-root.mk-embed { position: relative; inset: auto; height: 100%; }
.mk-root.mk-embed .mk-head, .mk-root.mk-embed .mk-nav { display: none; }
.mk-root.mk-embed .mk-scroll { padding-bottom: 16px; }
.mk-row-click, .mk-idx-click { cursor: pointer; border: none; background: transparent; color: inherit; text-align: left; width: 100%; font: inherit; }
.mk-idx-click { padding: 16px 18px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mk-idx-click:hover, .mk-row-click:hover { background: rgba(255,255,255,0.02); }
.mk-fav.on { border-color: rgba(240,180,41,0.5); color: var(--gold); }
.mk-star.on svg { fill: var(--gold); stroke: var(--gold); }
.mk-search-wrap { margin: 0 0 14px; }
.mk-search-input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt); font-size: 14px;
}
.mk-empty { padding: 24px; text-align: center; color: var(--txt-3); font-size: 13px; }
.mk-tool.active { border-color: rgba(240,180,41,0.45); color: var(--gold); }
