:root {
  /* elFula solo tiene modo oscuro */
  --green: #0E8F5B;
  --green-2: #14A86B;
  --green-3: #0A6B45;
  --ink: #0F2E22;
  --gold: #F5B700;
  --bg: #0B1712;
  --card: #12221B;
  --text: #E8F3EE;
  --muted: #93AAA0;
  --line: #1F3329;
  --buy: #3DDC97;
  --sell: #FB923C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --radius: 20px;
  --pill-active: var(--green);  /* pestañas y chips seleccionados */
  --nav-active: var(--buy);     /* sección actual de la barra inferior */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Montserrat, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- barra superior */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 560px; margin: 0 auto; padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 23px; font-weight: 800; letter-spacing: -1px; }
.brand img { display: block; }
.brand .el { color: var(--green); font-weight: 800; }
.brand b { font-weight: 800; }

/* ---------- hero USDT */
.hero {
  position: relative; overflow: hidden;
  margin-top: 4px; padding: 20px 20px 16px; border-radius: 26px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #1BC27E 0%, var(--green) 45%, var(--green-3) 100%);
  box-shadow: 0 12px 32px rgba(10, 107, 69, .35);
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: var(--gold); opacity: .18;
}
.hero-head { display: flex; justify-content: space-between; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(245, 183, 0, .25); }
.hero h1 { margin: 14px 0 10px; font-size: 15px; font-weight: 600; opacity: .9; }
.hero-rates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.hero-rate { display: flex; flex-direction: column; }
.hero-rate .label { font-size: 12px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .6px; }
.hero-rate strong { font-size: clamp(34px, 11vw, 46px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-rate .hint { font-size: 12px; opacity: .75; }
.divider { width: 1px; background: rgba(255, 255, 255, .25); }
.hero-foot { position: relative; z-index: 1; margin-top: 12px; font-size: 12px; opacity: .85; min-height: 18px; }
.hero-more {
  position: relative; z-index: 1; margin-top: 12px; width: 100%; padding: 11px; border-radius: 14px; border: 0;
  background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700;
}
.hero-more:active { background: rgba(255, 255, 255, .26); }

/* ---------- calculadora */
.calc { margin-top: 16px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.calc h2 { margin: 0 0 12px; font-size: 15px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.seg button { border: 0; padding: 9px; border-radius: 11px; background: transparent; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.calc-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: 12px; }
.calc .arrow { color: var(--muted); margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.field input, .field output {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: 700 20px Montserrat, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.field input:focus { outline: 2px solid var(--green-2); outline-offset: 1px; }
.field output { background: transparent; border-style: dashed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- pestañas y tarjetas */
.tabs { display: flex; gap: 8px; margin: 24px 0 6px; }
.tabs button {
  border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted);
}
.tabs button[aria-selected="true"] { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.tab-note { margin: 4px 2px 12px; font-size: 12px; color: var(--muted); }
.cards { display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--radius); border: 0; background: var(--card); box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.card:active { transform: scale(.98); }
.badge {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -.5px;
}
.card .name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.card .sub { font-size: 12px; color: var(--muted); }
.card .nums { display: grid; grid-template-columns: auto auto; gap: 2px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.card .k { font-size: 11px; font-weight: 600; color: var(--muted); align-self: center; }
.card .v { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.card .v.buy { color: var(--buy); }
.card .v.sell { color: var(--sell); }
.card .v.none { color: var(--line); }
.skeleton { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--line), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 20px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }

.about { margin: 28px 4px 0; font-size: 13px; color: var(--muted); }
.about b { color: var(--text); }

/* ---------- hoja inferior con los merchants */
.sheet {
  width: 100%; max-width: 560px; max-height: 85vh; margin: auto auto 0; padding: 8px 16px 24px;
  border: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); overflow: auto;
}
.sheet::backdrop { background: rgba(5, 20, 14, .45); backdrop-filter: blur(2px); }
.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); }
.offers { list-style: none; margin: 12px 0 0; padding: 0; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.offer:last-child { border-bottom: 0; }
.offer .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.offer .who a { color: inherit; text-decoration: none; }
.offer .when { font-size: 12px; color: var(--muted); }
.offer .rate { font-weight: 800; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.offer .tiers { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.out { text-decoration: line-through; opacity: .6; }

@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ================================================== navegación inferior y vistas */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.view[hidden] { display: none; }
.view { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.view-title { margin: 8px 2px 2px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.view-sub { margin: 0 2px 16px; font-size: 13px; color: var(--muted); }
.panel { padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 560px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@media (min-width: 560px) { .bottom-nav { bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); } }
.bottom-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; border-radius: 14px; text-decoration: none; color: var(--muted);
  font-size: 11px; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a[aria-current="page"] { color: var(--nav-active); }
.bottom-nav a[aria-current="page"] svg { stroke-width: 2.4; }
.bottom-nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 2px; width: 44px; height: 30px; border-radius: 12px;
  background: color-mix(in srgb, var(--green) 14%, transparent); z-index: -1;
}
.nav-dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--card); }

/* ---------- Convertir */
.conv { display: grid; gap: 10px; }
.conv-in { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.conv select, .alert-form select {
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: 700 15px Montserrat, system-ui, sans-serif;
}
.conv-in select { max-width: 150px; }
.swap { justify-self: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--green); display: grid; place-items: center; }
.conv-how { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Merchants */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; margin-bottom: 12px;
  border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--muted);
}
.search input { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: transparent; color: var(--text); font: 600 15px Montserrat, system-ui, sans-serif; outline: none; }
.mlist, .alist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.merchant { display: block; padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.merchant .mh { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.merchant .mname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant .mwhen { font-size: 12px; color: var(--muted); }
.merchant .mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip.buy { color: var(--buy); background: color-mix(in srgb, var(--buy) 12%, transparent); }
.chip.sell { color: var(--sell); background: color-mix(in srgb, var(--sell) 12%, transparent); }
.more-btn { width: 100%; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; background: transparent; color: var(--muted); font-weight: 600; }

/* ---------- Alertas */
.alert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.alert-form input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 700 15px Montserrat, system-ui, sans-serif; }
.primary { width: 100%; padding: 13px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; }
.primary:active { background: var(--green-3); }
.alist { margin-top: 16px; }
.alert { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.alert.hit { outline: 2px solid var(--gold); }
.alert .at { font-weight: 700; }
.alert .now { font-size: 12px; color: var(--muted); }
.alert .del { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); }

/* ---------- Más */
.menu { padding: 4px 16px; }
.menu-item { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item small { color: var(--muted); font-size: 12.5px; }
.mi-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); font-weight: 800; }

[hidden] { display: none !important; }


/* ================================================== inicio tipo exchange */
.spot { text-align: center; padding: 18px 0 8px; }
.spot-main { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin-top: 18px; padding: 0; border: 0; background: none; }
.spot-label { font-size: 15px; font-weight: 600; color: var(--muted); }
.spot-label small { font-weight: 500; }
.spot-price { display: flex; align-items: baseline; gap: 8px; }
.spot-price strong { font-size: clamp(56px, 19vw, 84px); font-weight: 800; letter-spacing: -3px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.unit { font-size: 18px; font-weight: 700; color: var(--muted); }
.chg { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chg:empty { display: none; }
.chg.up { color: var(--buy); background: color-mix(in srgb, var(--buy) 14%, transparent); }
.chg.down { color: var(--sell); background: color-mix(in srgb, var(--sell) 14%, transparent); }
.chg.flat { color: var(--muted); background: var(--line); }
.spot-sides, .d-sides { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 18px; }
.spot-sides div, .d-sides div { padding: 10px 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left; }
.spot-sides span, .d-sides span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.spot-sides b, .d-sides b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
b.buy { color: var(--buy); }
b.sell { color: var(--sell); }

.market-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 8px; }
.market-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.switch { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.switch button { border: 0; padding: 7px 12px; border-radius: 9px; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); }
.switch button[aria-selected="true"] { background: var(--green); color: #fff; }
.switch.sm button { padding: 6px 10px; font-size: 12px; }
.market-cols { display: grid; grid-template-columns: 1fr 76px 112px; gap: 10px; padding: 0 14px 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.market-cols span:nth-child(2) { text-align: center; }
.market-cols span:last-child { text-align: right; }
.markets { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.mrow { display: grid; grid-template-columns: 1fr 76px 112px; gap: 10px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.markets li:last-child .mrow { border-bottom: 0; }
.mrow:active { background: var(--bg); }
.mrow .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; flex: none; }
.mrow .nm { font-weight: 700; line-height: 1.2; }
.mrow .pq { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .px { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mrow .px b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mrow .chg { font-size: 11.5px; padding: 2px 6px; }
.spark { width: 76px; height: 30px; display: block; }
.markets .empty { box-shadow: none; }

/* ================================================== detalle */
.detail-top { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; margin: 4px 0 14px; }
.back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text); background: var(--card); box-shadow: var(--shadow); }
.detail-name { display: flex; align-items: center; gap: 10px; font-size: 18px; min-width: 0; }
.detail-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.d-price strong { font-size: clamp(40px, 13vw, 56px); font-weight: 800; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.d-note { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.chart-box, .book-box, #view-par > .panel { margin-top: 14px; }
.ranges { display: flex; gap: 6px; margin-bottom: 8px; }
.ranges button { border: 0; padding: 5px 10px; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; font-size: 12px; }
.ranges button[aria-selected="true"] { background: var(--bg); color: var(--text); }
.chart { position: relative; height: 220px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line, .liq-chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis text, .liq-chart .axis text { fill: var(--muted); font-size: 10px; font-family: Montserrat, system-ui, sans-serif; }
.chart .l-mid { fill: none; stroke: var(--green-2); stroke-width: 2.4; stroke-linejoin: round; }
.chart .l-buy { fill: none; stroke: var(--buy); stroke-width: 1.3; stroke-dasharray: 4 3; opacity: .8; }
.chart .l-sell { fill: none; stroke: var(--sell); stroke-width: 1.3; stroke-dasharray: 4 3; opacity: .8; }
.chart .cross line { stroke: var(--muted); stroke-width: 1; }
.chart .cross circle { fill: var(--green-2); stroke: var(--card); stroke-width: 2; }
.tip { position: absolute; top: 0; padding: 6px 9px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11.5px; line-height: 1.35; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; background: none; box-shadow: none; }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.mid::before { background: var(--green-2); }
.lg.buy::before { background: var(--buy); }
.lg.sell::before { background: var(--sell); }

/* libro de órdenes: compras a la izquierda, ventas a la derecha, barras de profundidad */
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; font-variant-numeric: tabular-nums; }
.book .bh { display: grid; grid-template-columns: 1fr 1fr; padding: 0 6px 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.book .bid .bh span:last-child { text-align: right; }
.book .ask .bh span:last-child { text-align: right; }
.brow { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px 6px; font-size: 13px; }
.brow i { position: absolute; top: 1px; bottom: 1px; border-radius: 4px; z-index: 0; }
.brow span { position: relative; z-index: 1; }
.bidrow i { right: 0; background: color-mix(in srgb, var(--buy) 16%, transparent); }
.askrow i { left: 0; background: color-mix(in srgb, var(--sell) 16%, transparent); }
.bidrow .q { color: var(--muted); }
.bidrow .p { color: var(--buy); font-weight: 700; text-align: right; }
.askrow .p { color: var(--sell); font-weight: 700; }
.askrow .q { color: var(--muted); text-align: right; }
.spread { grid-column: 1 / -1; display: flex; justify-content: center; gap: 6px; padding: 10px 0 2px; font-size: 12px; color: var(--muted); }
.spread b { color: var(--text); }

/* debajo del libro: presión compra / venta y órdenes por precio (rellena la tarjeta hasta abajo) */
.book-box { display: flex; flex-direction: column; }
.book-more { flex: 1; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.press { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.press .buy { color: var(--buy); }
.press .sell { color: var(--sell); }
.press i { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--sell) 60%, transparent); overflow: hidden; }
.press i b { display: block; height: 100%; background: var(--buy); }
.depth-head { display: flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.depth-head > span:first-child { margin-right: auto; }
.depth { position: relative; flex: 1; min-height: 110px; }
.depth svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.depth .d-b { fill: var(--buy); opacity: .8; }
.depth .d-s { fill: var(--sell); opacity: .8; }
.depth g:hover .d-b, .depth g:hover .d-s { opacity: 1; }
.depth .d-axis { stroke: var(--line); }
.depth-x { position: relative; height: 14px; font-size: 10.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.depth-x span { position: absolute; top: 0; }
.depth-x .pk { transform: translateX(-50%); color: var(--text); }
.book .none { padding: 10px 6px; font-size: 12px; color: var(--muted); }
#view-par .seg { margin-bottom: 4px; }
.mrow .who > span:last-child { min-width: 0; overflow: hidden; }
.mrow .pq, .mrow .nm { display: block; }



/* ================================================== v3: barra con Tasas al centro, ETECSA, TV, referencia */
.spot-sides { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: row; }
.spot-sides:has(.refbox), .d-sides { grid-template-columns: 1fr 1fr 1fr; grid-auto-flow: row; }
.refbox b { color: var(--muted); }
.spot-sides b, .d-sides b { font-size: 18px; }
.spot.small { padding-top: 4px; }
.spot.small .spot-main { margin-top: 4px; }
.spot.small .spot-price strong { font-size: clamp(44px, 15vw, 64px); }
.list-title { margin: 22px 2px 10px; font-size: 15px; font-weight: 800; }
.panel h3 small { font-size: 12px; font-weight: 600; color: var(--muted); }

.bottom-nav a.center { justify-content: flex-end; }
.center-btn {
  display: grid; place-items: center; width: 60px; height: 60px; margin-top: -30px; border-radius: 20px;
  background: linear-gradient(135deg, var(--green-2), var(--green-3)); color: #fff;
  box-shadow: 0 8px 20px rgba(10, 107, 69, .4); border: 3px solid var(--bg);
}
.bottom-nav a.center[aria-current="page"]::before { display: none; }
.bottom-nav a.center svg { stroke: #fff; width: 34px; height: 34px; stroke-width: 1.8; }
.bottom-nav a.center svg rect { fill: #fff; }
.bottom-nav a.center[aria-current="page"] .center-btn { transform: translateY(-2px); }

.lg.ref::before { background: repeating-linear-gradient(90deg, #94A3B8 0 4px, transparent 4px 7px); }
.chart .l-ref { fill: none; stroke: #94A3B8; stroke-width: 1.6; stroke-dasharray: 6 4; }

.equiv { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.equiv li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.equiv li:last-child { border-bottom: 0; }
.equiv .who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.equiv b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sm-calc { margin-top: 16px; display: grid; gap: 12px; }
.sm-calc .equiv { box-shadow: none; background: var(--bg); }
.sm-calc input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 700 20px Montserrat, system-ui, sans-serif; }

.chips { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--card); padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); }
.chips button[aria-selected="true"] { background: var(--pill-active); border-color: var(--pill-active); color: #fff; }
.tvrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.markets li:last-child .tvrow { border-bottom: 0; }
.tvrow .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tvrow .nm { display: block; font-weight: 700; }
.tvrow .pq { display: block; font-size: 12px; color: var(--muted); }
.tvrow .px { text-align: right; }
.tvrow .px b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tvrow .px small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-title { margin-bottom: 2px; }
#view-tv .market-head { margin-top: 8px; }
.mrow .pq { white-space: normal; font-size: 11.5px; line-height: 1.3; }
.spot-sides:has(.refbox), .d-sides { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
#view-etecsa .spot-price strong { font-size: clamp(64px, 22vw, 96px); }
#view-etecsa .spot-price .unit { font-size: 24px; }
#view-tasas .spot-price strong { font-size: clamp(72px, 26vw, 112px); }
#view-tasas .spot-price .unit { font-size: 26px; }

.noof { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; }

.tvrow { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: inherit; }
.markets li:last-child .tvrow { border-bottom: 0; }
.tvrow:active { background: var(--bg); }

/* ---- icono activo del menú: animación lenta en bucle, distinta para cada sección */
.bottom-nav svg, .bottom-nav svg * { transform-box: fill-box; transform-origin: center; }
.bottom-nav a[data-nav="convertir"][aria-current="page"] svg { animation: nav-swap 3.2s ease-in-out infinite; }
.bottom-nav a[data-nav="etecsa"][aria-current="page"] svg { animation: nav-ring 3.6s ease-in-out infinite; }
.bottom-nav a[data-nav="tv"][aria-current="page"] svg { animation: nav-glow 3s ease-in-out infinite; }
.bottom-nav a[data-nav="mas"][aria-current="page"] svg { animation: nav-breathe 3s ease-in-out infinite; }
.bottom-nav a.center[aria-current="page"] svg rect { animation: nav-candle 2.8s ease-in-out infinite; }
.bottom-nav a.center[aria-current="page"] svg rect:nth-of-type(2) { animation-delay: .35s; }
.bottom-nav a.center[aria-current="page"] svg rect:nth-of-type(3) { animation-delay: .7s; }
.bottom-nav a.center[aria-current="page"] .center-btn { animation: nav-float 3.6s ease-in-out infinite; }

@keyframes nav-swap    { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(2px); } 75% { transform: translateX(-2px); } }
@keyframes nav-ring    { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-9deg); } 76% { transform: rotate(8deg); } 84% { transform: rotate(-5deg); } 92% { transform: rotate(3deg); } }
@keyframes nav-glow    { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes nav-breathe { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.78); } }
@keyframes nav-candle  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes nav-float   { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(-5px); } }

/* ---- liquidez ofrecida (detalle del par) */
.liq { margin: 14px 0; padding: 14px 16px 10px; }
.liq-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.liq-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.liq-head strong { display: block; margin-top: 2px; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.liq-head strong small { font-size: 13px; font-weight: 600; color: var(--muted); }
.liq-split { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; font-weight: 600; }
.liq-split .buy { color: var(--buy); } .liq-split .sell { color: var(--sell); }
.info-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -5px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.liq-chart { position: relative; height: 90px; margin-top: 8px; }
.liq-chart svg { width: 100%; height: 100%; display: block; }
.liq-chart .empty { height: 100%; display: grid; place-items: center; font-size: 12.5px; color: var(--muted); }
.l-liq { fill: none; stroke: var(--gold, #F59E0B); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.liq-info { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--green) 8%, transparent); font-size: 13px; line-height: 1.5; animation: fade .18s ease-out; }
.liq-info p { margin: 0 0 8px; } .liq-info p:last-child { margin: 0; color: var(--muted); }

/* detalle: Te compran / Te venden van debajo del precio, antes de la gráfica */
#view-par .d-sides { margin: 14px 0 0; }

/* ================================================== mercados en pantallas estrechas */
.mrow, .market-cols { grid-template-columns: minmax(0, 1fr) 76px auto; }
.mrow .px { min-width: 0; }
@media (max-width: 420px) {
  .mrow, .market-cols { grid-template-columns: minmax(0, 1fr) 54px auto; gap: 8px; }
  .mrow { padding: 11px 12px; }
  .market-cols { padding: 0 12px 6px; }
  .mrow .spark { width: 54px; height: 24px; }
  .mrow .who { gap: 8px; }
  .mrow .px b { font-size: 15.5px; }
}
@media (max-width: 350px) {
  .mrow, .market-cols { grid-template-columns: minmax(0, 1fr) auto; }
  .mrow .spark, .market-cols span:nth-child(2) { display: none; }
  .mrow .badge.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
}

/* ================================================== cuenta (inicio de sesión opcional) */
.account {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; color: var(--muted); overflow: hidden;
}
.account svg { width: 22px; height: 22px; }
.account.in { border-color: color-mix(in srgb, var(--buy) 55%, transparent); }
.avatar {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--green); color: #fff; font-weight: 800; font-size: 16px; text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 76px; height: 76px; margin: 4px auto 12px; font-size: 30px; }

.sheet {
  width: 100%; max-width: 480px; max-height: 90dvh; margin: auto auto 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
.sheet[open] { animation: sheet-in .2s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet::backdrop { background: rgba(0, 0, 0, .6); }
@media (min-width: 560px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet-x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); color: var(--muted);
}
.sheet-title { margin: 0 44px 6px 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.sheet-sub { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
#auth-in { text-align: center; }
#auth-in .sheet-title { margin: 0 0 4px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px 16px;
  border: 0; border-radius: 14px; font-weight: 700; font-size: 15px;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-tg { background: #2AABEE; color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn-link { background: none; color: var(--muted); font-weight: 600; padding: 10px; }
.auth-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600;
  color: var(--sell); background: color-mix(in srgb, var(--sell) 12%, transparent); }

/* ---------- correo: código de 6 cifras */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.email-form { display: grid; gap: 10px; }
.email-input {
  width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: 600 16px Montserrat, system-ui, sans-serif;
}
.email-input:focus { outline: 2px solid var(--green-2); outline-offset: 1px; }
.code-input { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 10px; font-variant-numeric: tabular-nums; }
.btn-mail { background: var(--green); color: #fff; }
.email-sent { margin: 0; font-size: 13.5px; color: var(--muted); }
.email-sent b { color: var(--text); word-break: break-all; }
.email-links { display: flex; justify-content: space-between; }
.email-links .btn-link { width: auto; font-size: 13px; }

/* ---------- Telegram: esperando la confirmación en el bot */
.tg-wait { display: grid; gap: 14px; }
.tg-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.tg-steps b { color: var(--text); }
.tg-code {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line);
}
.tg-code span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tg-code b { font-size: 26px; font-weight: 800; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
.btn-tg { text-decoration: none; }
.tg-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 13px; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--buy);
  animation: spin .9s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mini App de Telegram (<html class="tg">) */
.tg .bottom-nav { padding-bottom: calc(6px + max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px))); }
.tg #auth-logout { display: none; }   /* dentro de Telegram la sesión es la de tu cuenta de Telegram */
.tg-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.tg-note { display: none; }
.tg .tg-note { display: block; }

/* ================================================== PC: menú lateral, barra superior y panel (dashboard)
   En el teléfono nada de esto se ve: la marca y el estado del menú lateral, el título de la barra superior y
   las tarjetas de arriba están ocultos, y d-main / d-more no agrupan nada (display: contents). */
.top-right { display: flex; align-items: center; gap: 12px; }
.top-head, .live, .kpis, .bottom-nav .side-brand, .side-foot { display: none; }
.d-main, .d-more { display: contents; }
.live-dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--buy); }
.live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--buy); opacity: 0;
  animation: live 2.4s ease-out infinite;
}
@keyframes live { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.3); opacity: 0; } }

/* tarjetas de las monedas principales (solo en PC, con la lista y el detalle) */
.kpi {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px 12px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text);
  text-align: left; box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--buy) 40%, var(--line)); }
.kpi.sel { outline: 2px solid var(--buy); outline-offset: 2px; }
.kpi-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-name { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.2; }
.kpi-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.kpi-price .chg { flex: none; align-self: center; margin-left: auto; padding: 2px 7px; font-size: 11.5px; letter-spacing: 0; }
.kpi-price { display: flex; align-items: baseline; gap: 6px; }
.kpi-price b { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-price small { font-size: 13px; font-weight: 700; color: var(--muted); }
.kpi-spark { display: block; width: 100%; height: 36px; }
.kpi.lead {
  border-color: transparent; color: #fff; box-shadow: 0 10px 28px rgba(10, 107, 69, .35);
  background: radial-gradient(130% 150% at 100% 0%, #19B574 0%, var(--green) 48%, var(--green-3) 100%);
}
.kpi.lead .kpi-name small, .kpi.lead .kpi-price small { color: rgba(255, 255, 255, .78); }
.kpi.lead .chg { color: #fff; background: rgba(255, 255, 255, .2); }
.kpi-skel { height: 132px; border-radius: 18px; }

/* PC: arriba la barra con las secciones; a la izquierda, fija, la lista de pares (la vista Tasas); en el medio
   el contenido (el detalle del par elegido, o la sección); a la derecha, fijo, el chat del par (desde 1280 px). */
#chat-dock { display: none; }
@media (min-width: 1024px) {
  :root { --navh: 64px; --pairs: 288px; --chatw: 0px; }
  body[data-chat] { --chatw: 360px; }
  html { scrollbar-color: var(--line) transparent; }
  body {
    padding-bottom: 0;
    background: radial-gradient(1100px 520px at 50% -12%, rgba(20, 168, 107, .08), transparent 70%) fixed, var(--bg);
  }
  :focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }

  /* ---- barra superior: marca, secciones, estado en vivo y cuenta */
  .top {
    z-index: 20; height: var(--navh); max-width: none; margin: 0; padding: 0 20px; gap: 16px;
    border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent);
  }
  .top-head { display: none; }
  .live {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  }
  /* la barra de abajo del teléfono pasa a la barra superior, después de la marca */
  .bottom-nav {
    top: 0; bottom: auto; left: 176px; right: auto; z-index: 21; width: auto; max-width: none; height: var(--navh);
    margin: 0; padding: 0; display: flex; align-items: center; gap: 2px;
    border: 0; border-radius: 0; box-shadow: none; background: none; backdrop-filter: none;
  }
  .bottom-nav .side-brand, .side-foot { display: none; }
  .bottom-nav a[data-nav] {
    flex-direction: row; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  }
  .bottom-nav svg { width: 18px; height: 18px; }
  .bottom-nav a[data-nav]:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
  .bottom-nav a[data-nav][aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--green) 22%, transparent); }
  .bottom-nav a[data-nav][aria-current="page"] svg { stroke: var(--buy); }
  .bottom-nav a[data-nav][aria-current="page"]::before { display: none; }
  .bottom-nav a.center { order: -2; justify-content: flex-start; }
  .bottom-nav a.nav-desk { display: flex; order: -1; }
  .bottom-nav .center-btn { display: contents; }
  .bottom-nav a.center svg { stroke: currentColor; width: 18px; height: 18px; stroke-width: 2; }
  .bottom-nav a.center svg rect { fill: none; animation: none; }
  .bottom-nav a.center[aria-current="page"] svg { stroke: var(--buy); stroke-width: 2.2; }

  /* ---- menú lateral: la lista de pares, siempre a la vista */
  #view-tasas {
    position: fixed; top: var(--navh); left: 0; bottom: 0; z-index: 4; width: var(--pairs);
    padding: 14px 12px 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; animation: none;
    border-right: 1px solid var(--line); background: color-mix(in srgb, var(--card) 40%, var(--bg));
  }
  #view-tasas .spot { padding: 0; text-align: left; }
  #view-tasas .spot-main {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; margin: 0; padding: 14px 16px;
    border-radius: 16px; color: #fff; text-align: left; box-shadow: 0 8px 22px rgba(10, 107, 69, .3);
    background: radial-gradient(130% 150% at 100% 0%, #19B574 0%, var(--green) 48%, var(--green-3) 100%);
  }
  #view-tasas .spot-main.sel { outline: 2px solid var(--buy); outline-offset: 2px; }
  #view-tasas .spot-label { grid-column: 1 / -1; font-size: 12.5px; color: rgba(255, 255, 255, .85); }
  #view-tasas .spot-price strong { font-size: 32px; letter-spacing: -1px; }
  #view-tasas .spot-price .unit { font-size: 13px; color: rgba(255, 255, 255, .75); }
  #view-tasas .spot-main .chg { color: #fff; background: rgba(255, 255, 255, .2); }
  #view-tasas .market-head { margin: 18px 4px 8px; }
  #view-tasas .market-head h2 { font-size: 15px; }
  #view-tasas .market-cols { display: none; }
  #view-tasas .markets { border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  #view-tasas .mrow { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; border: 0; border-radius: 12px; }
  #view-tasas .mrow .spark { display: none; }
  #view-tasas .mrow .badge.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
  #view-tasas .mrow .nm { font-size: 14px; }
  #view-tasas .mrow .px b { font-size: 15px; }
  #view-tasas .about { margin: 16px 6px 0; font-size: 12px; }

  /* ---- contenido */
  main { max-width: none; margin: 0 var(--chatw) 0 var(--pairs); padding: 24px clamp(20px, 2.4vw, 36px) 56px; }
  main > .view { max-width: 1180px; margin-inline: auto; }
  main > #view-stats { max-width: 1400px; }
  main > #view-par { container-type: inline-size; }
  .markets, .equiv, .panel { border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
  .sm-calc .equiv { border: 0; }
  .mrow:hover, .tvrow:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .mrow.sel, .tvrow.sel { background: color-mix(in srgb, var(--green) 18%, transparent); }

  /* tarjetas de las monedas principales: solo con espacio (PC muy ancha), encima del detalle */
  .kpis { max-width: 1180px; margin: 0 auto 18px; }

  /* ---- Convertir: calculadora a la izquierda, equivalencias a la derecha */
  #view-convertir { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  #view-convertir .view-title, #view-convertir .view-sub { grid-column: 1 / -1; }
  #view-convertir .conv { grid-column: 1; grid-row: 3 / span 2; gap: 14px; padding: 22px; }
  #view-convertir .list-title { grid-column: 2; margin-top: 0; }
  #view-convertir .equiv { grid-column: 2; }
  #view-convertir .field { font-size: 13px; }
  #view-convertir .field input, #view-convertir .field output { padding: 14px 16px; font-size: 28px; }
  #view-convertir .conv-in select { max-width: 240px; padding: 0 16px; }

  /* ---- Más: tarjetas */
  #view-mas .menu {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px;
    padding: 0; border: 0; background: none; box-shadow: none;
  }
  #view-mas .menu-item, #view-mas .menu-item:last-child {
    height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card);
    color: var(--text); text-decoration: none;
  }
  #view-mas .menu-item:hover { border-color: var(--green-2); }

  /* ---- detalle: una tarjeta con el precio, los dos lados y el gráfico */
  .d-main {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); align-items: end; gap: 4px 24px;
    padding: 18px 20px 14px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  }
  .detail-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
  .detail-name { flex: 1; font-size: 19px; }
  body[data-nav="tasas"] .back { display: none; }   /* el par se eligió en el menú lateral */
  .d-price { grid-column: 1; }
  .d-price strong { font-size: 46px; line-height: 1.1; }
  #view-par .d-sides { grid-column: 2; margin: 0 0 8px; }
  .d-sides div { background: var(--bg); box-shadow: none; }
  .chart-box { grid-column: 1 / -1; margin-top: 10px; padding: 0; border: 0; background: none; box-shadow: none; }
  #view-par .chart-box { border: 0; }
  .chart { height: 320px; }
  /* debajo: liquidez y libro de órdenes (lado a lado si hay espacio) */
  .d-more { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
  .d-more > .panel { margin: 0; }
  .d-note { margin: 14px 4px 0; }
  /* una columna: estadísticas, libro, liquidez y grupos */
  .d-more > .d-stats { order: 1; }
  .d-more > .book-box { order: 2; }
  .d-more > .liq { order: 3; }
  .d-more > .groups-box { order: 4; }
  .liq-chart { height: 130px; }
  #view-par > .panel { margin-top: 16px; }
}
/* ancho: estadísticas (con el rendimiento debajo) y el libro de órdenes al lado; debajo la liquidez y los grupos */
@container (min-width: 720px) {
  .d-more {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "stats book" "liq liq" "groups groups";
  }
  .d-more > .d-stats { grid-area: stats; align-self: stretch; }
  .d-more > .book-box { grid-area: book; align-self: stretch; }   /* misma altura que las estadísticas */
  /* si el libro es más alto, el convertidor baja al final de la tarjeta: las dos terminan igual */
  .d-more > .d-stats { display: flex; flex-direction: column; gap: 18px; }
  .d-more > .d-stats > .ds-col:last-child { flex: 1; display: flex; flex-direction: column; }
  .d-more > .d-stats .ds-conv { margin-top: auto; padding-top: 12px; }
  .d-more > .book-box .depth { min-height: 72px; }   /* el gráfico crece hasta el final de la tarjeta */
  .d-more > .liq { grid-area: liq; }
  .d-more > .groups-box { grid-area: groups; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  .live { display: none; }   /* no cabe junto a las secciones */
}

/* ---- el chat del par, fijo a la derecha (bot/chat.py): app.js lo pasa a #chat-dock */
@media (min-width: 1280px) {
  body[data-chat] #chat-dock {
    position: fixed; top: var(--navh); right: 0; bottom: 0; z-index: 4; width: var(--chatw);
    display: flex; flex-direction: column; padding: 16px 16px 12px;
    border-left: 1px solid var(--line); background: color-mix(in srgb, var(--card) 40%, var(--bg));
  }
  #chat-dock .chat { flex: 1; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  #chat-dock .chat-feed { flex: 1; height: auto; min-height: 0; }
  #chat-dock .chat-rules { margin-bottom: 0; }
}
@media (min-width: 1680px) {
  :root { --pairs: 320px; }
  body[data-chat] { --chatw: 390px; }
  body[data-nav="tasas"][data-main="par"] .kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
}

/* ================================================== Detalle del par: estadísticas, grupos y comunidad
   Como la ficha de una moneda en un exchange: rango del día, rendimiento, máximos, convertidor, los grupos
   donde se publicaron las órdenes (en vez de los exchanges) y el chat del par. */
.bottom-nav .nav-desk { display: none; }   /* Estadísticas: en el teléfono está en Más */
#view-par > .panel h3 small, .box-head h3 small { font-size: 12px; font-weight: 600; color: var(--muted); }
.d-stats { display: grid; gap: 18px; }
.ds-col { min-width: 0; }
.ds-col + .ds-col { padding-top: 14px; border-top: 1px solid var(--line); }   /* rendimiento, debajo */
.d-stats, .groups-box { margin-top: 14px; }
.ds-list dd .u { margin-left: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ds-col h3 { margin: 0 0 10px; }
.ds-range { margin-bottom: 10px; }
.ds-range-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ds-range-top b { margin-left: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-bar { position: relative; height: 6px; margin-top: 8px; border-radius: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sell) 70%, var(--line)), var(--line) 50%, color-mix(in srgb, var(--buy) 70%, var(--line))); }
.ds-bar i { position: absolute; top: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--text); border: 3px solid var(--card); transform: translateY(-50%); box-shadow: 0 0 0 1px var(--line); }
.ds-list { display: grid; margin: 0; }
.ds-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ds-list > div:last-child { border-bottom: 0; }
.ds-list dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ds-list dd { margin: 0; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.ds-list dd small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.ds-list dd small .up { color: var(--buy); }
.ds-list dd small .down { color: var(--sell); }
.ds-perf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.ds-perf-i { display: grid; gap: 4px; justify-items: center; padding: 8px 4px; border-radius: 12px; background: var(--bg); font-size: 11px; font-weight: 600; color: var(--muted); }
.ds-perf-i .chg { padding: 2px 5px; font-size: 11.5px; white-space: nowrap; letter-spacing: -.2px; }
.ds-perf-i .chg.flat { background: none; }
.ds-conv { margin-top: 12px; }
.ds-conv h4 { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.ds-conv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.ds-cin { display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ds-cin input { flex: 1; min-width: 0; width: 100%; padding: 10px 0 10px 12px; border: 0; background: none; color: var(--text); font: 700 16px Montserrat, system-ui, sans-serif; font-variant-numeric: tabular-nums; outline: none; }
.ds-cin span { padding: 0 12px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ds-cin:focus-within { border-color: var(--green-2); }
.ds-eq { font-weight: 700; color: var(--muted); }

/* grupos: tabla tipo "mercados" que se adapta al ancho de la tarjeta */
.groups-box, .st-groups { container-type: inline-size; }
.box-head h3 { margin: 0; }
.box-head p { margin: 4px 0 12px; font-size: 12.5px; color: var(--muted); }
.gtable { display: grid; font-variant-numeric: tabular-nums; }
.g-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 54px; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.g-row.g-h { padding-top: 0; border-top: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.g-row .r { text-align: right; }
.g-row small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.g-i, .g-b, .g-s, .g-share, .g-liq, .g-when, .g-assets { display: none; }
.g-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-name > span { min-width: 0; }
.g-name b, .g-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name b { font-size: 13.5px; }
.g-name a { color: var(--text); text-decoration: none; }
.g-name a:hover { color: var(--buy); text-decoration: underline; }
.g-av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; }
.g-px b, .g-n b { font-size: 14px; }
.g-cv i { font-style: normal; }
.g-row .buy, .g-cv .buy { color: var(--buy); }
.g-row .sell, .g-cv .sell { color: var(--sell); }
.g-share { align-items: center; gap: 8px; }
.g-share i { flex: 1; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.g-share i b { display: block; height: 100%; border-radius: 3px; background: var(--green-2); }
.g-share em { min-width: 34px; font-style: normal; font-weight: 700; text-align: right; }
.g-empty, .g-note { padding: 14px 4px 4px; font-size: 12.5px; color: var(--muted); }
.g-empty { text-align: center; }
.btn-more { width: 100%; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--muted); font-weight: 700; font-size: 13px; }
.btn-more:hover { color: var(--text); border-color: var(--green-2); }
.badge.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; letter-spacing: -.3px; }
/* mediana: precio (con compran · venden debajo), órdenes y % */
@container (min-width: 520px) {
  .g-row { grid-template-columns: 22px minmax(0, 1fr) 96px 58px minmax(100px, 150px); }
  .g-i { display: block; color: var(--muted); font-size: 12px; }
  .g-share { display: flex; }
  .g-n small { display: none; }
  .st-g { grid-template-columns: 22px minmax(0, 1fr) 70px minmax(100px, 150px) 110px; }
  .st-g .g-assets { display: flex; gap: 4px; }
}
/* ancha: todas las columnas, como la tabla de mercados de un exchange */
@container (min-width: 760px) {
  .g-row { grid-template-columns: 22px minmax(0, 1fr) 72px 72px 72px 58px minmax(100px, 140px) 96px 62px; }
  .g-b, .g-s, .g-liq, .g-when { display: block; }
  .g-cv { display: none !important; }
  .st-g { grid-template-columns: 22px minmax(0, 1fr) 76px minmax(110px, 160px) 110px 110px 62px; }
}

/* comunidad: chat del par */
.chat { position: relative; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chat-head h3 { margin: 0; }
.chat-online { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chat-online[hidden] { display: none; }
.chat-feed { display: flex; flex-direction: column; gap: 2px; height: min(62vh, 520px); margin: 0 -8px; padding: 4px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.chat-feed > :first-child { margin-top: auto; }   /* pocos comentarios: abajo, junto a la caja (como un chat) */
.chat-empty { margin: auto; padding: 24px 12px; text-align: center; font-size: 13px; color: var(--muted); }
.chat-empty b { color: var(--text); }
.cm-skel { flex: none; height: 64px; margin: 6px 0; border-radius: 14px; background: linear-gradient(90deg, var(--card), var(--line), var(--card)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.cm-skel.short { width: 70%; }
.chat-older { align-self: center; margin: 4px 0 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.cm { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px 8px; border-radius: 14px; transition: background .3s ease; }
.cm:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.cm.flash { background: color-mix(in srgb, var(--buy) 14%, transparent); }
.cm-av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; }
.cm-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cm-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.cm.mine .cm-meta b { color: var(--buy); }
.cm-meta time { flex: none; font-size: 11.5px; color: var(--muted); }
.cm-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 4px 0 0; padding: 5px 10px; border: 0; border-left: 3px solid var(--green-2); border-radius: 6px 10px 10px 6px; background: var(--bg); text-align: left; font-size: 12px; }
.cm-quote b { color: var(--buy); font-size: 11.5px; }
.cm-quote span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.cm-text { margin: 4px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.rx { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 13px; line-height: 1.2; }
.rx b { font-size: 11.5px; color: var(--muted); }
.rx.on { border-color: color-mix(in srgb, var(--buy) 60%, transparent); background: color-mix(in srgb, var(--buy) 14%, transparent); }
.rx.on b { color: var(--buy); }
.cm-act { padding: 3px 6px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.cm-act:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.cm-add { display: inline-flex; align-items: center; gap: 1px; }
.cm-pickwrap { position: relative; }
.rx-pick { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 3; display: flex; gap: 2px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); box-shadow: var(--shadow); animation: fade .15s ease-out; }
.rx-pick button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 19px; transition: transform .12s ease; }
.rx-pick button:hover { transform: scale(1.2); background: var(--bg); }
.cm-views { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.chat-new { position: absolute; left: 50%; bottom: 128px; z-index: 2; transform: translateX(-50%); padding: 7px 14px; border: 0; border-radius: 999px; background: var(--green); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); }
.chat-form { margin-top: 10px; }
.chat-replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; padding: 6px 10px; border-left: 3px solid var(--green-2); border-radius: 6px 10px 10px 6px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--muted); }
.chat-replying[hidden] { display: none; }
.chat-replying button { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.chat-compose:focus-within { border-color: var(--green-2); }
.chat-compose textarea { flex: 1; min-width: 0; max-height: 132px; padding: 7px 0; border: 0; background: none; color: var(--text); font: 500 14.5px/1.4 Montserrat, system-ui, sans-serif; resize: none; outline: none; }
.chat-send { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--green); color: #fff; }
.chat-send:disabled { opacity: .6; }
.chat-error { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--sell); background: color-mix(in srgb, var(--sell) 12%, transparent); }
.chat-login { margin-top: 10px; padding: 12px 16px; font-size: 14px; }
.chat-rules { margin: 10px 2px 0; font-size: 11.5px; color: var(--muted); }

/* ================================================== Estadísticas del mercado */
.st-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.st-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.st-tile > span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.st-tile b { font-size: 20px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-tile b small { font-size: 12px; color: var(--muted); }
.st-tile > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.st-tile .chg { padding: 1px 6px; font-size: 11.5px; }
a.st-tile:hover { outline: 1px solid var(--green-2); }
.st-grid { display: grid; gap: 14px; }
.st-card { min-width: 0; }
.st-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin-bottom: 8px; }
.st-head h3 { margin: 0; }
.st-head p { margin: 3px 0 0; max-width: 520px; font-size: 12px; color: var(--muted); }
.st-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-ranges { margin: 0; }
.st-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.st-big > b { font-size: 30px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.st-big > b small { font-size: 14px; color: var(--muted); }
.st-big > small { font-size: 12px; color: var(--muted); }
.st-chart { position: relative; height: 170px; touch-action: pan-y; }
.st-chart.tall { height: 210px; }
.st-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.st-chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.st-chart .axis text { fill: var(--muted); font-size: 10px; font-family: Montserrat, system-ui, sans-serif; }
.st-chart .cross line { stroke: var(--muted); stroke-width: 1; }
.st-chart .cross circle { stroke: var(--card); stroke-width: 2; }
.st-chart .empty { height: 100%; display: grid; place-items: center; font-size: 12.5px; background: none; box-shadow: none; }
.gauge { display: block; width: 100%; max-width: 260px; margin: 6px auto 0; }
.gauge .g-val { fill: var(--text); font: 800 30px Montserrat, system-ui, sans-serif; }
.g-label { margin: 0; text-align: center; font-size: 15px; font-weight: 800; }
.sh-list i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; }
/* presión del mercado: las tres señales y su historial de 30 días */
.pr-parts { display: grid; margin: 12px 0 0; padding: 0; list-style: none; }
.pr-parts li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.pr-parts li:last-child { border-bottom: 0; }
.pr-parts span { font-weight: 600; color: var(--muted); }
.pr-parts b { font-variant-numeric: tabular-nums; }
.pr-parts b.up { color: var(--buy); }
.pr-parts b.down { color: var(--sell); }
.pr-parts b.flat { color: var(--muted); }
.pr-parts small { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.pr-chart-head { margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.st-chart.pr-chart { height: 92px; }
.sh-bar { display: flex; height: 12px; margin: 10px 0 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.sh-bar i { display: block; min-width: 3px; }
.sh-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sh-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; font-size: 13px; }
.sh-list li[data-pair] { cursor: pointer; }
.sh-list li[data-pair]:hover { background: var(--bg); }
.sh-list span { display: flex; align-items: center; font-weight: 700; }
.sh-list b { font-variant-numeric: tabular-nums; }
.sh-list small { text-align: right; font-size: 11.5px; color: var(--muted); }
.mv-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mv-cols h4 { margin: 0 0 4px; font-size: 12px; }
.mv-cols h4.up { color: var(--buy); }
.mv-cols h4.down { color: var(--sell); }
.mv { display: grid; margin: 0; padding: 0; list-style: none; }
.mv button { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; padding: 7px 4px; border: 0; border-radius: 10px; background: none; text-align: left; }
.mv button:hover { background: var(--bg); }
.mv-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13.5px; }
.mv-p { font-weight: 700; font-variant-numeric: tabular-nums; }
.mv .chg { padding: 2px 7px; font-size: 12px; }
.mv-none { padding: 8px 4px; font-size: 12.5px; color: var(--muted); }
.vol { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.vol li { display: grid; grid-template-columns: 130px minmax(0, 1fr) 70px; align-items: center; gap: 10px; font-size: 13px; }
.vol li > span { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.vol .badge.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.vol i { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.vol i b { display: block; height: 100%; border-radius: 4px; }
.vol em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

@media (min-width: 640px) {
  .st-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mv-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .st-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
  .st-tile { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
  .st-tile b { font-size: 24px; }
  .st-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .st-index { grid-column: span 8; }
  .st-gauge { grid-column: span 4; }
  .st-activity { grid-column: span 8; }
  .st-share { grid-column: span 4; }
  .st-movers { grid-column: span 7; }
  .st-vol { grid-column: span 5; }
  .st-groups { grid-column: 1 / -1; }
  .st-chart { height: 220px; }
  .st-chart.tall { height: 250px; }
  .chat-feed { height: 460px; }
}

/* ================================================== gráfico: interruptor Fácil / Pro y modo Pro (tipo TradingView) */
.chart-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chart-bar .ranges { margin: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
/* Fácil: la bolita a la derecha y el texto a la izquierda; Pro: al revés */
.mode-switch {
  position: relative; flex: none; width: 82px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); transition: background .2s ease, border-color .2s ease;
}
.mode-switch .ms-knob {
  position: absolute; top: 3px; left: 55px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted); transition: transform .22s ease, background .22s ease;
}
.mode-switch .ms-text {
  position: absolute; top: 0; bottom: 0; left: 12px; display: flex; align-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .2px; color: var(--muted);
}
.mode-switch[aria-checked="true"] { border-color: var(--green-2); background: color-mix(in srgb, var(--green) 22%, var(--bg)); }
.mode-switch[aria-checked="true"] .ms-knob { transform: translateX(-52px); background: var(--buy); }
.mode-switch[aria-checked="true"] .ms-text { left: auto; right: 14px; color: var(--text); }

.pro-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pro-bar::-webkit-scrollbar, .chart-bar .ranges::-webkit-scrollbar { display: none; }
.pro-group { display: flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--bg); }
.pro-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pro-btn.icon { width: 30px; padding: 0; justify-content: center; }
.pro-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pro-btn .dot { width: 8px; height: 8px; border-radius: 50%; opacity: .45; }
.pro-btn:hover { color: var(--text); }
.pro-btn[aria-pressed="true"] { color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pro-btn[aria-pressed="true"] .dot { opacity: 1; }
.pro-btn[data-ptool][aria-pressed="true"]:not([data-ptool=""]) { color: #FBBF24; box-shadow: inset 0 0 0 1px #FBBF24; }

.pro-chart { position: relative; height: 380px; touch-action: none; }
.pro-chart.drawing { cursor: crosshair; }
.pro-legend {
  position: absolute; top: 4px; left: 6px; right: 70px; z-index: 3; display: flex; flex-wrap: wrap; gap: 2px 10px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums;
}
.pro-legend b { color: var(--text); }
.pro-legend > b:first-child { font-size: 12.5px; }
.pro-legend .pl-tf { padding: 0 5px; border-radius: 5px; background: var(--bg); color: var(--text); }
.pro-legend .up { color: var(--buy); }
.pro-legend .down { color: var(--sell); }
.pro-legend .pro-err { color: var(--muted); }
.pro-hint {
  position: absolute; left: 50%; bottom: 34px; z-index: 4; margin: 0; padding: 6px 12px; border-radius: 999px; transform: translateX(-50%);
  background: #FBBF24; color: #1F1300; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none;
}
.pro-note {
  position: absolute; z-index: 5; display: flex; gap: 4px; width: 230px; padding: 5px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); box-shadow: var(--shadow);
}
.pro-note input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 600 13px Montserrat, system-ui, sans-serif; outline: none; }
.pro-note input:focus { border-color: #FBBF24; }
.pro-note button { border: 0; border-radius: 8px; padding: 0 9px; background: #FBBF24; color: #1F1300; font-size: 12px; font-weight: 800; }
.pro-note button + button { background: var(--bg); color: var(--muted); font-size: 16px; }
.chart-box.is-pro .legend { display: none; }

/* pantalla completa (Fullscreen API o, en iPhone, la tarjeta fija encima de todo) */
#chart-box:fullscreen, #chart-box.pro-full {
  display: flex; flex-direction: column; margin: 0; padding: 12px 14px; border: 0; border-radius: 0; background: var(--bg);
}
#chart-box.pro-full { position: fixed; inset: 0; z-index: 60; padding-top: max(12px, env(safe-area-inset-top)); }
#chart-box:fullscreen .pro, #chart-box.pro-full .pro { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chart-box:fullscreen .pro-chart, #chart-box.pro-full .pro-chart { flex: 1; height: auto; min-height: 0; }

@media (max-width: 640px) {   /* teléfono: barra más compacta */
  .pro-btn { height: 26px; padding: 0 7px; gap: 4px; font-size: 11.5px; }
  .pro-btn.icon, .pro-btn[data-ptype] { width: 28px; padding: 0; justify-content: center; }
  .pro-btn[data-ptype] span { display: none; }
  .pro-chart { height: 340px; }
}
@media (min-width: 1024px) {
  .pro-chart { height: 460px; }
}
