:root {
  --bg: #0d1117; --panel: #141b24; --panel2: #1a2330; --line: #263140;
  --text: #dbe3ec; --muted: #8697a9; --accent: #4c9aff;
  --up: #26a269; --down: #e5484d; --warn: #e5a50a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.up { color: var(--up); } .down { color: var(--down); }

#demo-banner { background: #7a2e0e; color: #fff; text-align: center; padding: 6px 10px; font-weight: 600; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 700; color: var(--text); }
.brand span { color: var(--accent); }
#search-form { display: flex; gap: 6px; }
#search { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 7px 10px;
  border-radius: 6px; width: 240px; text-transform: uppercase; }
#search::placeholder { text-transform: none; }
button, .btn { background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; }
button:hover { border-color: var(--accent); }
.link-btn { background: none; border: none; color: var(--accent); padding: 0; margin-left: auto; }
.status { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--muted); }
.status .dot.ok { background: var(--up); } .status .dot.busy { background: var(--warn); } .status .dot.err { background: var(--down); }

.indices { display: flex; gap: 10px; padding: 10px 16px; overflow-x: auto; }
.idx { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 130px; cursor: pointer; }
.idx:hover { border-color: var(--accent); }
.idx .n { font-size: 12px; color: var(--muted); }
.idx .p { font-size: 17px; font-weight: 600; }

.heatmap-wrap { padding: 0 16px 8px; }
.on-ticker .heatmap-wrap { display: none; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0; }
.section-head h2 { font-size: 15px; margin: 0; }
#heatmap { position: relative; height: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hm-sector { position: absolute; border: 1px solid var(--bg); overflow: hidden; }
.hm-sector-label { position: absolute; top: 0; left: 0; right: 0; height: 15px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: #cfd8e3; background: rgba(0,0,0,.45); padding: 1px 5px; z-index: 2; white-space: nowrap; overflow: hidden; }
.hm-tile { position: absolute; border: 1px solid var(--bg); display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #fff; cursor: pointer; overflow: hidden; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.hm-tile:hover { outline: 2px solid #fff; z-index: 3; }
.hm-tile b { font-weight: 700; } .hm-tile span { font-size: .85em; opacity: .95; }

.tabs { display: flex; gap: 4px; padding: 6px 16px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 8px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; color: var(--muted);
  white-space: nowrap; cursor: pointer; background: none; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; }
.tab .soon { font-size: 10px; color: var(--warn); margin-left: 4px; }

main { padding: 16px; min-height: 360px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 6px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { background: var(--panel2); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; position: sticky; top: 0; }
th:hover { color: var(--text); }
td.l, th.l { text-align: left; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel2); }
.sym { font-weight: 700; }
.tag { padding: 2px 7px; border-radius: 10px; font-size: 11px; background: var(--panel2); border: 1px solid var(--line); }
.tag.good { color: var(--up); border-color: var(--up); } .tag.bad { color: var(--down); border-color: var(--down); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.star { color: var(--muted); cursor: pointer; font-size: 16px; background: none; border: none; padding: 0 4px; }
.star.on { color: var(--warn); }
.table-wrap { overflow-x: auto; }

.placeholder { background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 28px; max-width: 760px; }
.placeholder h3 { margin: 0 0 8px; } .placeholder ul { color: var(--muted); }

/* pagina de ticker */
.t-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.t-head h1 { margin: 0; font-size: 26px; }
.t-price { font-size: 24px; font-weight: 700; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
@media (max-width: 1000px) { .t-grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.range-btns { display: flex; gap: 6px; margin-bottom: 8px; }
.range-btns button.on { border-color: var(--accent); color: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 3px; margin-right: 5px; vertical-align: middle; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.ins { margin: 0; padding: 0; list-style: none; }
.ins li { padding: 7px 9px; margin-bottom: 6px; border-left: 3px solid var(--line); background: var(--panel2); border-radius: 0 6px 6px 0; font-size: 13px; }
.ins li.good { border-color: var(--up); } .ins li.bad { border-color: var(--down); } .ins li.warn { border-color: var(--warn); }
.rangebar { position: relative; height: 8px; background: var(--panel2); border-radius: 4px; margin: 8px 0 2px; }
.rangebar i { position: absolute; top: -3px; width: 4px; height: 14px; background: var(--accent); border-radius: 2px; }
.small { font-size: 11px; }
.disclaimer { padding: 14px 16px 30px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); margin-top: 10px; }

/* ---------- Fase 2: scanner, briefing, noticias ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border-radius: 14px; padding: 4px 11px; font-size: 13px; }
.chip.on { background: #12304f; border-color: var(--accent); color: #fff; }
.why-row td { background: var(--panel2); cursor: default; }
.why-row:hover { background: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
.grid2 > .card, .card h4 { margin-bottom: 0; }
.card h4 { margin: 4px 0 8px; }
.regime { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.tag.big { font-size: 15px; padding: 4px 12px; border-radius: 14px; }
.checks, .plain { list-style: none; margin: 8px 0; padding: 0; }
.checks li { padding: 4px 0; font-size: 13px; }
.checks li.ok b { color: var(--up); } .checks li.no b { color: var(--down); }
.plain li { font-size: 12px; padding: 2px 0; }
table.mini { border: none; background: none; }
table.mini th, table.mini td { padding: 5px 8px; font-size: 13px; border-bottom: 1px solid var(--line); }
table.mini th { position: static; cursor: default; }
.bar { height: 8px; width: 110px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; } .bar i.pos { background: var(--up); } .bar i.neg { background: var(--down); }
.mv { display: flex; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: baseline; }
.mv:hover { background: var(--panel2); } .mv .muted { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.idea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.idea-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.idea .ins li { background: var(--panel); }
.news { list-style: none; margin: 0; padding: 0; }
.news-item { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.news-item a { color: var(--text); font-size: 14px; display: block; margin: 4px 0 2px; }
.news-item a:hover { color: var(--accent); text-decoration: underline; }
.news-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.news.compact .news-item { padding: 7px 0; } .news.compact .news-item a { font-size: 13px; }
tr[data-why] { cursor: pointer; }

/* ---- Fase 3: Top 10, cadena y calculadora ---- */
.row { display: flex; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.symlink { color: var(--accent); cursor: pointer; font-size: 16px; }
.banner { padding: 8px 12px; border-radius: 6px; margin: 8px 0; font-size: 13px; }
.banner.warn { background: #3a2c08; border: 1px solid var(--warn); color: #f3d98a; }
.t10-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.t10-rank { font-size: 22px; font-weight: 700; color: var(--muted); width: 30px; text-align: center; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; margin: 10px 0; }
.cgrid > div, .cgrid > label { display: flex; flex-direction: column; font-size: 13px; }
.cgrid span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.cgrid input { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 5px; padding: 6px 8px; margin-top: 3px; }
.warnline { font-size: 12.5px; padding: 4px 8px; border-left: 3px solid var(--warn); background: var(--panel2); margin: 4px 0; border-radius: 3px; }
.warnline.bad { border-color: var(--down); } .warnline.neutral { border-color: var(--muted); color: var(--muted); }
.tscroll { overflow-x: auto; }
table.chain { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.chain th, table.chain td { padding: 4px 7px; text-align: right; border-bottom: 1px solid var(--line); }
table.chain thead th { color: var(--muted); font-weight: 600; text-align: center; }
table.chain tbody th { text-align: center; background: var(--panel2); }
table.chain tr.atm th { color: var(--accent); }
td.copt { cursor: pointer; } td.copt:hover { background: #1f2d40; }
td.copt.itm { background: #16222f; } td.copt.dim { opacity: .45; } td.copt.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: #12304f; }
.calc { border-top: 1px solid var(--line); margin-top: 12px; }

/* ---- Fase 4 ---- */
details.learn > summary { cursor: pointer; font-size: 15px; }
.learn-body { margin-top: 8px; line-height: 1.55; max-width: 900px; }
.learn-body li { margin: 4px 0; }
.learn-body dt { font-weight: 700; margin-top: 8px; } .learn-body dd { margin: 0 0 0 14px; color: var(--muted); }
.callout { border-left: 3px solid var(--accent); background: var(--panel2); padding: 8px 12px; margin: 10px 0; border-radius: 3px; }
.cgrid select, #j-list select, textarea, #a-sym, #a-kind, #a-val { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 5px; padding: 6px 8px; font: inherit; }
.cgrid select { margin-top: 3px; }

/* ---- Fase 5: Macro, amplitud, checklist ---- */
.breadth .bgrid, .bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin: 10px 0; }
.bcell { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.bcell span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.mcard:hover { border-color: #3a4a5f; } .mcard.sel { border-color: var(--accent); }
.mlast { font-size: 22px; font-weight: 700; }
.mcard .why { margin-top: 2px; line-height: 1.35; }
ul.checklist { list-style: none; padding: 0; margin: 0; }
ul.checklist li { display: flex; gap: 8px; padding: 5px 8px; margin: 3px 0; border-left: 3px solid var(--line); background: var(--panel2); border-radius: 3px; font-size: 13px; }
ul.checklist li > b { width: 16px; text-align: center; }
ul.checklist li.ok { border-color: var(--up); } ul.checklist li.ok > b { color: var(--up); }
ul.checklist li.warn { border-color: var(--warn); } ul.checklist li.warn > b { color: var(--warn); }
ul.checklist li.bad { border-color: var(--down); } ul.checklist li.bad > b { color: var(--down); }
ul.checklist li.man { border-color: var(--accent); }
#m-chart { margin-top: 8px; }

/* ---- Fase 6 ---- */
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--panel2); margin: 6px 0; }
.stack span { display: block; height: 100%; }

/* ---------- v0.8: grafico, barras y resumen de opciones ---------- */
.ctool { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 4px 9px; background: var(--panel2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: #12304f; color: #fff; }
.dd { position: relative; }
.ddmenu { position: absolute; z-index: 30; top: 110%; left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 230px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.ddmenu[hidden] { display: none; }
.ddg { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 3px; }
.ddi { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.ddi i { width: 12px; height: 3px; display: inline-block; }
.ddn { color: var(--muted); font-size: 11px; margin-top: 8px; max-width: 230px; }
.cmpbox { display: inline-flex; gap: 4px; align-items: center; }
.cmpbox input { width: 100px; }
.range-btns { flex-wrap: wrap; }
#clegend span { white-space: nowrap; }
#chart-main { min-height: 120px; }
.ebanner { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; background: #11263a; border: 1px solid #1f4468; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; }
.tag.good { background: #12301f; color: #6fd29a; border-color: #1f5a37; }
.zbar { position: relative; height: 10px; border-radius: 5px; margin: 6px 0 2px; }
.zbar .zmk { position: absolute; top: -3px; width: 4px; height: 16px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px #000a; }
.zbar .zmk.none { display: none; }
.zlab { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.zb-row { margin-top: 10px; }
.hb { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; flex: 1; }
.hb i { display: block; height: 100%; border-radius: 4px; }
.hbr { display: grid; grid-template-columns: 90px 1fr 56px; gap: 8px; align-items: center; font-size: 12px; margin: 5px 0; }
.hbr span { color: var(--muted); } .hbr b { text-align: right; }
.og { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.card-s { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card-s h4, .osum h4 { margin: 0 0 6px; font-size: 13px; }
.gh { font-size: 14px; }
.emt td.rg { min-width: 200px; }
.mvbar { display: flex; align-items: center; height: 10px; }
.mvbar i { display: block; height: 8px; } .mvbar i.lo { background: linear-gradient(270deg, rgba(229,72,77,.7), rgba(229,72,77,.15)); border-radius: 4px 0 0 4px; }
.mvbar i.hi { background: linear-gradient(90deg, rgba(38,162,105,.7), rgba(38,162,105,.15)); border-radius: 0 4px 4px 0; }
.mvbar b { width: 2px; height: 14px; background: #fff; }
.mvbar { justify-content: center; }
.rgl { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.mvr { display: grid; grid-template-columns: 78px 1fr 58px; gap: 8px; align-items: center; margin: 3px 0; font-size: 12px; }
.dv { position: relative; height: 10px; background: var(--panel); border-radius: 4px; }
.dv b { position: absolute; left: 50%; top: -2px; width: 1px; height: 14px; background: #5d6c7d; }
.dv i { position: absolute; top: 1px; height: 8px; } .dv i.pos { background: var(--up); border-radius: 0 4px 4px 0; } .dv i.neg { background: var(--down); border-radius: 4px 0 0 4px; }
.calib { margin: 8px 0; padding: 8px 10px; background: var(--panel2); border-radius: 6px; }
.breadth .bar, .bcell .bar { height: 10px; background: linear-gradient(90deg, rgba(229,72,77,.22), rgba(134,151,169,.18) 50%, rgba(38,162,105,.22)); position: relative; }
.bcell .bar::after { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: #ffffff55; }

/* ---- v0.9: miedo/codicia, sectores, feed, chips ---- */
.fs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
@media (max-width: 900px) { .fs-grid { grid-template-columns: 1fr; } }
.fs-grid .card { margin-bottom: 0; }
.fng-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.fng-svg { width: 240px; max-width: 100%; } .fng-num { font-size: 34px; font-weight: 700; } .fng-lbl { font-size: 11px; fill: var(--muted); }
.fng-hist { display: flex; flex-direction: column; gap: 6px; } .fng-h { display: grid; grid-template-columns: 110px 34px auto; gap: 6px; align-items: baseline; }
.fng-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.fng-ch { display: flex; justify-content: space-between; font-size: 12px; gap: 6px; }
.fng-bar { position: relative; height: 10px; border-radius: 5px; margin: 3px 0; background: linear-gradient(90deg, #e5484d, #f08a4b 25%, #8697a9 50%, #7fc66a 75%, #26a269); opacity: .85; }
.fng-bar i { position: absolute; top: -3px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; }
.sec-bars { margin-top: 8px; } .sec-r { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 60px; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; font-size: 13px; }
.sec-r:hover { background: var(--panel2); } .sec-r b { text-align: right; }
.sec-b { position: relative; height: 10px; background: var(--panel2); border-radius: 5px; }
.sec-b::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line); }
.sec-b i { position: absolute; top: 0; height: 100%; } .sec-b i.pos { background: var(--up); border-radius: 0 5px 5px 0; } .sec-b i.neg { background: var(--down); border-radius: 5px 0 0 5px; }
.sec-t { width: 100%; font-size: 12px; } .sec-t td, .sec-t th { padding: 3px 6px; text-align: right; } .sec-t .l { text-align: left; } .sec-t tr[data-sym] { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { border-radius: 14px; padding: 4px 11px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent, #2f6feb); border-color: var(--accent, #2f6feb); color: #fff; } .chip-n { opacity: .7; font-size: 11px; }
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .chip-row .chips { margin: 3px 0; }
.feed { list-style: none; padding: 0; margin: 0; } .feed-it { display: flex; gap: 10px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--panel); margin-bottom: 6px; border-radius: 4px; }
.feed-it.good { border-left-color: var(--up); } .feed-it.bad { border-left-color: var(--down); } .feed-it.warn { border-left-color: var(--warn); }
.feed-ic { font-size: 18px; } .feed-t a { color: inherit; } .feed-t .tag { margin-right: 6px; text-decoration: none; }

/* ---- v0.10 ---- */
.zb-row:has(> div[style*="flex:1"]) { display: flex; align-items: center; gap: 8px; }
.zb-row:has(> div[style*="flex:1"]) .k { min-width: 74px; }

/* ---- v0.11: constructor de estrategias ---- */
.strat-t { width: 100%; font-size: 13px; } .strat-t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; } .strat-t td { padding: 4px 6px 4px 0; }
.sl-in { width: 80px; } .sl-side { border-radius: 10px; padding: 2px 9px; font-size: 12px; } .sl-side.buy { color: var(--up); border-color: var(--up); } .sl-side.sell { color: var(--down); border-color: var(--down); }
.sl-x { padding: 0 8px; font-size: 16px; }
.strat-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.strat-kpis > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.strat-kpis .k { font-size: 11px; color: var(--muted); }
.strat-svg { width: 100%; height: auto; display: block; margin-top: 8px; } .st-ax { font-size: 10px; fill: var(--muted); }
.lg { display: inline-block; width: 14px; height: 3px; margin-right: 4px; vertical-align: middle; }
.sl-in { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }

/* ---- v0.12: FRED ---- */
.fcard { margin: 0; padding: 10px 12px; } .fval { font-size: 20px; } .spark { width: 110px; height: 34px; flex: none; }

/* ---- v0.13: estilo, COT, short ---- */
.sb { width: 100%; border-collapse: separate; border-spacing: 4px; margin: 8px 0; table-layout: fixed; } .sb th { font-size: 11px; color: var(--muted); font-weight: 500; }
.sb-c { text-align: center; padding: 12px 4px; border-radius: 6px; cursor: pointer; } .sb-c b { display: block; font-size: 16px; } .sb-c span { font-size: 10px; opacity: .75; }
.cot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; margin: 10px 0; } .cot { margin: 0; }
.cot-grid { display: grid; gap: 10px; margin-top: 6px; } .cot-g .zbar { margin-top: 4px; }
.cotbar { position: relative; height: 10px; border-radius: 5px; margin: 4px 0 0; background: linear-gradient(90deg, rgba(229,165,10,.45) 0 10%, rgba(134,151,169,.28) 10% 90%, rgba(229,165,10,.45) 90% 100%); }
.cotbar i { position: absolute; top: -3px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; }
.sb th { text-align: center; }

/* ---- v0.14 ---- */
.status-box { display: flex; align-items: center; gap: 10px; } #refresh-btn { white-space: nowrap; }

/* ---- v0.14: asistente ---- */
.ai { max-width: 900px; margin: 0 auto; } .ai-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.ai-welcome { text-align: center; padding: 18px 0; } .ai-logo { font-size: 44px; } .ai-welcome h2 { margin: 6px 0; }
.ai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-top: 16px; text-align: left; }
.ai-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; text-align: left; }
.ai-card:hover { border-color: var(--accent, #4c9aff); } .ai-ic { font-size: 22px; }
.ai-msgs { display: flex; flex-direction: column; gap: 14px; min-height: 200px; padding-bottom: 12px; }
.ai-u { align-self: flex-end; max-width: 80%; } .ai-u > div { background: #3b6fd6; color: #fff; padding: 9px 14px; border-radius: 14px; white-space: pre-wrap; }
.ai-a { align-self: stretch; display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.ai-step { display: inline-flex; gap: 8px; align-items: center; width: fit-content; padding: 4px 12px; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; background: var(--panel); }
.ai-step span:first-child { color: var(--up); } .ai-step.bad span:first-child { color: var(--down); }
.ai-bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; line-height: 1.5; } .ai-bubble.err { border-color: var(--down); color: var(--down); }
.ai-bubble p { margin: 6px 0; } .ai-bubble h4 { margin: 12px 0 4px; } .ai-bubble ul, .ai-bubble ol { margin: 6px 0; padding-left: 22px; } .ai-bubble code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.aitbl { border-collapse: collapse; margin: 8px 0; font-size: 13px; } .aitbl th, .aitbl td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; } .aitbl th { background: var(--panel2); }
.ai-copy { align-self: flex-start; }
.ai-in { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg, var(--panel)); padding: 8px 0; }
.ai-in textarea { flex: 1; resize: none; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; max-height: 160px; }
.ai-in button { padding: 10px 16px; font-size: 16px; }
.ai-h { display: flex; justify-content: space-between; padding: 6px 4px; cursor: pointer; border-bottom: 1px solid var(--line); } .ai-h:hover { background: var(--panel2); }
.ai-setup { max-width: 760px; margin: 0 auto; }

/* ---- v0.15: boton flotante y panel rapido de la IA ---- */
#ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; height: 54px; min-width: 54px; padding: 0 16px; border-radius: 28px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c5cf0, #4c7df0); color: #fff; font-size: 22px; display: flex; align-items: center; gap: 6px; box-shadow: 0 6px 20px rgba(60,80,200,.45); }
#ai-fab span { font-size: 14px; font-weight: 600; } #ai-fab:hover { filter: brightness(1.1); } #ai-fab[hidden] { display: none; }
#ai-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); z-index: 70; background: var(--bg, #0e141b); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.4); display: flex; flex-direction: column; padding: 12px; }
#ai-drawer[hidden] { display: none; }
.dw-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .dw-body { padding: 8px 2px; }
.dw-msgs { flex: 1; overflow-y: auto; min-height: 0; } #ai-drawer .ai-in { position: static; }
.dw-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
#ai-drawer .ai-u { max-width: 92%; } #ai-drawer .ai-welcome { padding: 10px 0; }

/* ======================= v0.16 ======================= */
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.nowrap { white-space: nowrap; }
.warn-t { color: var(--warn); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; background: var(--panel2); padding: 2px 7px; border-radius: 5px; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sec-t2 { margin: 18px 0 8px; font-size: 15px; }
input, select, textarea { font: inherit; }
.card input:not([type=checkbox]), .card select, .card textarea, .co-prices input, .cgrid input, .cgrid select, .toolbar input, .toolbar select, .adm-new input {
  background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 6px 9px; border-radius: 6px; max-width: 100%; }
.card textarea { width: 100%; resize: vertical; }

/* ---- acceso ---- */
body.auth-mode > :not(#auth):not(script) { display: none !important; }
#auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, #17314f 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.auth-brand { font-size: 28px; font-weight: 800; text-align: center; } .auth-brand span { color: var(--accent); }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.auth-tabs button { padding: 9px; } .auth-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#auth-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
#auth-form input { display: block; width: 100%; margin-top: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 11px 12px; border-radius: 8px; font-size: 16px; }
#auth-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth-msg { min-height: 18px; color: var(--down); font-size: 13px; margin-bottom: 6px; }
.auth-go { width: 100%; padding: 12px; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; font-size: 16px; }
.auth-foot { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }
#usermenu { position: relative; } #usermenu[hidden] { display: none; }
#um-pop { position: absolute; right: 0; top: 38px; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 200px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#um-pop[hidden] { display: none; } .um-head { padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }

/* ---- Mi Top Companias ---- */
.co-addrow { margin-top: 10px; align-items: center; } .co-addrow input { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 8px 10px; border-radius: 6px; text-transform: uppercase; min-width: 220px; }
.co-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.co-kpis > div, .cgrid > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.co-kpis span, .cgrid > div > span { font-size: 11px; color: var(--muted); } .co-kpis b { font-size: 18px; }
.co-kpis .hl-good { border-color: var(--up); } .co-kpis .hl-warn { border-color: var(--warn); }
.co-bar { justify-content: space-between; align-items: center; margin-bottom: 8px; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; align-items: start; }
.co-card { margin: 0; display: flex; flex-direction: column; gap: 8px; } .co-card.dim { opacity: .6; }
.co-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .co-sym { font-size: 20px; cursor: pointer; } .co-px { font-size: 18px; white-space: nowrap; }
.co-tags { display: flex; flex-wrap: wrap; gap: 5px; } .co-tags:empty { display: none; }
.co-m { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); } .co-m b { color: var(--text); font-weight: 600; }
.co-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .co-prices label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); } .co-prices input { width: 100%; }
.co-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .co-status { max-width: 170px; }
.co-det { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 10px; } .co-det[hidden] { display: none; }
.co-sec h5 { margin: 0 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.recbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 4px 0; background: var(--panel2); } .recbar i { display: block; }
.ladder { padding: 14px 6px 18px; } .lad-bar { position: relative; height: 6px; background: linear-gradient(90deg, rgba(229,72,77,.5), rgba(134,151,169,.25) 40%, rgba(38,162,105,.5)); border-radius: 3px; }
.lad-m { position: absolute; top: -4px; width: 3px; height: 14px; border-radius: 2px; background: var(--muted); } .lad-m em { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-style: normal; color: var(--muted); white-space: nowrap; }
.lad-m.good { background: var(--up); } .lad-m.bad { background: var(--down); } .lad-m.tgt { background: var(--warn); }
.lad-now { position: absolute; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); transform: translateX(-6px); }

/* ---- diario ---- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.cgrid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.plan-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; align-items: start; } .pos { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pos-good { border-color: var(--up); } .pos-bad { border-color: var(--down); }
.pos-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .pos-pnl { font-size: 20px; font-weight: 700; white-space: nowrap; }
.pos-th { border-left: 2px solid var(--line); padding-left: 8px; }
.pbar { position: relative; height: 8px; border-radius: 4px; margin: 8px 4px 16px; background: linear-gradient(90deg, rgba(229,72,77,.55) 0, rgba(134,151,169,.25) 35%, rgba(38,162,105,.55) 100%); }
.pb-now { position: absolute; top: -4px; width: 4px; height: 16px; background: #fff; border-radius: 2px; } .pb-l, .pb-r { position: absolute; top: 12px; font-size: 10px; color: var(--muted); } .pb-l { left: 0; } .pb-r { right: 0; }
.pos-plan summary { cursor: pointer; }
.eqsvg { width: 100%; max-width: 480px; height: auto; display: block; }
.scen { font-size: 12px; } .scen th { text-align: left; cursor: default; position: static; white-space: nowrap; } .scen td { text-align: right; } .scen tr.now th { color: var(--accent); }
.scen tbody tr { cursor: default; } .scen tbody tr:hover { background: none; }
.lv2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .lvrow { display: flex; align-items: center; gap: 8px; margin: 3px 0; } .lv2 h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.gexbars { display: flex; align-items: center; gap: 2px; overflow-x: auto; padding: 4px 0; min-height: 64px; } .gx { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 20px; font-size: 9px; color: var(--muted); }
.gx i { display: block; width: 12px; border-radius: 2px; } .gx i.pos { background: var(--up); } .gx i.neg { background: var(--down); }
.termsvg { width: 100%; height: auto; display: block; } .skrow { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 2px; }
.tg-box { margin: 8px 0 4px; }
.mini { font-size: 12px; } .mini th { cursor: default; position: static; } .mini tbody tr { cursor: default; }

/* ---- barra de secciones del ticker y navegacion inferior (solo telefono) ---- */
.tnav { display: none; } .bnav { display: none; } .more-sheet[hidden] { display: none; }

/* ======================= TELEFONO (iPhone 16 y similares) ======================= */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; padding-bottom: calc(66px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  input, select, textarea { font-size: 16px !important; }            /* evita el zoom automatico de iOS al escribir */
  button, .btn, .chip, select, input[type=date], input[type=number], input[type=text], input:not([type]) { min-height: 40px; }
  .chip { padding: 8px 14px; font-size: 13px; min-height: 36px; }
  .tag { padding: 3px 8px; }

  #demo-banner { padding-top: calc(6px + env(safe-area-inset-top)); font-size: 12px; }
  .topbar { position: static; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .brand { font-size: 19px; }
  #search-form { grid-column: 1 / -1; grid-row: 2; } #search { flex: 1; width: 100%; min-width: 0; } #search-form button { min-width: 52px; }
  .status-box { grid-column: 2; grid-row: 1; gap: 6px; }
  .status { margin-left: 0; text-align: right; max-width: 150px; } .status .st-sub, .status br { display: none; } .st-main { font-size: 11px; }
  #refresh-btn { padding: 6px 10px; min-height: 36px; font-size: 13px; }
  #um-btn .um-name { display: none; } #um-btn { padding: 6px 10px; min-height: 36px; }

  .indices { padding: 8px 12px; gap: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; } .idx { min-width: 118px; padding: 6px 10px; scroll-snap-align: start; } .idx .p { font-size: 15px; }
  .heatmap-wrap { padding: 0 12px 6px; } #heatmap { height: 240px; } .section-head .muted { display: none; }

  .tabs { display: none; }                                              /* en el telefono manda la barra inferior */
  main { padding: 12px; min-height: 300px; }
  .card { padding: 11px 12px; margin-bottom: 10px; }
  .toolbar { gap: 8px; } .toolbar input { flex: 1; min-width: 0; }
  .table-wrap, .tscroll { margin: 0 -2px; } th, td { padding: 8px 8px; }
  table:has(td.sym) th:nth-child(3), table:has(td.sym) td:nth-child(3), table:has(td.sym) th:nth-child(4), table:has(td.sym) td:nth-child(4) { display: none; }  /* nombre y sector fuera: queda lo esencial */
  .grid2, .fs-grid, .og, .t-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .grid2 > *, .fs-grid > *, .og > *, .t-grid > * { min-width: 0; }
  .cgrid, .co-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-grid, .pos-grid { grid-template-columns: minmax(0, 1fr); }
  .cgrid > *, .co-prices > * { min-width: 0; } .cgrid input, .cgrid select { width: 100%; }
  .co-prices { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .co-prices input { padding: 8px 6px; }
  .co-bar { flex-direction: column; align-items: stretch; } .co-addrow input { min-width: 0; flex: 1; }
  .lv2 { grid-template-columns: 1fr; }
  .fcard .spark { width: 80px; } .cot-list { grid-template-columns: 1fr; }
  .strat-kpis { grid-template-columns: 1fr 1fr; }
  .sec-r { grid-template-columns: minmax(90px, 120px) 1fr 54px; }
  .fng-svg { width: 200px; } .fng-h { grid-template-columns: 90px 30px auto; }

  /* pagina de ticker */
  .t-head { gap: 8px 10px; } .t-head h1 { font-size: 24px; } .t-price { font-size: 21px; } .t-head > button { flex: 1 1 auto; }
  .tnav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tnav[hidden] { display: none; } .tnav .chip { flex: none; }
  .ctool { flex-wrap: wrap; gap: 6px; } .ctool .seg { overflow-x: auto; max-width: 100%; } .ctool .cmpbox { display: none; }
  .range-btns { overflow-x: auto; flex-wrap: nowrap; } .range-btns button { flex: none; }
  #chart-main { min-height: 280px; }
  .ebanner { flex-direction: column; align-items: flex-start; }
  .emt { font-size: 12px; } .emt th, .emt td { padding: 6px; }

  /* asistente */
  .ai-in { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); }
  .ai-u { max-width: 92%; } .ai-cards { grid-template-columns: 1fr; }
  #ai-fab { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); height: 48px; min-width: 48px; padding: 0 12px; } #ai-fab span { display: none; }
  #ai-drawer { width: 100vw; padding-bottom: calc(12px + env(safe-area-inset-bottom)); padding-top: calc(12px + env(safe-area-inset-top)); z-index: 90; }

  /* barra inferior */
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: rgba(20,27,36,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  body.auth-mode .bnav { display: none; }
  .bn { background: none; border: none; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 7px 2px 6px; color: var(--muted); min-height: 56px; }
  .bn-i { font-size: 21px; line-height: 1; position: relative; } .bn-l { font-size: 10.5px; } .bn.on { color: var(--accent); } .bn.on .bn-l { font-weight: 700; }
  .bn-dot { position: absolute; top: -4px; right: -10px; background: var(--down); color: #fff; font-size: 9px; font-style: normal; border-radius: 8px; padding: 1px 5px; }
  .more-sheet { position: fixed; inset: 0; z-index: 95; } .ms-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
  .ms-card { position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
  .ms-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .ms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .ms-i { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px; font-size: 13px; min-height: 76px; } .ms-i span { font-size: 24px; } .ms-i.on { border-color: var(--accent); color: var(--accent); }
  .ms-user { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
  .disclaimer { padding-bottom: 24px; }
}
@media (min-width: 761px) { .more-sheet { display: none; } }
@media (max-width: 380px) { .cgrid, .co-kpis { grid-template-columns: 1fr; } .co-prices { grid-template-columns: 1fr 1fr; } }

@media (max-width: 760px) { .star { font-size: 22px; min-width: 40px; min-height: 40px; padding: 0; } }
@media (max-width: 760px) { select { max-width: 100%; text-overflow: ellipsis; } .row > label { min-width: 0; max-width: 100%; } #opt-exp { width: 100%; } }

#auth-form label[hidden] { display: none; }
.ctxd { margin-bottom: 12px; } .ctxd > summary { cursor: pointer; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-weight: 600; margin-bottom: 10px; }
.more-row td { background: none; } .more-row:hover { background: none; }
@media (max-width: 760px) {
  .brand { white-space: nowrap; grid-column: 1; grid-row: 1; }
  .topbar { grid-template-columns: 1fr auto auto; }
  .status-box { display: contents; }
  #refresh-btn { grid-column: 2; grid-row: 1; } #usermenu { grid-column: 3; grid-row: 1; }
  #search-form { grid-row: 2; }
  .status { grid-column: 1 / -1; grid-row: 3; text-align: left; max-width: none; margin: 0; }
  .st-main { font-size: 12px; color: var(--muted); }
  #um-pop { right: 0; }
}
