:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --ink: #1a1a1f;
  --muted: #6b6b75;
  --line: #e7e3dc;
  --accent: #1d4ed8;
  --accent-soft: #e4ebfb;
  --green: #15803d;
  --green-soft: #dcfce7;
  --orange: #c2410c;
  --orange-soft: #ffedd5;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --purple: #6d28d9;
  --purple-soft: #ede9fe;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
}
code, pre, .mono { font-family: ui-monospace, "Cascadia Mono", "Consolas", "Menlo", monospace; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.age { color: var(--muted); font-size: 12px; white-space: nowrap; }
.age.old { color: var(--orange); }
.age.stale { color: var(--red); }
.prev { opacity: .55; }
.prev::after { content: " · sesión anterior"; color: var(--muted); font-size: 11px; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .5px;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.paper { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-weight: 700; font-size: 11px; margin-left: 4px; }
.demo { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 11px; margin-left: 4px; }
.clocks { display: flex; align-items: center; gap: 16px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.clock span:last-child { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.pill { padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: #eceae5; color: var(--muted); }
.pill.blue { background: var(--accent-soft); color: var(--accent); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
main { padding: 16px 20px 40px; max-width: 1280px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card, .grid-4 > *, .grid-5 > * { min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.banner.red { background: var(--red-soft); color: var(--red); }
.banner.orange { background: var(--orange-soft); color: var(--orange); }

/* steppers */
.stepper-h { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.stepper-h li {
  flex: 1 1 90px; min-width: 90px; padding: 8px 6px; border-radius: 8px; background: #f1efe9; color: var(--muted);
  font-size: 11px; font-weight: 600; text-align: center; position: relative;
}
.stepper-h li .n { display: block; font-size: 15px; font-weight: 800; }
.stepper-h li.done { background: var(--green-soft); color: var(--green); }
.stepper-h li.now { background: var(--accent); color: #fff; }
.stepper-v { list-style: none; margin: 0; padding: 0; }
.stepper-v li { display: grid; grid-template-columns: 28px 150px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.stepper-v li:last-child { border-bottom: 0; }
.stepper-v .dot { width: 22px; height: 22px; border-radius: 50%; background: #e4e1da; color: var(--muted); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.stepper-v li.done .dot { background: var(--green); color: #fff; }
.stepper-v li.now .dot { background: var(--accent); color: #fff; }
.stepper-v li.human .dot { background: var(--purple); color: #fff; }
.stepper-v .name { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding-top: 3px; }
.stepper-v .val { font-variant-numeric: tabular-nums; }
.stepper-v .val b { font-size: 15px; }
.stepper-v .val small { color: var(--muted); display: block; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.rang td { background: var(--green-soft); }
.tbl-scroll { overflow-x: auto; }
.tbl.excel th { background: #f3f1ec; border: 1px solid var(--line); position: sticky; top: 0; }
.tbl.excel td { border: 1px solid var(--line); white-space: nowrap; }
.tbl.excel tr:nth-child(even) td { background: #faf9f6; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* chips, kv */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { padding: 3px 9px; border-radius: 999px; background: #f1efe9; font-size: 12px; font-weight: 600; }
.chip.moving { background: var(--orange-soft); color: var(--orange); }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; margin-left: 4px; text-transform: uppercase; }
.tag.imp { background: var(--red-soft); color: var(--red); }
.news-item { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.news-item .t { font-size: 12px; color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 10px; font-size: 13px; }
.kv div { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.kv div span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 13px; }
.verdict small { display: block; color: var(--muted); margin-top: 4px; }

/* odds bar */
.odds-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #eee; }
.odds-bar div { height: 100%; }
.odds-bar .t { background: var(--green); }
.odds-bar .s { background: var(--red); }
.odds-bar .n { background: #c9c5bc; }
.odds-legend { display: flex; gap: 14px; font-size: 12px; margin: 6px 0 10px; flex-wrap: wrap; }
.odds-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.chart-wrap { position: relative; height: 240px; }

/* ticket */
.ticket { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: 12.5px; white-space: pre-wrap; background: #fbfaf7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ticket.ready { border-color: var(--green); background: #f3fbf5; }
.code { font-size: 11.5px; background: #1a1a1f; color: #e8e6e1; border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; }
.ticket { word-break: break-word; }
.kv { grid-template-columns: 1fr; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: #cfcac0; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* gauges */
.gauge { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.gauge .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.gauge .big { font-size: 26px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.gauge .big small { font-size: 13px; color: var(--muted); font-weight: 600; }
.gauge .bar { height: 8px; border-radius: 999px; background: #eee; overflow: hidden; }
.gauge .bar div { height: 100%; background: var(--green); }
.gauge.warn .bar div { background: var(--orange); }
.gauge.bad .bar div { background: var(--red); }
.gauge.bad .big { color: var(--red); }
.gauge .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* kpis */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.kpi .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 20px 30px; }

@media (max-width: 900px) {
  .grid-2, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .clocks { gap: 8px; }
  .clock span:last-child { font-size: 14px; }
  main { padding: 12px 14px 30px; }
  .stepper-v li { grid-template-columns: 24px 1fr; }
  .stepper-v .val { grid-column: 2; }
}

/* ===================== web (solo lectura) ===================== */
:root { --neutral: #c9c5bc; --feed-bg: #fbfaf7; }
.btn.tiny { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }
.pill.live { position: relative; padding-left: 22px; }
.pill.live::before { content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--green); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }

/* login */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { margin-bottom: 6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.login-card input { font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.login-card input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.login-msg { min-height: 18px; color: var(--red); font-weight: 600; font-size: 13px; }

/* ahora */
.phase-now { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.phase-num { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 48px; }
.phase-name { font-weight: 800; font-size: 16px; }
.now-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.now-sym { font-size: 22px; font-weight: 800; }
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.now-kv { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.now-kv .lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.now-kv .val { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.now-kv .val small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.verdict.small { font-size: 12px; margin-top: 10px; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 44px 22px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; align-items: start; }
.feed-item .fase.none { visibility: hidden; }
.feed-item .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.feed-item .fase { display: inline-flex; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; align-items: center; justify-content: center; }
.feed-item > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.feed-item.aviso .fase { background: var(--orange-soft); color: var(--orange); }
.feed-item.error .fase { background: var(--red-soft); color: var(--red); }
.feed-item.aviso span:last-child { color: var(--orange); }
.feed-item.error span:last-child { color: var(--red); font-weight: 700; }
.feed-item.new { animation: slidein .5s ease-out; }
@keyframes slidein { from { background: var(--accent-soft); transform: translateY(-6px); opacity: 0; } to { background: transparent; transform: none; opacity: 1; } }

/* movil */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .clocks { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .now-grid { grid-template-columns: 1fr 1fr; }
  .tabs { padding: 6px 8px 0; gap: 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 10px 10px; font-size: 13px; }
  .stepper-h li { flex: 1 1 60px; min-width: 60px; font-size: 10px; padding: 6px 4px; }
  .feed { max-height: 320px; }
  .feed-item { grid-template-columns: 40px 20px 1fr; }
  .kpi .big, .gauge .big { font-size: 20px; }
  .brand-name { font-size: 15px; }
  .pill { font-size: 11px; padding: 3px 8px; }
  .btn.tiny span { display: none; }
}

/* modo oscuro */


/* ===================== dashboard (rediseño 4 pestañas) ===================== */
.chart-card { padding: 12px 12px 10px; }
.chart-head { display: flex; align-items: baseline; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-sym { display: flex; align-items: center; gap: 8px; }
.chart-sym .sym { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.chart-price { display: flex; align-items: baseline; gap: 8px; }
.chart-price .last { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-price .change { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-meta { font-size: 12px; margin-left: auto; }
.tf { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,.05); margin-left: auto; }
.tf button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 8px; cursor: pointer; line-height: 1; }
.tf button.active { background: #fff; color: var(--blue, #1d4ed8); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tf button:disabled { opacity: .4; cursor: not-allowed; }
.tf + .chart-meta { margin-left: 0; flex-basis: 100%; }
@media (max-width: 600px) {
  .tf { margin-left: 0; flex-basis: 100%; overflow-x: auto; max-width: 100%; }
  .tf button { flex: 1 0 auto; text-align: center; }
}

.candles { position: relative; height: 380px; width: 100%; }
.candles .replaying { position: absolute; top: 8px; left: 8px; z-index: 3; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; margin-right: 5px; vertical-align: middle; }
.chart-legend i.dash { border-top-style: dashed; }

.acct { margin-bottom: 16px; }
.acct .kpi .big { font-size: 24px; }
.acct .kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.acct .kpi .bar { height: 6px; border-radius: 999px; background: #eee; overflow: hidden; margin-top: 8px; }
.acct .kpi .bar div { height: 100%; background: var(--green); transition: width .6s ease; }
.acct .kpi.warn .bar div { background: var(--orange); }
.acct .kpi.bad .bar div { background: var(--red); }

.words { margin: 0; padding: 0 0 0 18px; font-size: 14.5px; line-height: 1.55; }
.words li { margin: 4px 0; }
.words li.alert { color: var(--red); font-weight: 600; }
.words li b { font-variant-numeric: tabular-nums; }

.op-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 10px; justify-content: center; }
.op-row .chip { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 96px; flex: 1 1 96px; max-width: 160px; padding: 6px 10px; border-radius: 10px; background: rgba(29,78,216,.06); border: 1px solid rgba(29,78,216,.16); font-weight: 500; }
.op-row .chip .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.op-row .chip .val { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.op-row .chip.ok .val { color: var(--green); }
.op-row .chip.ko .val { color: var(--red); }
.op-row .chip.hu .val { color: var(--purple); }
details.more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.more > summary, details.fold > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.more > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.fold > summary::before { content: "▸"; margin-right: 6px; color: var(--muted); }
details[open].more > summary::before, details[open].fold > summary::before { content: "▾"; }
details.more > summary::after { content: ""; }
details.fold > summary { color: var(--ink); font-size: 15px; }
details.fold > summary > span:first-child::before { content: "▸ "; color: var(--muted); }
details[open].fold > summary > span:first-child::before { content: "▾ "; }
details.fold > summary::before { content: none; }
details.fold > *:not(summary) { margin-top: 10px; }
.h3 { font-size: 13px; font-weight: 700; margin: 14px 0 6px; display: flex; justify-content: space-between; }

@media (max-width: 600px) {
  .candles { height: 260px; }
  .chart-sym .sym { font-size: 22px; }
  .chart-price .last { font-size: 20px; }
  .chart-meta { margin-left: 0; width: 100%; }
  .acct { grid-template-columns: 1fr 1fr; }
  .acct .kpi .big { font-size: 20px; }
  .words { font-size: 14px; }
}


/* ===================== v3 · interfaz por paneles (maqueta aprobada 1-nov-2026) ===================== */
:root { --hdr: 54px; --accbar: 62px; --stat: 30px; }
body { font-size: 13px; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
/* ① menu */
.topbar { padding: 7px 14px; gap: 12px; min-height: var(--hdr); }
.logo { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.brand-name { font-size: 14px; line-height: 1.1; }
.brand-sub { font-size: 11px; }
.menu { display: flex; gap: 2px; flex: 1; justify-content: center; }
.menu button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.menu button.active { background: var(--accent-soft); color: var(--accent); }
.clocks { gap: 12px; }
.clock span:last-child { font-size: 15px; }
.clock .lbl { font-size: 9px; }
.pill { padding: 3px 9px; font-size: 11px; }
/* ② cuenta */
.acc { display: flex; align-items: center; background: var(--card); border-bottom: 1px solid var(--line); padding: 0 12px; position: sticky; top: var(--hdr); z-index: 9; min-height: var(--accbar); }
.acc-kpis { display: flex; flex: 1; min-width: 0; }
.acc .kpi { flex: 1 1 0; min-width: 0; text-align: center; padding: 7px 12px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.acc .kpi:first-child { border-left: 1px solid var(--line); }
.acc .kpi .lbl { font-size: 9.5px; letter-spacing: .06em; }
.acc .kpi .big { font-size: 17px; line-height: 1.15; }
.acc .kpi .sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .kpi .bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 3px auto 0; max-width: 140px; }
.acc .kpi .bar div { height: 100%; background: var(--accent); transition: width .6s ease; }
.acc .kpi.warn .bar div { background: var(--orange); }
.acc .kpi.bad .bar div { background: var(--red); }
.acc .kpi .big.pos { color: var(--green); } .acc .kpi .big.neg { color: var(--red); }
.acc .user { margin-left: 12px; white-space: nowrap; background: transparent; border: 0; }
.acc .user b { color: var(--ink); font-weight: 600; }
/* main / dashboard grid */
main { padding: 0; max-width: none; margin: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
main > .banner { margin: 8px 12px 0; }
.tab { display: none; }
.tab.active { display: block; }
#tab-riesgo, #tab-historial, #tab-config { padding: 14px 16px 30px; max-width: 1280px; margin: 0 auto; width: 100%; }
.dash.active { display: grid; grid-template-columns: 272px minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr) minmax(220px, 40%); grid-template-areas: "mkt chart op" "mkt bottom op"; height: calc(100dvh - var(--hdr) - var(--accbar) - var(--stat)); min-height: 620px; }
.dash.folded.active { grid-template-columns: 0 minmax(0, 1fr) 330px; }
.dash.folded .mkt { display: none; }
.unfold { position: absolute; left: 0; top: calc(var(--hdr) + var(--accbar) + 10px); z-index: 8; writing-mode: vertical-rl; transform: rotate(180deg); border: 1px solid var(--line); border-left: 0; background: var(--card); color: var(--accent); font: inherit; font-size: 11px; font-weight: 700; padding: 10px 4px; border-radius: 0 0 8px 8px; cursor: pointer; }
.panel { position: relative; background: var(--card); border: 1px solid var(--line); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ph { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); gap: 8px; }
.ph .ph-r { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.fold-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; font: inherit; font-size: 12px; line-height: 1; padding: 2px 6px; cursor: pointer; }
.h4 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.h4 .muted, .h4 .age { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11px; }
/* ③ mercado */
.mkt { grid-area: mkt; border-left: 0; overflow-y: auto; }
.etf-list { border-bottom: 1px solid var(--line); }
.etf { display: grid; grid-template-columns: 50px 1fr auto; gap: 4px 6px; padding: 7px 10px; border-bottom: 1px solid var(--line); align-items: center; font-variant-numeric: tabular-nums; cursor: default; }
.etf:last-child { border-bottom: 0; }
.etf.sel { background: var(--accent-soft); }
.etf .s { font-weight: 800; font-size: 13px; }
.etf .p { font-weight: 700; text-align: right; grid-column: 2; }
.etf .d { font-size: 11px; text-align: right; font-weight: 700; }
.etf .hit { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.etf .hit.y { color: var(--green); }
.etf .p.flash-up { animation: flashUp .5s; } .etf .p.flash-dn { animation: flashDn .5s; }
@keyframes flashUp { from { background: var(--green-soft); } to { background: transparent; } }
@keyframes flashDn { from { background: var(--red-soft); } to { background: transparent; } }
details.fold2 { border-bottom: 1px solid var(--line); }
details.fold2 > summary { cursor: pointer; padding: 8px 10px; font-weight: 700; font-size: 12px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.fold2 > summary::-webkit-details-marker { display: none; }
details.fold2 > summary::after { content: "▾"; color: var(--muted); }
details[open].fold2 > summary::after { content: "▴"; }
details.fold2 .c, details.fold2 > .muted.c { padding: 0 10px 10px; font-size: 12px; }
details.fold2 .news-item { padding: 5px 0; font-size: 12px; }
details.fold2 .tbl { font-size: 11.5px; } details.fold2 .tbl th, details.fold2 .tbl td { padding: 4px 5px; }
/* ④ grafico */
.chart-card { grid-area: chart; padding: 0; margin: 0; border-radius: 0; }
.chart-head { padding: 8px 12px 6px; margin: 0; border-bottom: 1px solid var(--line); align-items: center; gap: 8px 14px; }
.chart-sym .sym { font-size: 20px; } .chart-price .last { font-size: 20px; } .chart-price .change { font-size: 13px; }
.tickind { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.tickind.gray { background: var(--line); color: var(--muted); }
.tickind.on { background: var(--green-soft); color: var(--green); }
.tickind.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 4px; animation: beat 1s infinite; }
.tf { margin-left: auto; }
.tf button { font-size: 11.5px; padding: 4px 9px; }
.tf + .chart-meta { flex-basis: 100%; font-size: 11px; }
.candles { flex: 1; min-height: 300px; height: auto; }
.chart-legend { padding: 5px 12px; border-top: 1px solid var(--line); margin: 0; font-size: 11px; }
/* ⑤ operacion activa */
.op { grid-area: op; overflow-y: auto; border-right: 0; }
.op-ticket, .op-tm, .op-words { padding: 10px; border-bottom: 1px solid var(--line); }
.op-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.op-h b { font-size: 18px; } .op-h .muted { font-size: 11px; }
.kvg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kvg div { background: var(--bg); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.kvg .l { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.kvg .v { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.kvg .v small { font-weight: 500; color: var(--muted); font-size: 10.5px; }
.kvg .v.g { color: var(--green); } .kvg .v.r { color: var(--red); } .kvg .v.b { color: var(--accent); } .kvg .v.p { color: var(--purple); }
.op .fine { font-size: 11px; }
.op .odds-bar { height: 10px; }
.op .odds-legend { font-size: 11px; gap: 10px; margin: 5px 0 6px; }
.op .verdict.small { margin-top: 6px; font-size: 12px; padding: 6px 8px; }
.op details.more { margin-top: 6px; padding-top: 6px; }
.op .chart-wrap { height: 200px; }
.words { font-size: 12.5px; line-height: 1.5; padding-left: 16px; }
/* ⑥ seguimiento */
.bottom { grid-area: bottom; border-top: 1px solid var(--line); min-height: 0; }
.subtabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg); flex: 0 0 auto; }
.subtabs button { border: 0; background: transparent; padding: 7px 14px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.subtabs button.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--card); }
.subtab { display: none; padding: 10px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.subtab.active { display: block; }
.phase-now { margin-bottom: 8px; gap: 10px; }
.phase-now .age { margin-left: auto; }
.phase-num { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; flex-basis: 36px; }
.phase-name { font-size: 13.5px; }
.phase-now .muted { font-size: 11.5px; }
.stepper-h li { flex: 1 1 60px; min-width: 60px; padding: 5px 2px; font-size: 10px; }
.stepper-h li .n { font-size: 14px; }
.op-row { margin: 8px 0 6px; }
.op-row .chip { min-width: 80px; padding: 5px 8px; }
.op-row .chip .val { font-size: 12.5px; }
.feed { max-height: none; font-size: 12px; }
.feed-item { padding: 5px 0; font-size: 12px; }
.bottom .tbl { font-size: 12px; }
/* ⑦ estado */
.status { display: flex; gap: 12px; align-items: center; padding: 5px 12px; background: var(--card); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); flex-wrap: wrap; min-height: var(--stat); }
.status .sep { opacity: .4; }
.status .ver { margin-left: auto; }
.navm { display: none; }
.foot { display: none; }

/* ---------- movil / tablet (≤768): apilado + barra inferior ---------- */
@media (max-width: 768px) {
  :root { --hdr: 52px; --accbar: 60px; }
  body { font-size: 14px; }
  .topbar { padding: 8px 12px; flex-wrap: nowrap; }
  .menu { display: none; }
  .clocks { margin-left: auto; gap: 8px; }
  .clock span:last-child { font-size: 13px; }
  .clocks .clock:first-child { display: none; }
  .acc { padding: 0 6px; overflow-x: auto; scrollbar-width: none; }
  .acc::-webkit-scrollbar { display: none; }
  .acc-kpis { gap: 0; }
  .acc .kpi { flex: 0 0 auto; min-width: 128px; padding: 6px 10px; text-align: left; }
  .acc .kpi .big { font-size: 15px; } .acc .kpi .sub { font-size: 10px; max-width: 150px; }
  .acc .kpi .bar { margin-left: 0; }
  .acc .user { display: none; }
  .dash.active, .dash.folded.active { display: flex; flex-direction: column; height: auto; min-height: 0; padding-bottom: 60px; }
  .dash.folded .mkt { display: flex; }
  .unfold { display: none !important; }
  .fold-btn { display: none; }
  .panel { border-left: 0; border-right: 0; }
  .chart-card { order: 1; }
  .candles { height: 260px; min-height: 260px; flex: none; }
  .op { order: 2; overflow: visible; }
  .bottom { order: 3; max-height: none; }
  .subtab { overflow: visible; }
  .feed { max-height: 360px; overflow-y: auto; }
  .mkt { order: 4; overflow: visible; }
  .stepper-h li { flex: 1 1 56px; min-width: 56px; }
  .status { padding-bottom: 8px; }
  .navm { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .navm button { flex: 1; border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 0 8px; cursor: pointer; }
  .navm button span { display: block; font-size: 17px; line-height: 1.1; }
  .navm button.active { color: var(--accent); }
  #tab-riesgo, #tab-historial, #tab-config { padding: 12px 12px 80px; }
  .kvg .v { font-size: 14px; }
  .words { font-size: 14px; }
  .op-h b { font-size: 20px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .dash.active { grid-template-columns: 220px minmax(0, 1fr) 290px; }
}


/* ---- BTC (solo referencia) · filas de Mercado clicables · pista con mercado cerrado · toast */
.etf { cursor: pointer; }
.etf:hover { background: var(--accent-soft); }
.etf.btc { border-top: 2px solid var(--line); margin-top: 2px; }
.etf.btc .s::after { content: "₿"; font-size: 10px; margin-left: 4px; color: #f59e0b; font-weight: 700; }
.etf.btc .hit { color: #b45309; }
.chart-hint { font-size: 11.5px; color: var(--muted); padding: 2px 0 0; }
.chart-hint a { color: var(--accent); font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.toast { position: fixed; left: 50%; bottom: 72px; transform: translate(-50%, 12px); background: var(--ink); color: var(--card); font-size: 12.5px; padding: 8px 14px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: 90vw; }
.toast.on { opacity: .95; transform: translate(-50%, 0); }


/* ---- modo LOCAL (app/server.py): botones de accion, solo en el PC de trading ---- */
.local-actions { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.local-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.local-btns .btn { font-size: 12px; padding: 6px 10px; }
.local-btns .btn:disabled { opacity: .5; cursor: not-allowed; }
.local-out { margin-top: 6px; font-size: 11px; }
.local-out summary { cursor: pointer; color: var(--muted); }
.local-out pre { white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 4px 0 0; font-size: 11px; }
#localTag { margin-left: 10px; white-space: nowrap; }

/* ===== modo oscuro: por sistema (salvo tema manual claro) ===== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121216; --card: #1b1b21; --ink: #e8e6e1; --muted: #9a9aa6; --line: #2b2b33;
    --accent: #3b82f6; --accent-soft: #1e2a4a; --green: #4ade80; --green-soft: #14321f;
    --orange: #fb923c; --orange-soft: #3a2412; --red: #f87171; --red-soft: #3b1717;
    --purple: #a78bfa; --purple-soft: #2a2140; --neutral: #4b4b55; --feed-bg: #16161b;
  }
  :root:not([data-theme="light"]) .pill.gray, :root:not([data-theme="light"]) .chip, :root:not([data-theme="light"]) .stepper-h li, :root:not([data-theme="light"]) .stepper-v .dot { background: #26262e; }
  :root:not([data-theme="light"]) .ticket, :root:not([data-theme="light"]) .now-kv, :root:not([data-theme="light"]) .login-card input { background: #16161b; }
  :root:not([data-theme="light"]) .ticket.ready { background: #14321f; }
  :root:not([data-theme="light"]) .tbl.excel th, :root:not([data-theme="light"]) .tbl.excel tr:nth-child(even) td { background: #202027; }
  :root:not([data-theme="light"]) .btn { background: #26262e; color: var(--ink); }
  :root:not([data-theme="light"]) .filters select { background: #26262e; color: var(--ink); }
  :root:not([data-theme="light"]) .odds-bar, :root:not([data-theme="light"]) .gauge .bar { background: #2b2b33; }
  :root:not([data-theme="light"]) .foot { color: var(--muted); }
  :root:not([data-theme="light"]) .tf { background: rgba(255,255,255,.07); }
  :root:not([data-theme="light"]) .tf button.active { background: #2a2a33; color: #93c5fd; }
  :root:not([data-theme="light"]) .op-row .chip { background: #16161b; }
  :root:not([data-theme="light"]) .acct .kpi .bar { background: #2b2b33; }
  :root:not([data-theme="light"]) .kvg div, :root:not([data-theme="light"]) .etf.sel, :root:not([data-theme="light"]) .op-row .chip { background: #16161b; }
  :root:not([data-theme="light"]) .etf.sel { background: var(--accent-soft); }
  :root:not([data-theme="light"]) .tickind.gray { background: #26262e; }
  :root:not([data-theme="light"]) .unfold, :root:not([data-theme="light"]) .fold-btn { background: #26262e; }
  :root:not([data-theme="light"]) .etf.btc .hit { color: #fbbf24; }
}

/* ===== modo oscuro forzado (tema manual) ===== */
:root[data-theme="dark"] {
  --bg: #121216; --card: #1b1b21; --ink: #e8e6e1; --muted: #9a9aa6; --line: #2b2b33;
  --accent: #3b82f6; --accent-soft: #1e2a4a; --green: #4ade80; --green-soft: #14321f;
  --orange: #fb923c; --orange-soft: #3a2412; --red: #f87171; --red-soft: #3b1717;
  --purple: #a78bfa; --purple-soft: #2a2140; --neutral: #4b4b55; --feed-bg: #16161b;
}
:root[data-theme="dark"] .pill.gray, :root[data-theme="dark"] .chip, :root[data-theme="dark"] .stepper-h li, :root[data-theme="dark"] .stepper-v .dot { background: #26262e; }
:root[data-theme="dark"] .ticket, :root[data-theme="dark"] .now-kv, :root[data-theme="dark"] .login-card input { background: #16161b; }
:root[data-theme="dark"] .ticket.ready { background: #14321f; }
:root[data-theme="dark"] .tbl.excel th, :root[data-theme="dark"] .tbl.excel tr:nth-child(even) td { background: #202027; }
:root[data-theme="dark"] .btn { background: #26262e; color: var(--ink); }
:root[data-theme="dark"] .filters select { background: #26262e; color: var(--ink); }
:root[data-theme="dark"] .odds-bar, :root[data-theme="dark"] .gauge .bar { background: #2b2b33; }
:root[data-theme="dark"] .foot { color: var(--muted); }
:root[data-theme="dark"] .tf { background: rgba(255,255,255,.07); }
:root[data-theme="dark"] .tf button.active { background: #2a2a33; color: #93c5fd; }
:root[data-theme="dark"] .op-row .chip { background: #16161b; }
:root[data-theme="dark"] .acct .kpi .bar { background: #2b2b33; }
:root[data-theme="dark"] .kvg div, :root[data-theme="dark"] .etf.sel, :root[data-theme="dark"] .op-row .chip { background: #16161b; }
:root[data-theme="dark"] .etf.sel { background: var(--accent-soft); }
:root[data-theme="dark"] .tickind.gray { background: #26262e; }
:root[data-theme="dark"] .unfold, :root[data-theme="dark"] .fold-btn { background: #26262e; }
:root[data-theme="dark"] .etf.btc .hit { color: #fbbf24; }

/* ===================== tema manual ===================== */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 4px 10px 4px 6px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; line-height: 1; }
.theme-btn .ico { width: 16px; height: 16px; border-radius: 50%; display: inline-block; position: relative; background: radial-gradient(circle at 50% 50%, #f59e0b 0 4px, transparent 5px), conic-gradient(from 0deg, #f59e0b 0 10%, transparent 10% 25%, #f59e0b 25% 35%, transparent 35% 50%, #f59e0b 50% 60%, transparent 60% 75%, #f59e0b 75% 85%, transparent 85%); }
.theme-btn.is-dark .ico { background: #c7d2fe; box-shadow: inset -5px -3px 0 0 var(--card); }
.theme-btn[data-theme="system"] .ico { opacity: .75; }
.theme-btn:hover { color: var(--ink); }
@media (max-width: 768px) { .theme-btn .lbl { display: none; } .theme-btn { padding: 5px; } }

/* ===================== ⑤ enlace al Time Machine ===================== */
.tm-open { margin-top: 8px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; width: 100%; display: flex; justify-content: space-between; align-items: center; transition: transform .15s ease, box-shadow .15s ease; }
.tm-open:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(29,78,216,.18); }

/* ===================== ⑥ Operación: feed debajo de los números ===================== */
.op-feed { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.op-feed .feed { max-height: 280px; overflow-y: auto; }
@media (max-width: 768px) { .op-feed .feed { max-height: 320px; } }

/* ===================== ⑥ Time Machine · escena ===================== */
#sub-timemachine { padding: 10px; }
.tm-scene { position: relative; }
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tm-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tm-title b { font-size: 15px; }
.tm-title span { font-size: 12px; }
.tm-stage { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tm-fan { height: 400px; min-height: 400px; max-height: 400px; }
.tm-fan, .tm-side > div { background: var(--feed-bg); border: 1px solid var(--line); border-radius: 12px; position: relative; overflow: hidden; }
.tm-fan::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.10) 100%); }
.tm-fan::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .06 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>"); }
.tm-fan canvas, .tm-hist canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
.tm-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.tm-hist { height: 210px; min-height: 210px; max-height: 210px; }
.tm-counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tm-c { padding: 10px 12px; border-radius: 12px; background: var(--feed-bg); border: 1px solid var(--line); }
.tm-c .v { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; }
.tm-c .l { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.tm-c.green .v { color: var(--green); } .tm-c.red .v { color: var(--red); } .tm-c.gray .v { color: var(--muted); } .tm-c.blue .v { color: var(--accent); }
.tm-hist { padding: 8px 8px 6px; display: flex; flex-direction: column; min-height: 0; }
.tm-hist .h5 { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.tm-hist canvas { flex: 1 1 auto; min-height: 0; }
.tm-verdict { position: absolute; left: 10px; right: 64px; bottom: 26px; z-index: 3; padding: 10px 12px; border-radius: 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.tm-verdict.show { opacity: 1; transform: none; }
.tm-vtext { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tm-vtext span { display: inline-block; margin-right: .28em; }
.tm-vhist { font-size: 11.5px; margin-top: 4px; }
.tm-vnote { font-size: 11px; margin-top: 2px; }
.tm-stats { margin-top: 4px; grid-template-columns: 1fr; font-size: 12.5px; }
.tm-below { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tm-odds, .tm-statsbox { background: var(--feed-bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tm-odds .h5, .tm-statsbox .h5 { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.tm-odds .verdict.small { margin-top: 8px; }
.tm-line { font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.tm-line b { font-weight: 800; }
.tm-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 170px; max-width: 240px; }
.tm-tip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.tm-tip .k { color: var(--muted); }
.tm-tip .g { color: var(--green); } .tm-tip .r { color: var(--red); } .tm-tip .a { color: var(--accent); }
.tm-fan canvas, .tm-hist canvas { cursor: crosshair; touch-action: none; }
@media (max-width: 900px) { .tm-below { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tm-fan { height: 360px; } .tm-side { grid-template-columns: 1fr; } .tm-hist { height: 170px; } }
@media (max-width: 480px) { .tm-fan { height: 300px; } .tm-c .v { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .tm-verdict { transition: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tm-fan::after { mix-blend-mode: screen; opacity: .22; } :root:not([data-theme="light"]) .tm-fan::before { background: radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(0,0,0,.45) 100%); } }
:root[data-theme="dark"] .tm-fan::after { mix-blend-mode: screen; opacity: .22; }
:root[data-theme="dark"] .tm-fan::before { background: radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(0,0,0,.45) 100%); }

/* con la pestaña Time Machine abierta, el panel ⑥ crece y el gráfico cede sitio */
.dash.active.tm-on { grid-template-rows: minmax(0, 1fr) minmax(220px, 64%); }
@media (max-width: 768px) { .dash.active.tm-on { grid-template-rows: none; } }
@media (max-width: 480px) { .tm-verdict { right: 10px; bottom: 22px; } .tm-vnote { display: none; } }
.dash.active.tm-on .candles { min-height: 150px; }
.dash.active.tm-on .chart-card { overflow: hidden; }
