/* ---------------- barra de arriba ordenada (web/barra.js) ---------------- */
@property --tbm-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#tbStash { display: none !important; }
#top .tb-ico span { display: none; }
#top .tb-ico { padding: 0; width: 30px; justify-content: center; }
/* el precio no se achica: el día nunca le pasa por arriba */
#top .brand, #top .price-box { flex: none; }
#top .price-box .px { white-space: nowrap; }

/* lupa arriba: la mira gira mientras está prendida */
#drawbar [data-tool="lupa"] { display: none !important; }
.tb-lupa .lp-rt { transform-box: view-box; transform-origin: 8.5px 8.5px; }
#top .tb-lupa.on { color: color-mix(in srgb, var(--h-purple, #a78bfa) 55%, var(--hi)); border-color: color-mix(in srgb, var(--h-purple, #a78bfa) 50%, transparent);
  background: color-mix(in srgb, var(--h-purple, #a78bfa) 15%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--h-purple, #a78bfa) 30%, transparent); }
.tb-lupa.on .lp-rt { animation: lp-spin 2.4s linear infinite; }
/* heatmap arriba: cálido cuando la capa está prendida */
#top .tb-heat.on { color: color-mix(in srgb, var(--warn, #f59e0b) 70%, var(--hi)); border-color: color-mix(in srgb, var(--warn, #f59e0b) 50%, transparent);
  background: color-mix(in srgb, var(--warn, #f59e0b) 15%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--warn, #f59e0b) 30%, transparent); }

/* ---------------- menús IA y cuenta: abren elásticos, con desenfoque, brillo que gira y opciones que entran en cascada ---------------- */
.tbm { position: relative; flex: none; display: inline-flex; }
.tbm-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 600 12.5px var(--sans); overflow: hidden; isolation: isolate;
  transition: scale .45s cubic-bezier(.34, 1.9, .5, 1), box-shadow .25s, border-color .25s, background .25s; }
.tbm-btn:hover { scale: 1.07; }
.tbm-btn:active { scale: .9; transition-duration: .06s; }
.tbm-btn .caret { transition: rotate .45s cubic-bezier(.34, 1.9, .5, 1); }
.tbm.open .tbm-btn .caret { rotate: 180deg; }

/* IA: el botón más importante. Borde de colores que gira, brillo que pasa y estrellitas que titilan */
.tbm-ia .tbm-btn { border-color: transparent; padding: 0 12px 0 10px;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    conic-gradient(from var(--tbm-a), #a78bfa, #f0abfc, #67e8f9, #818cf8, #a78bfa) border-box;
  box-shadow: 0 0 14px rgba(167, 139, 250, .28), 0 0 0 0 rgba(240, 171, 252, 0);
  animation: tbmSpin 4s linear infinite, tbmBreath 3.2s ease-in-out infinite; }
.tbm-ia .tbm-lbl { font-weight: 800; letter-spacing: .04em; background: linear-gradient(90deg, #c4b5fd, #f0abfc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tbm-ia .tbm-btn:hover, .tbm-ia.open .tbm-btn { box-shadow: 0 0 22px rgba(167, 139, 250, .55), 0 0 40px rgba(103, 232, 249, .2); }
.tbm-ia .tbm-btn > svg { filter: drop-shadow(0 0 4px rgba(240, 171, 252, .7)); transition: rotate .6s cubic-bezier(.34, 1.9, .5, 1), scale .6s cubic-bezier(.34, 1.9, .5, 1); }
.tbm-ia .tbm-btn:hover > svg { rotate: 72deg; scale: 1.18; }
.tbm-shine { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .16) 48%, transparent 60%); translate: -120% 0; animation: tbmShine 5s ease-in-out infinite 1.2s; }
.tb-tw { transform-box: fill-box; transform-origin: center; animation: tbmTw 2.4s ease-in-out infinite; }
.tb-tw2 { transform-box: fill-box; transform-origin: center; animation: tbmTw 2.4s ease-in-out infinite 1.2s; }
.tbm-ia.on .tbm-btn { background: linear-gradient(rgba(167, 139, 250, .2), rgba(167, 139, 250, .08)) padding-box, linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    conic-gradient(from var(--tbm-a), #a78bfa, #f0abfc, #67e8f9, #818cf8, #a78bfa) border-box; }
@keyframes tbmSpin { to { --tbm-a: 360deg; } }
@keyframes tbmBreath { 50% { box-shadow: 0 0 20px rgba(167, 139, 250, .45), 0 0 0 3px rgba(240, 171, 252, .06); } }
@keyframes tbmShine { 0%, 70% { translate: -120% 0; } 100% { translate: 120% 0; } }
@keyframes tbmTw { 0%, 100% { scale: 1; opacity: 1; } 50% { scale: .35; opacity: .4; } }

/* cuenta: la foto o la inicial con un anillo que gira; el puntito rojo late mientras sigue el vivo */
.tbm-acct .tbm-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; justify-content: center; overflow: visible; border-color: transparent;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, conic-gradient(from var(--tbm-a), var(--acc), transparent 40%, var(--acc2, var(--acc)) 60%, transparent 85%, var(--acc)) border-box;
  animation: tbmSpin 6s linear infinite; }
.tbm-acct .tbm-btn:hover, .tbm-acct.open .tbm-btn { box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .12), 0 0 18px rgba(var(--acc-rgb), .45); }
.tbm-av { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--acc); font: 700 12.5px var(--sans); }
.tbm-av img { width: 100%; height: 100%; object-fit: cover; }
.tbm-live { position: absolute; right: -2px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); border: 2px solid var(--bg); transition: background .3s; }
.tbm-acct.is-live .tbm-live { background: #f43f5e; animation: tbmLive 1.8s ease-out infinite; }
@keyframes tbmLive { 0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, .6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(244, 63, 94, 0); } }

/* el menú */
.tbm-pop { position: absolute; top: calc(100% + 10px); z-index: 90; width: 330px; display: none; border-radius: 16px; transform-origin: top center; }
.tbm-ia .tbm-pop { left: 50%; translate: -50% 0; }
.tbm-acct .tbm-pop { right: -6px; width: 300px; transform-origin: top right; }
.tbm.open .tbm-pop { display: block; animation: tbmIn .62s cubic-bezier(.34, 1.56, .64, 1) both; }
.tbm.closing .tbm-pop { animation: tbmOut .19s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes tbmIn { 0% { opacity: 0; transform: translateY(-12px) scale(.55, .4); filter: blur(12px); } 45% { opacity: 1; filter: blur(0); }
  70% { transform: translateY(2px) scale(1.03, 1.05); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes tbmOut { to { opacity: 0; transform: translateY(-8px) scale(.85); filter: blur(8px); } }
.tbm-in { position: relative; padding: 8px; border-radius: 16px; background: rgba(var(--float-rgb), .9); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 22px 50px rgba(var(--shadow-rgb), .55), inset 0 1px 0 rgba(var(--hi-rgb), .06); }
/* borde de luz que gira en loop y un halo que respira atrás */
.tbm-ring { position: absolute; inset: -1px; border-radius: 17px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--tbm-a), transparent 0 20%, var(--tbm-c1) 32%, transparent 45% 70%, var(--tbm-c2) 82%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: tbmSpin 3.6s linear infinite; }
.tbm-aura { position: absolute; inset: 8px; z-index: -1; border-radius: 20px; pointer-events: none; filter: blur(26px); opacity: .45;
  background: radial-gradient(60% 60% at 30% 20%, var(--tbm-c1), transparent), radial-gradient(60% 60% at 80% 90%, var(--tbm-c2), transparent); animation: tbmAura 4s ease-in-out infinite; }
@keyframes tbmAura { 50% { opacity: .7; transform: scale(1.06); } }
.tbm-ia { --tbm-c1: #a78bfa; --tbm-c2: #67e8f9; }
.tbm-acct { --tbm-c1: var(--acc); --tbm-c2: var(--acc2, #818cf8); }

.tbm-h { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tbm-h b { display: block; font: 700 13px var(--sans); color: var(--hi); }
.tbm-h em { display: block; font: 400 11px var(--sans); font-style: normal; color: var(--muted); margin-top: 1px; }
.tbm-hic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(167, 139, 250, .25), rgba(103, 232, 249, .15));
  box-shadow: 0 0 16px rgba(167, 139, 250, .35); animation: tbmFloat 3s ease-in-out infinite; }
.tbm-hic svg { width: 18px; height: 18px; }
@keyframes tbmFloat { 50% { translate: 0 -2px; rotate: 8deg; } }
.tbm-who { flex-direction: column; align-items: stretch; gap: 8px; }
.tbm-who .of-mh { display: flex; align-items: center; gap: 10px; }
.tbm-who .of-mh img, .tbm-who .of-ini { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.tbm-who .of-mh em { word-break: break-all; }
.tbm-who .of-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.tbm-it { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 9px; border: 0; border-radius: 11px; background: transparent;
  color: var(--text); text-align: left; cursor: pointer; isolation: isolate;
  transition: background .2s, translate .45s cubic-bezier(.34, 1.9, .5, 1), scale .45s cubic-bezier(.34, 1.9, .5, 1); }
.tbm.open .tbm-it { animation: tbmItem .6s cubic-bezier(.34, 1.7, .5, 1) both; animation-delay: calc(var(--i) * 45ms + 90ms); }
@keyframes tbmItem { 0% { opacity: 0; translate: -14px 0; scale: .8; filter: blur(5px); } 100% { opacity: 1; translate: 0 0; scale: 1; filter: none; } }
.tbm-it::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .25s;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.tbm-it:hover::before, .tbm-it:focus-visible::before { opacity: 1; }
.tbm-it:hover { translate: 4px 0; }
.tbm-it:active { scale: .96; transition-duration: .06s; }
.tbm-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent);
  transition: scale .5s cubic-bezier(.34, 2, .5, 1), rotate .5s cubic-bezier(.34, 2, .5, 1), box-shadow .3s; }
.tbm-ic svg { width: 17px; height: 17px; }
.tbm-it:hover .tbm-ic { scale: 1.16; rotate: -8deg; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }
.tbm-it:hover .tbm-ic svg { animation: tbmWig .9s cubic-bezier(.34, 1.56, .64, 1) infinite; }
@keyframes tbmWig { 0%, 100% { scale: 1; } 40% { scale: 1.15; } 70% { scale: .95; } }
.tbm-t { flex: 1; min-width: 0; }
.tbm-t b { display: block; font: 600 12.5px var(--sans); color: var(--hi); }
.tbm-t em { display: block; font: 400 11px/1.35 var(--sans); font-style: normal; color: var(--muted); margin-top: 2px; white-space: normal; }
.tbm-it kbd { flex: none; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 6px; font: 600 10.5px var(--mono);
  color: var(--faint); border: 1px solid var(--line-2); background: var(--surface-2); }
.tbm-st { position: absolute; right: 9px; top: 7px; font: 600 9.5px var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .04em; color: var(--c); }
.tbm-st:empty { display: none; }
.tbm-it:has(.tbm-st:not(:empty)) kbd { display: none; }
/* prendido (su panel está abierto): puntito que late */
.tbm-it.on .tbm-ic { background: color-mix(in srgb, var(--c) 26%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 0 14px color-mix(in srgb, var(--c) 40%, transparent); }
.tbm-it.on::after { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 16px; margin-top: -8px; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.tbm-out { width: 100%; margin-top: 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 12px var(--sans); cursor: pointer; }
.tbm-out:hover { color: var(--hi); border-color: color-mix(in srgb, #f43f5e 45%, transparent); background: color-mix(in srgb, #f43f5e 10%, transparent); }

/* ---------------- Big Trades (order flow): botón con burbujas y un panel que explica cada cosa ---------------- */
#top #dtCtl { position: relative; }
#top #dtBtn { cursor: pointer; height: 30px; padding: 0 10px 0 8px; gap: 7px; border-color: var(--line-2); background: var(--surface-2); border-radius: 9px;
  transition: scale .45s cubic-bezier(.34, 1.9, .5, 1), box-shadow .25s, border-color .25s; }
#top #dtBtn:hover { scale: 1.05; border-color: color-mix(in srgb, var(--buy) 40%, var(--line-2)); }
#top #dtBtn .dt-name { font: 600 12px var(--sans); color: var(--text); }
#top #dtBtn .dt-sum { display: inline; font: 600 11.5px var(--mono); color: var(--buy); }
#top #dtBtn .caret { display: inline; transition: rotate .45s cubic-bezier(.34, 1.9, .5, 1); }
#top #dtCtl.open #dtBtn .caret { rotate: 180deg; }
#top #dtBtn.off .dt-sum { color: var(--faint); }
#top #dtBtn.off .dt-ico { opacity: .45; filter: grayscale(1); }
.dt-ico circle { transform-box: fill-box; transform-origin: center; }
.fx-on #dtBtn:not(.off) .dt-ico .b1 { animation: dtPop 3.6s cubic-bezier(.34, 1.56, .64, 1) infinite; }
.fx-on #dtBtn:not(.off) .dt-ico .b2 { animation: dtPop 3.6s cubic-bezier(.34, 1.56, .64, 1) infinite .25s; }
.fx-on #dtBtn:not(.off) .dt-ico .b3 { animation: dtPop 3.6s cubic-bezier(.34, 1.56, .64, 1) infinite .5s; }
@keyframes dtPop { 0%, 78%, 100% { scale: 1; } 84% { scale: 1.35; } 90% { scale: .9; } }
#top #dtMore { display: none !important; }
#top #dtPop { display: none; position: absolute; top: calc(100% + 10px); left: 50%; translate: -50% 0; z-index: 90; width: 380px; flex-direction: column; align-items: stretch; gap: 0;
  padding: 6px; border-radius: 16px; background: rgba(var(--float-rgb), .94); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 50px rgba(var(--shadow-rgb), .55); white-space: normal; transform-origin: top center; }
#top #dtCtl.open #dtPop { display: flex; animation: tbmIn .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.dtp-h { display: flex; gap: 10px; align-items: flex-start; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); }
.dtp-h .dt-ico { flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: color-mix(in srgb, var(--buy) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--buy) 25%, transparent); }
.dtp-h b { display: block; font: 700 13px var(--sans); color: var(--hi); }
.dtp-h em, .dtp-x { display: block; font: 400 11px/1.4 var(--sans); font-style: normal; color: var(--muted); margin-top: 2px; }
.dtp-sec { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.dtp-sec:last-of-type { border-bottom: 0; }
.dtp-t { display: flex; align-items: baseline; gap: 6px; font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 7px; }
.dtp-t em { font: 400 10.5px var(--sans); font-style: normal; text-transform: none; letter-spacing: 0; color: var(--faint); opacity: .8; }
#dtPop .dt-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#dtPop .chips { flex-wrap: wrap; }
#dtPop .dtp-x { margin-top: 7px; }
.dt-kinds { display: grid; gap: 3px; }
.dt-kinds button, #dtPop .dt-res { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; height: auto; font: inherit;
  transition: background .2s, border-color .2s, translate .4s cubic-bezier(.34, 1.9, .5, 1); }
.dt-kinds button:hover, #dtPop .dt-res:hover { background: rgba(var(--hi-rgb), .04); border-color: var(--line-2); translate: 3px 0; }
.dt-kinds .g { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; font-size: 15px; color: var(--muted); background: var(--surface-3); transition: scale .45s cubic-bezier(.34, 2, .5, 1); }
.dt-kinds button:hover .g { scale: 1.15; }
.dt-kinds span, #dtPop .dt-res span { flex: 1; min-width: 0; }
.dt-kinds span b, #dtPop .dt-res span b { display: block; font: 600 12px var(--sans); color: var(--hi); }
.dt-kinds span em, #dtPop .dt-res span em { display: block; font: 400 11px/1.35 var(--sans); font-style: normal; color: var(--muted); margin-top: 1px; }
.dt-kinds button:not(.on) span, #dtPop .dt-res:not(.on) span { opacity: .55; }
.dt-kinds button.on .g { color: var(--hi); background: linear-gradient(135deg, color-mix(in srgb, var(--buy) 35%, transparent), color-mix(in srgb, var(--sell) 35%, transparent)); }
/* interruptor */
#dtPop .sw { flex: none; position: relative; width: 28px; height: 16px; border-radius: 99px; background: var(--surface-4, var(--line-2)); transition: background .25s; }
#dtPop .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: translate .4s cubic-bezier(.34, 1.9, .5, 1), background .25s; }
#dtPop .on > .sw { background: rgba(var(--acc-rgb), .45); }
#dtPop .on > .sw::after { translate: 12px 0; background: var(--hi); }
#dtPop .dt-res .ring { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); position: relative; border: 0; }
#dtPop .dt-res .ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2.5px solid var(--gold); }
#dtPop .dt-res.on { color: inherit; border-color: transparent; background: transparent; box-shadow: none; }
.dtp-key { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 9px 8px 6px; font-size: 11px; color: var(--muted); }
.dtp-key span { display: inline-flex; align-items: center; gap: 6px; }
.dtp-key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dtp-key i.o { background: none; border: 2px solid; }
.dtp-key i.d { background: none; border: 2px dotted var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .tbm-ia .tbm-btn, .tbm-acct .tbm-btn, .tbm-ring, .tbm-aura, .tbm-shine, .tb-tw, .tb-tw2, .tbm-hic, .tbm.open .tbm-pop, .tbm.open .tbm-it, .tbm-acct.is-live .tbm-live, #top #dtCtl.open #dtPop { animation: none !important; }
}
/* le gana a «.fx-on #top button» (style.css), que pisaba las transiciones elásticas */
#top .tbm-btn, .fx-on #top .tbm-btn, #top #dtBtn, .fx-on #top #dtBtn {
  transition: scale .45s cubic-bezier(.34, 1.9, .5, 1), transform .26s cubic-bezier(.3, 1.8, .5, 1), box-shadow .25s, border-color .25s, background .25s; }
#top .tbm-it, .fx-on #top .tbm-it, #top .dt-kinds button, .fx-on #top .dt-kinds button, #top #dtPop .dt-res, .fx-on #top #dtPop .dt-res {
  transition: background .2s, border-color .2s, translate .45s cubic-bezier(.34, 1.9, .5, 1), scale .45s cubic-bezier(.34, 1.9, .5, 1), transform .26s cubic-bezier(.3, 1.8, .5, 1); }
#top #dtPop .dt-res span { display: block; }
/* niveles extra de compactado (app.js fitTopbar): 8 Big Trades e IA sin texto · 9 velas poco usadas afuera */
.tb8 #top #dtBtn .dt-sum, .tb8 #top #dtBtn .caret, .tb8 .tbm-ia .caret { display: none; }
.tb8 #top #dtBtn { padding: 0 7px; }
.tb8 .tbm-ia .tbm-btn { padding: 0 9px 0 8px; gap: 4px; }
.tb9 #top > .vsep { display: none; }

/* ---------------- botones más grandes, iguales y en grupos (24/11, 2ª vuelta) ---------------- */
#spansCtl { display: none !important; }   /* «Ventana» afuera: queda sólo la de velas */
#top { height: 54px; gap: 6px; }
#body { height: calc(100% - 54px); }
#top > *, #top .icon-btn, #top .tbm, #top .tbm-btn { flex-shrink: 0; }   /* antes se aplastaban a 17 px de ancho */
#top > .spacer { flex: 1 1 0; min-width: 4px; }
#top :is(.icon-btn.sq, #alBtn, #rpBtn) { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 12px !important; position: relative; }
#top :is(.icon-btn.sq, #alBtn, #rpBtn) > svg { width: 19px; height: 19px; }
#top #rpBtn span { display: none; }
#top #alBtn .al-n { position: absolute; top: -4px; right: -4px; }
#top #dtBtn, #top .tbm-ia .tbm-btn { height: 38px; border-radius: 12px; }
#top .tbm-acct .tbm-btn { width: 38px; height: 38px; }
#top .tbm-av { width: 32px; height: 32px; }
#top .tb-sep { width: 1px; height: 22px; margin: 0 3px; background: linear-gradient(transparent, var(--line-2), transparent); flex: none; }

/* hover vivo: el ícono late como gelatina mientras el mouse está encima y el botón se ilumina */
#top :is(.icon-btn, .tbm-btn, #dtBtn) { transition: scale .45s cubic-bezier(.34, 1.9, .5, 1), box-shadow .25s, border-color .25s, background .25s, color .2s, transform .26s cubic-bezier(.3, 1.8, .5, 1); }
#top :is(.icon-btn, #dtBtn):hover { scale: 1.08; color: var(--hi); border-color: rgba(var(--acc-rgb), .45);
  box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .08), 0 6px 18px rgba(var(--shadow-rgb), .35), 0 0 16px rgba(var(--acc-rgb), .25); }
#top :is(.icon-btn, .tbm-btn, #dtBtn):hover > svg { animation: tbJelly 1.1s cubic-bezier(.34, 1.56, .64, 1) infinite; }
@keyframes tbJelly { 0%, 100% { scale: 1 1; rotate: 0deg; } 18% { scale: 1.22 .82; } 34% { scale: .86 1.16; rotate: -6deg; } 50% { scale: 1.08 .94; rotate: 4deg; } 66% { scale: .97 1.03; rotate: 0deg; } }

/* cartelito con el nombre y qué hace (web/barra.js) */
#tbTip { position: fixed; z-index: 200; pointer-events: none; max-width: 260px; padding: 8px 11px 9px; border-radius: 11px; display: none;
  background: rgba(var(--float-rgb), .96); border: 1px solid rgba(var(--acc-rgb), .35); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(var(--shadow-rgb), .55), 0 0 18px rgba(var(--acc-rgb), .18); transform-origin: var(--ox, 50%) 0; white-space: normal; }
#tbTip.on { display: block; animation: tbTipIn .45s cubic-bezier(.34, 1.7, .5, 1) both; }
#tbTip::before { content: ""; position: absolute; top: -5px; left: var(--ax, 50%); width: 9px; height: 9px; margin-left: -5px; rotate: 45deg;
  background: inherit; border-left: 1px solid rgba(var(--acc-rgb), .35); border-top: 1px solid rgba(var(--acc-rgb), .35); }
#tbTip b { display: block; font: 700 12.5px var(--sans); color: var(--hi); }
#tbTip em { display: block; font: 400 11px/1.4 var(--sans); font-style: normal; color: var(--muted); margin-top: 2px; }
#tbTip em:empty { display: none; }
#tbTip kbd { float: right; margin: 0 0 0 10px; padding: 0 5px; border-radius: 5px; font: 600 10px/17px var(--mono); color: var(--faint); border: 1px solid var(--line-2); }
@keyframes tbTipIn { 0% { opacity: 0; transform: translateY(-6px) scale(.6); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }

/* colapsar: una tecla de verdad (relieve, luz arriba, sombra abajo; se hunde al apretar) con doble flecha */
#top .tb-min { border: 0 !important; color: var(--hi); border-radius: 12px !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-4, var(--surface-3)) 100%, #fff 6%), var(--surface-2)) !important;
  box-shadow: inset 0 1px 0 rgba(var(--hi-rgb), .16), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 3px 0 rgba(0, 0, 0, .5), 0 5px 12px rgba(var(--shadow-rgb), .45) !important;
  translate: 0 -1.5px; transition: translate .12s, box-shadow .12s, scale .45s cubic-bezier(.34, 1.9, .5, 1) !important; }
#top .tb-min:hover { scale: 1.06; box-shadow: inset 0 1px 0 rgba(var(--hi-rgb), .2), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 3px 0 rgba(0, 0, 0, .5), 0 5px 14px rgba(var(--shadow-rgb), .45), 0 0 16px rgba(var(--acc-rgb), .3) !important; }
#top .tb-min:hover > svg { animation: tbLift 1s cubic-bezier(.34, 1.56, .64, 1) infinite; }
#top .tb-min:active { translate: 0 1.5px; transform: none !important; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45), 0 0 0 rgba(0, 0, 0, 0) !important; }
@keyframes tbLift { 0%, 100% { translate: 0 1px; } 45% { translate: 0 -3px; } 65% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { #top :is(.icon-btn, .tbm-btn, #dtBtn):hover > svg, #top .tb-min:hover > svg { animation: none; } #tbTip.on { animation: none; } }
/* 10: botones a 32 px y sin separadores · 11: el día sólo con la fecha corta y sin «micro» */
.tb10 #top { gap: 4px; padding: 0 8px; }
.tb10 #top :is(.icon-btn.sq, #alBtn, #rpBtn) { width: 32px; height: 32px; border-radius: 10px !important; }
.tb10 #top :is(.icon-btn.sq, #alBtn, #rpBtn) > svg { width: 17px; height: 17px; }
.tb10 #top #dtBtn, .tb10 #top .tbm-ia .tbm-btn { height: 32px; }
.tb10 #top .tbm-acct .tbm-btn { width: 32px; height: 32px; }
.tb10 #top .tbm-av { width: 27px; height: 27px; }
.tb10 #top .tb-sep { display: none; }
.tb11 #top .brand .sym { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- paneles de los costados: entran y salen elásticos, como Indicadores ----------------
   El ancho va de 0 al suyo con un resorte que se pasa y vuelve; el contenido tiene ancho fijo (no se reacomoda) y entra
   deslizando desde su borde. Al cerrar, display espera a que termine (allow-discrete). */
@media (min-width: 1001px) {
  #layers { --pw: 296px; --dx: -28px; } #side { --pw: 318px; } #iaPanel { --pw: 400px; } #simPanel { --pw: 350px; } #mt5 { --pw: 360px; } #alertas { --pw: 384px; }
  :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas) { width: var(--pw); overflow: hidden;
    transition: width .5s cubic-bezier(.34, 1.56, .64, 1), display .5s allow-discrete, border-color .3s; }
  :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas).hide { width: 0; border-color: transparent; transition-timing-function: cubic-bezier(.5, -0.35, .7, .6); transition-duration: .32s; }
  @starting-style { :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas) { width: 0; } }
  :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas) > * { width: var(--pw); min-width: var(--pw); box-sizing: border-box;
    transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; }
  :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas).hide > * { transform: translateX(var(--dx, 28px)); opacity: 0; }
  @starting-style { :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas) > * { transform: translateX(var(--dx, 28px)); opacity: 0; } }
  /* los de la derecha crecen desde la derecha: el contenido queda pegado a ese borde mientras se abre */
  :is(#side, #iaPanel, #simPanel, #mt5, #alertas) { align-items: flex-end; }
}
@media (prefers-reduced-motion: reduce) { :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas), :is(#layers, #side, #iaPanel, #simPanel, #mt5, #alertas) > * { transition: none !important; } }

/* «⋯»: los botones que no entran en pantallas angostas (web/barra.js), en una grilla con su nombre abajo */
.tbm-more { display: none; }
.tbm-more.has { display: inline-flex; }
#top .tbm-more .tbm-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 12px; }
.tbm-more { --tbm-c1: var(--acc); --tbm-c2: var(--acc2, #818cf8); }
.tbm-more .tbm-pop { right: -48px; width: 264px; transform-origin: top right; }
.tbm-more .tbm-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#top .tbm-more .tbm-list > button { width: 100% !important; height: 62px !important; flex-direction: column; gap: 5px; border-radius: 12px !important; }
.tbm-more .tbm-list > button::after { content: attr(data-nm); font: 500 10px/1.1 var(--sans); color: var(--muted); text-align: center; max-width: 72px; white-space: normal; }
.tbm-more .tbm-list > button > span { display: none !important; }
.tbm.open.tbm-more .tbm-list > button { animation: tbmItem .55s cubic-bezier(.34, 1.7, .5, 1) both; }
.tbm.open.tbm-more .tbm-list > button:nth-child(2) { animation-delay: .04s; } .tbm.open.tbm-more .tbm-list > button:nth-child(3) { animation-delay: .08s; }
.tbm.open.tbm-more .tbm-list > button:nth-child(4) { animation-delay: .12s; } .tbm.open.tbm-more .tbm-list > button:nth-child(5) { animation-delay: .16s; }
.tbm.open.tbm-more .tbm-list > button:nth-child(n+6) { animation-delay: .2s; }
/* 12: par sin nombre y velas mínimas · 13: el día sólo con el calendario, IA sólo con la estrella */
.tb12 #top .brand .sym { display: none; }
.tb13 #dayTxt, .tb13 #tbIa .tbm-lbl, .tb13 #tbIa .caret { display: none; }
.tb13 #dayLbl svg { display: inline; }
.tb13 #top .price-box .px { font-size: 15px; }

/* velas en pantallas angostas (desde tb12): un botón con la vela elegida que abre todas (no se pierde ninguna) */
#tfNow { display: none; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--hi); font: 600 12.5px var(--sans); cursor: pointer; transition: scale .45s cubic-bezier(.34, 1.9, .5, 1); }
#tfNow:hover { scale: 1.06; }
#tfNow .caret { transition: rotate .4s cubic-bezier(.34, 1.9, .5, 1); }
#tfCtl.tfo #tfNow .caret { rotate: 180deg; }
.tb12 #tfNow { display: inline-flex; }
.tb12 #tfs { display: none; }
.tb12 #tfCtl.tfo #tfs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; position: absolute; top: calc(100% + 8px); left: 0; z-index: 90; width: 210px; padding: 6px;
  border-radius: 14px; background: rgba(var(--float-rgb), .96); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(var(--shadow-rgb), .55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transform-origin: top left; animation: tbmIn .55s cubic-bezier(.34, 1.56, .64, 1) both; }
.tb12 #tfCtl.tfo #tfs button { padding: 7px 4px; border-radius: 8px; text-align: center; }
.tb12 #tfCtl.tfo #tfs .micro-btn { grid-column: 1 / -1; justify-content: center; }
/* la leyenda del gráfico no se aplasta en pantallas angostas */
#legend { max-width: min(calc(100% - 70px), max(300px, calc(100% - 432px))); }

/* barra de dibujo: puente invisible sobre el hueco entre el botón y su menú, cartelito al costado y hover vivo */
#drawbar .htg-fly::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; }
#drawbar.flip .htg-fly::before { left: auto; right: -14px; }
#tbTip.side::before { top: var(--ay, 50%); left: -5px; margin: -5px 0 0; rotate: -45deg; }
#tbTip.side.to-l::before { left: auto; right: -5px; rotate: 135deg; }
#tbTip.side { transform-origin: var(--ox, 0%) var(--ay, 50%); }
#tbTip.side.on { animation: tbTipSide .45s cubic-bezier(.34, 1.7, .5, 1) both; }
@keyframes tbTipSide { 0% { opacity: 0; transform: translateX(var(--tx, -8px)) scale(.6); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
#tbTip.side.to-l { --tx: 8px; }
#drawbar:not(.mini) > button:hover > svg, #drawbar .htg:not(.open) > .htg-b:hover > svg { animation: tbJelly 1.1s cubic-bezier(.34, 1.56, .64, 1) infinite; }
#drawbar:not(.mini) > button:not(.pm-x):hover, #drawbar .htg-b:hover { box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .08), 0 0 14px rgba(var(--acc-rgb), .25); }
@media (prefers-reduced-motion: reduce) { #drawbar button:hover > svg { animation: none !important; } }

/* ---------------- celular (web/barra.js, .tb-mob ≤ 760 px): a la derecha sólo lupa · ⋯ · cuenta · colapsar ---------------- */
.tb-mob #top { gap: 4px; padding: 0 6px; }
.tb-mob #top > .btn-group { display: none; }
.tb-mob #top > .spacer { min-width: 0; }
.tb-mob #top .tbm-more .tbm-btn { width: 32px; height: 32px; border-radius: 10px; }
.tb-mob #tfNow { padding: 0 8px; }
/* 14: celulares angostos (375 px): el día sin el puntito, el precio y las velas más chicos, botones de 30 px */
.tb14 #dayLbl .live-dot { display: none; }
.tb14 #top .price-box .px { font-size: 14px; }
.tb14 #tfNow { padding: 0 6px; }
.tb14 #top :is(.icon-btn.sq, .tbm-more .tbm-btn, .tbm-acct .tbm-btn) { width: 30px !important; height: 30px !important; }
.tb14 #top .tbm-av { width: 25px; height: 25px; }
.tb14 #top #dtBtn { padding: 0 6px; }
.tb-mob #top :is(#tbIa, #tbGr) { display: none !important; }
.tb-mob #top .tb-sep { display: none; }
.tbm-sub:empty { display: none; }
.tbm-sub { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.tbm-subh { display: flex; align-items: center; gap: 8px; padding: 8px 6px 4px; }
.tbm-subh .tbm-hic { width: 24px; height: 24px; border-radius: 8px; }
.tbm-subh .tbm-hic svg { width: 15px; height: 15px; }
.tbm-subh b { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tbm-sub .tbm-it { padding: 7px 8px; }
.tbm-sub .tbm-it em, .tbm-sub .tbm-it kbd { display: none; }
.tb-mob .tbm-more .tbm-pop { width: min(300px, calc(100vw - 16px)); }
.tb-mob .tbm-more .tbm-in { max-height: calc(100dvh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
/* lupa en el celular: el panel usa todo el ancho, la barra de dibujo se corre mientras está abierta */
#drawbar { transition: opacity .2s; }
.lupa-narrow #drawbar { opacity: 0; pointer-events: none; }

/* micro velas en el selector angosto (.tb12): «micro ▾» cambia la grilla por los segundos (antes salían debajo, tapados) */
.tb12 #tfCtl.tfo.open #tfs { display: none; }
.tb12 #tfCtl.tfo.open .micro-pop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; z-index: 91; width: 210px; padding: 6px; border-radius: 14px; }
.tb12 #tfCtl.tfo.open .micro-pop button { padding: 9px 4px; border-radius: 8px; text-align: center; font-size: 13px; }
