/* ═══════════════ Memecoin Desk — tema oscuro tipo exchange ═══════════════ */
:root {
  --bg: #0a0d12; --bg-2: #0f1319; --panel: #12171e; --panel-2: #171d26; --panel-3: #1d2430;
  --line: #222a36; --line-2: #2b3443;
  --text: #eaecef; --text-2: #b7bdc6; --muted: #7d8695;
  --up: #16c784; --up-bg: rgba(22,199,132,.12); --down: #ea3943; --down-bg: rgba(234,57,67,.12);
  --gold: #f0b90b; --gold-bg: rgba(240,185,11,.12); --blue: #4c8dff; --blue-bg: rgba(76,141,255,.12);
  --violet: #a78bfa; --violet-bg: rgba(167,139,250,.13);
  --r: 12px; --r-sm: 8px;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tabbar-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .sm { font-size: 12px; } .pre { white-space: pre-line; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.err { color: var(--down); min-height: 1.2em; margin: 4px 0 0; font-size: 13px; }
code { font-family: var(--mono); font-size: 12px; color: var(--text-2); word-break: break-all; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* ── botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 14px; min-height: 40px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: #3a4558; } .btn:active { transform: scale(.98); }
.btn.sm { padding: 6px 11px; min-height: 32px; font-size: 13px; }
.btn.icon { padding: 6px 10px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #14110a; }
.btn.primary:hover { background: #ffc823; }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn.ghost { background: transparent; }
.btn.light { background: #fff; color: #111; border-color: #fff; }
.btn.panic { background: transparent; color: var(--down); border-color: rgba(234,57,67,.5); }
.btn.panic:hover { background: var(--down-bg); }
.btn:disabled { opacity: .5; pointer-events: none; }
.pill { background: var(--gold); color: #111; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 800; }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2130 0%, var(--bg) 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card p { margin: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
input { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 12px; font-size: 16px; width: 100%; font-family: inherit; transition: border-color .15s; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg); }
input.num { width: 76px; padding: 7px 8px; font-size: 15px; text-align: center; display: inline-block; }

/* ── marca ── */
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; letter-spacing: -.2px; }
.brand b { font-weight: 800; } .brand.lg { font-size: 22px; }
.logo { color: var(--gold); font-size: 1.15em; }

/* ── topbar ── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: rgba(10,13,18,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ticker { display: flex; gap: 22px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.tick { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.tick small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.tick b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mode { font-size: 11px; font-weight: 800; letter-spacing: .6px; padding: 5px 9px; border-radius: 6px; }
.mode.paper { color: var(--blue); background: var(--blue-bg); border: 1px solid rgba(76,141,255,.35); }
.mode.live { color: #fff; background: var(--down); }
.health { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 4px; }
.health i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.health.ok i { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); animation: pulse 2s infinite; }
.health.bad i { background: var(--down); } .health.bad { color: var(--down); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--down); color: #fff; padding: 9px 16px; font-size: 13px; }

/* ── layout ── */
.layout { display: grid; gap: 12px; padding: 12px; height: calc(100vh - 56px); height: calc(100dvh - 56px);
  grid-template-columns: minmax(380px, 1.05fr) minmax(460px, 1.5fr) minmax(340px, .95fr); }
.panel > *:not(.token-list), .side-body > * { flex-shrink: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── mercado ── */
.market { container-type: inline-size; container-name: market; }
.market-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 0; }
.mtab { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--text-2); cursor: pointer;
  transition: all .15s; min-width: 0; }
.mtab-ico { font-size: 18px; }
.mtab-txt { display: grid; min-width: 0; line-height: 1.2; }
.mtab-txt b { font-size: 14px; } .mtab-txt small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtab .count { margin-left: auto; }
.mtab.on { background: var(--panel-3); border-color: var(--gold); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.mtab[data-tab="graduated"].on { border-color: var(--violet); box-shadow: inset 0 -2px 0 var(--violet); }
.count { font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--bg); color: var(--text-2);
  border-radius: 10px; padding: 1px 7px; }
.toolbar { display: flex; gap: 8px; padding: 10px 10px 6px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 10px; }
.search-box span { color: var(--muted); font-size: 16px; }
.search-box input { border: 0; background: none; padding: 8px 0; font-size: 14px; box-shadow: none; }
.chips { display: flex; gap: 6px; padding: 2px 10px 8px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chips.tight { padding: 0 0 4px; }
.chips-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; margin-right: 2px; }
.chips button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); border-radius: 16px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chips button.on { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }

.list-head, .trow { display: grid; align-items: center; gap: 8px;
  grid-template-columns: minmax(0, 1.45fr) 60px minmax(0, .95fr) minmax(0, 1.05fr) minmax(0, .75fr); }
.list-head { white-space: nowrap; padding: 6px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.list-head button { background: none; border: 0; color: inherit; font: inherit; text-transform: inherit;
  letter-spacing: inherit; cursor: pointer; padding: 2px 0; text-align: inherit; }
.list-head button.on { color: var(--text); }
.list-head .r, .trow .r { text-align: right; justify-self: end; }
.token-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.trow { padding: 9px 12px; border-bottom: 1px solid #181e27; cursor: pointer; transition: background .12s; position: relative; }
.trow:hover { background: var(--panel-2); }
.trow.sel { background: var(--panel-3); }
.trow.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.t-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.t-names { min-width: 0; line-height: 1.25; }
.t-sym { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; }
.t-sym span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.t-sub { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }
.t-sub .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.age { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.age.fresh { color: var(--up); }
.flag { font-size: 11px; line-height: 1; }
.spark { width: 64px; height: 26px; display: block; }
.t-price { text-align: right; line-height: 1.25; }
.t-price b { font-family: var(--mono); font-size: 13px; font-weight: 600; display: block; }
.chgp { display: inline-block; font-family: var(--mono); font-size: 11.5px; font-weight: 700; border-radius: 4px; padding: 1px 5px; }
.chgp.up { background: var(--up-bg); } .chgp.down { background: var(--down-bg); } .chgp.flat { background: var(--panel-3); }
.t-col { text-align: right; line-height: 1.25; font-family: var(--mono); font-size: 12.5px; }
.t-col small { display: block; font-family: var(--sans); color: var(--muted); font-size: 10.5px; }
.progress { height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; width: 100%; min-width: 40px; }
.progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8a6d00, var(--gold)); }
.progress.hot i { background: linear-gradient(90deg, var(--gold), var(--up)); }
.t-curve { display: grid; gap: 4px; justify-items: end; font-family: var(--mono); font-size: 12.5px; }
.curve-line { display: flex; align-items: center; gap: 6px; width: 100%; justify-content: flex-end; }
.curve-line .progress { flex: 1; max-width: 60px; min-width: 24px; }
.curve-line small { color: var(--muted); font-size: 11px; min-width: 28px; text-align: right; }
.flash-up { animation: fu 1s; } .flash-down { animation: fd 1s; }
@keyframes fu { from { background: rgba(22,199,132,.18); } } @keyframes fd { from { background: rgba(234,57,67,.18); } }
.list-foot { padding: 8px 12px; border-top: 1px solid var(--line); }

/* avatar generado (sin imágenes externas) */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 12.5px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); letter-spacing: -.3px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }

/* skeleton y vacíos */
.skel { height: 52px; margin: 6px 12px; border-radius: 8px;
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%);
  background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 28px 18px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 8px 0 4px; }
.big-empty { margin: auto; max-width: 340px; }
.empty-ico { font-size: 34px; }

/* ── detalle ── */
.detail { overflow-y: auto; }
#detail { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.d-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.d-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.d-names { min-width: 0; }
.d-sym { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-sym h2 { margin: 0; font-size: 21px; letter-spacing: -.3px; }
.status-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; border-radius: 5px; padding: 3px 7px; }
.status-tag.curve { color: var(--gold); background: var(--gold-bg); }
.status-tag.graduated { color: var(--violet); background: var(--violet-bg); }
.status-tag.mayhem { color: #ff8a92; background: var(--down-bg); }
.mh { font-size: 9px; font-weight: 800; letter-spacing: .4px; color: #ff8a92; background: var(--down-bg); border-radius: 4px; padding: 1px 4px; }
.d-links { display: flex; gap: 6px; flex-wrap: wrap; }
.d-price { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.price-xl { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.chg-group { display: flex; gap: 6px; }
.chg-item { display: grid; background: var(--panel-2); border-radius: 8px; padding: 3px 10px; line-height: 1.2; text-align: center; }
.chg-item small { color: var(--muted); font-size: 10px; }
.chg-item b { font-family: var(--mono); font-size: 13px; }
.chart-wrap { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
.chart-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.live-ind { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; color: var(--muted); margin-right: auto; margin-left: 8px; }
.live-ind i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live-ind.idle { color: var(--text-2); } .live-ind.idle i { background: var(--up); opacity: .6; }
.live-ind.on { color: var(--up); } .live-ind.on i { background: var(--up); animation: pulse 1.2s infinite; box-shadow: 0 0 0 3px var(--up-bg); }
.price-xl { transition: color .4s; } .tick-up { animation: tu .7s; } .tick-down { animation: td .7s; }
@keyframes tu { from { color: var(--up); } } @keyframes td { from { color: var(--down); } }
.legend { display: flex; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 4px; }
.chart-box { height: 380px; }
.chart-empty { position: absolute; inset: 42px 0 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-size: 13px; background: rgba(15,19,25,.6); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.seg.block { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg.block button { padding: 8px 4px; }
.seg.small { margin: 2px 0; }

.grad-card { background: linear-gradient(135deg, rgba(240,185,11,.08), rgba(22,199,132,.06)); border: 1px solid rgba(240,185,11,.25);
  border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.grad-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.grad-top b { font-size: 15px; }
.grad-card .progress { height: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.metric { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-width: 0; cursor: help; }
.metric small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.metric small::after { content: "ⓘ"; opacity: .5; font-size: 10px; }
.metric b { display: block; font-family: var(--mono); font-size: 15px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric em { font-style: normal; font-size: 11px; }
.metric.good b { color: var(--up); } .metric.warn b { color: var(--gold); } .metric.bad b { color: var(--down); }
.mint-line { display: grid; gap: 2px; }
.cta-bar { position: sticky; bottom: 0; padding-top: 4px; background: linear-gradient(transparent, var(--panel) 30%); }

/* ── panel lateral ── */
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.stab { background: none; border: 0; color: var(--muted); padding: 13px 8px; font-weight: 700; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent; display: flex; justify-content: center; align-items: center; gap: 6px; }
.stab.on { color: var(--text); border-bottom-color: var(--gold); }
.side-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sum { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.sum small { color: var(--muted); font-size: 11px; display: block; }
.sum b { font-family: var(--mono); font-size: 16px; }
.cards { display: grid; gap: 10px; }
.how { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.how summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.how ul { margin: 8px 0 2px; padding-left: 18px; color: var(--text-2); }

/* cards */
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; position: relative; overflow: hidden; }
.card.stripe::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.card.stripe.bajo::before { background: var(--up); } .card.stripe.medio::before { background: var(--gold); } .card.stripe.alto::before { background: var(--down); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-id { display: flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; }
.card-id b { font-size: 15px; }
.risk { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.risk.bajo { background: var(--up-bg); color: var(--up); } .risk.medio { background: var(--gold-bg); color: var(--gold); }
.risk.alto { background: var(--down-bg); color: var(--down); }
.kv3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 8px; }
.kv3 div { background: var(--bg-2); border-radius: 8px; padding: 6px 8px; }
.kv3 small { display: block; color: var(--muted); font-size: 10.5px; }
.kv3 b { font-family: var(--mono); font-size: 13px; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.reasons li { display: flex; gap: 6px; } .reasons li::before { content: "✓"; color: var(--up); font-weight: 800; }
.reasons li.warn::before { content: "!"; color: var(--gold); width: 10px; text-align: center; }
.reasons li.warn { color: var(--text-2); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.actions .btn { flex: 1; }

/* trading automático */
.auto-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.auto-card.on { border-color: rgba(22,199,132,.45); background: linear-gradient(135deg, rgba(22,199,132,.07), var(--panel-2) 60%); }
.auto-card.stopped { border-color: rgba(234,57,67,.5); }
.auto-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.auto-top b { font-size: 15px; } .auto-top small { display: block; color: var(--muted); font-size: 11.5px; }
.auto-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.auto-stats div { background: var(--bg-2); border-radius: 8px; padding: 6px 8px; }
.auto-stats small { display: block; color: var(--muted); font-size: 10.5px; }
.auto-stats b { font-family: var(--mono); font-size: 13.5px; }
.meter { height: 4px; background: var(--line); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--blue); }
.meter.bad i { background: var(--down); }
.auto-rules { font-size: 11.5px; color: var(--muted); }
.badge.auto { color: #111; background: var(--up); }

/* posiciones */
.badge { font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 4px; }
.badge.paper { color: var(--blue); background: var(--blue-bg); } .badge.live { color: #fff; background: var(--down); }
.st { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.st.open { color: var(--up); background: var(--up-bg); } .st.paused { color: var(--gold); background: var(--gold-bg); }
.st.closed { color: var(--muted); background: var(--panel-3); } .st.exiting { color: #fff; background: var(--down); }
.pnl-big { text-align: right; line-height: 1.15; }
.pnl-big b { font-family: var(--mono); font-size: 18px; display: block; }
.pnl-big small { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; font-size: 12px; margin-top: 10px; }
.kv small { display: block; color: var(--muted); font-size: 10.5px; }
.kv b { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.fills { margin-top: 8px; font-size: 12px; }
.fills summary { cursor: pointer; color: var(--muted); }
.fill { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-family: var(--mono); font-size: 11.5px; }
.fill .why { font-family: var(--sans); font-weight: 700; }
.fill.fail { color: var(--down); }

/* escalera de precios (SL — entrada — actual — TPs) */
.ladder { position: relative; height: 58px; margin: 12px 8px 4px; }
.ladder.tall { height: 74px; }
.ladder .mk.low span { top: 54px; font-size: 9.5px; }
.ladder .mk.low em { display: none; }
.ladder .mk.edge-l span, .ladder .mk.edge-l em { left: -2px; }
.ladder .mk.edge-r span, .ladder .mk.edge-r em { right: -2px; }
.ladder .track { position: absolute; left: 0; right: 0; top: 26px; height: 6px; border-radius: 4px;
  background: linear-gradient(90deg, var(--down-bg), var(--panel-3) 40%, var(--up-bg)); }
.ladder .fillbar { position: absolute; top: 26px; height: 6px; border-radius: 4px; }
.ladder .mk { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px;
  font-size: 10px; font-weight: 700; white-space: nowrap; }
.ladder .mk i { width: 2px; height: 16px; border-radius: 2px; margin-top: 18px; }
.ladder .mk span { order: -1; position: absolute; top: 0; }
.ladder .mk em { font-style: normal; font-family: var(--mono); font-weight: 500; color: var(--muted); position: absolute; top: 40px; }
.ladder .mk.sl { color: var(--down); } .ladder .mk.sl i { background: var(--down); }
.ladder .mk.entry { color: var(--blue); } .ladder .mk.entry i { background: var(--blue); }
.ladder .mk.tp { color: var(--up); } .ladder .mk.tp i { background: var(--up); }
.ladder .mk.tp.done { opacity: .45; }
.ladder .mk.trail { color: var(--gold); } .ladder .mk.trail i { background: var(--gold); }
.ladder .now { position: absolute; top: 21px; width: 16px; height: 16px; border-radius: 50%; transform: translateX(-50%);
  background: #fff; border: 3px solid var(--panel-2); box-shadow: 0 0 0 2px #fff; z-index: 2; }
.ladder .now.pos { box-shadow: 0 0 0 2px var(--up); } .ladder .now.neg { box-shadow: 0 0 0 2px var(--down); }

.rules-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; }
.chip.sl { color: var(--down); border-color: rgba(234,57,67,.4); }
.chip.tp { color: var(--up); border-color: rgba(22,199,132,.35); } .chip.tp.done { opacity: .55; text-decoration: line-through; }
.chip.trail { color: var(--gold); border-color: rgba(240,185,11,.4); }
.chip.trail.active { background: var(--gold-bg); }

/* ── dialogs / sheets ── */
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 0;
  width: min(560px, 96vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.small { width: min(420px, 94vw); }
dialog::backdrop { background: rgba(3,5,8,.72); backdrop-filter: blur(2px); }
.form { padding: 16px; display: grid; gap: 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3, .form h3 { margin: 0; font-size: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; display: grid; gap: 10px; margin: 0; }
legend { color: var(--text-2); font-size: 12px; font-weight: 700; padding: 0 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.sticky-actions { position: sticky; bottom: -16px; background: var(--panel); padding: 12px 16px 16px; margin: 0 -16px -16px; border-top: 1px solid var(--line); z-index: 3; }
.note { font-size: 12.5px; border-radius: 8px; padding: 8px 10px; }
.note.paper { background: var(--blue-bg); color: #a9c6ff; } .note.live { background: var(--down-bg); color: #ffb3b8; font-weight: 700; }
.step { display: grid; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.step-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.step-title span { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #111; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.step-title span:empty { display: none; }
.paste-row { display: flex; gap: 8px; } .paste-row input { font-family: var(--mono); font-size: 13px; }
.token-chip { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
.token-chip .grow { flex: 1; min-width: 0; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.presets button { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; color: var(--text); text-align: left; cursor: pointer; display: grid; gap: 2px; }
.presets button small { color: var(--muted); font-size: 10.5px; }
.presets button.on { border-color: var(--gold); background: var(--gold-bg); }
.rule { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.rule-body { font-size: 13.5px; color: var(--text-2); line-height: 2.1; }
.rule.off .rule-body { opacity: .35; pointer-events: none; }
.tp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tp-row .n { width: 28px; color: var(--up); font-weight: 800; font-size: 12px; }
.tp-row .num { width: 68px; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; grid-template-columns: none; }
.switch input { display: none; }
.switch span { width: 38px; height: 22px; border-radius: 12px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; }
.switch input:checked + span { background: var(--up); }
.switch input:checked + span::after { transform: translateX(16px); }
.summary-table { display: grid; gap: 0; font-size: 12.5px; }
.srow { display: grid; grid-template-columns: 1.1fr 1fr .7fr 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.srow.h { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.srow b { font-family: var(--mono); font-weight: 600; } .srow .r { text-align: right; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translate(-50%, 10px); background: var(--panel-3);
  border: 1px solid var(--line-2); color: var(--text); padding: 11px 16px; border-radius: 12px; opacity: 0; transition: all .2s;
  pointer-events: none; z-index: 60; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13.5px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: var(--up); } .toast.bad { border-color: var(--down); }

/* ── tabbar móvil ── */
.tabbar { display: none; }

/* ═══════════════ responsive ═══════════════ */
@container market (max-width: 470px) {
  .col-spark { display: none; }
  .list-head, .trow { grid-template-columns: minmax(0, 1.5fr) minmax(0, .95fr) minmax(0, 1.05fr) minmax(0, .75fr); }
}
@media (min-width: 861px) { .market .chips { flex-wrap: wrap; row-gap: 6px; } }
@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.35fr); grid-template-rows: auto auto; height: auto; }
  .market, .detail { height: calc(100dvh - 80px); }
  .side { grid-column: 1 / -1; max-height: 720px; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 10px; }
  .brand-txt, .health span, .hide-s, .tick:nth-child(n+3), .side-tabs { display: none; }
  .ticker { gap: 14px; }
  .layout { display: block; padding: 0; height: auto; }
  .panel { display: none; border: 0; border-radius: 0; background: var(--bg); }
  .panel.active { display: flex; min-height: calc(100dvh - 56px - var(--tabbar-h)); }
  .market.active, .side.active { height: calc(100dvh - 56px - var(--tabbar-h) - env(safe-area-inset-bottom)); }
  .detail.active { padding-bottom: calc(var(--tabbar-h) + 4px); overflow: visible; }
  .side { max-height: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-box { height: 46vh; min-height: 280px; }
  .list-head, .trow { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .95fr) !important; }
  .col-spark, .col-vol { display: none; }
  .trow { padding: 10px 12px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15,19,25,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar button { background: none; border: 0; color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 2px; position: relative; cursor: pointer; }
  .tabbar i { font-style: normal; font-size: 19px; filter: grayscale(1); opacity: .7; }
  .tabbar span { font-size: 11px; font-weight: 600; }
  .tabbar button.on { color: var(--gold); } .tabbar button.on i { filter: none; opacity: 1; }
  .nb { position: absolute; top: 6px; left: calc(50% + 6px); font-style: normal; background: var(--down); color: #fff; font-size: 10px; font-weight: 800; border-radius: 9px; padding: 0 5px; min-width: 16px; text-align: center; }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .presets { grid-template-columns: 1fr; }
  .presets button { grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .cta-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 10px 12px; z-index: 35;
    background: linear-gradient(transparent, var(--bg) 35%); }
  #detail { padding-bottom: 70px; }
  .d-links .btn { flex: 1; }
  .d-links { width: 100%; }
  .price-xl { font-size: 26px; }
}
@media (max-width: 380px) {
  .chg-group { width: 100%; } .chg-item { flex: 1; }
  .kv3 { grid-template-columns: 1fr 1fr; }
}
