:root {
  --bg: #0b0f17; --bg2: #111725; --panel: #141b2b; --panel2: #1a2336; --line: #243049;
  --text: #e6ebf5; --muted: #8b97b0; --accent: #e0a526; --accent2: #f5c451;
  --up: #26a69a; --down: #ef5350; --blue: #42a5f5; --purple: #ab47bc;
  --radius: 12px; --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0; letter-spacing: .2px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--accent2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.up { color: var(--up); } .down { color: var(--down); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px 20px;
  background: rgba(11,15,23,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-size: 18px; font-weight: 600; white-space: nowrap; }
.brand b { color: var(--accent); }
.logo { color: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .ticker::-webkit-scrollbar { display: none; }
.tabs button, .subtabs button, .chips button { background: none; border: 1px solid transparent; color: var(--muted); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.tabs button:hover, .subtabs button:hover, .chips button:hover { color: var(--text); background: var(--panel); }
.tabs button.active { color: var(--bg); background: var(--accent); }

.ticker { display: flex; gap: 22px; padding: 7px 20px; background: var(--bg2); border-bottom: 1px solid var(--line); overflow-x: auto;
  font-family: var(--mono); font-size: 12px; white-space: nowrap; scrollbar-width: none; }
.ticker span b { color: var(--muted); font-weight: 400; margin-right: 6px; }

main { max-width: 1480px; margin: 0 auto; padding: 20px; }
.tab { display: none; } .tab.active { display: block; }
.sub { display: none; } .sub.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head p { margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 > .panel, .grid-3 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
select, input, textarea { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
select:focus, input:focus, textarea:focus { outline: 1px solid var(--accent); }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #1a1200; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent2); }
.btn:disabled { opacity: .5; cursor: wait; }
.icon { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; }
.icon:hover { color: var(--text); }

/* listas de noticias */
.list { display: flex; flex-direction: column; gap: 10px; max-height: 1100px; overflow-y: auto; padding-right: 4px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card .title { font-weight: 600; margin: 4px 0; }
.card .summary { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.note { border-left: 3px solid var(--accent); background: rgba(224,165,38,.07); padding: 8px 10px; border-radius: 0 8px 8px 0; font-size: 13px; margin-top: 8px; }
.note .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent2); font-weight: 600; margin-right: 6px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--bg2); }
.chip.High, .chip.bajista, .chip.risk-off, .chip.VENTA, .chip.BAJISTA { color: var(--down); border-color: rgba(239,83,80,.5); }
.chip.Medium { color: #ffa726; border-color: rgba(255,167,38,.5); }
.chip.Low, .chip.Holiday, .chip.neutral { color: var(--muted); }
.chip.alcista, .chip.risk-on, .chip.COMPRA, .chip.ALCISTA { color: var(--up); border-color: rgba(38,166,154,.5); }
.ccy { font-family: var(--mono); font-weight: 600; color: var(--text); }
.ev-nums { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; margin-top: 4px; }
.ev-nums span b { color: var(--muted); font-weight: 400; }
.day-sep { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent2); margin: 8px 0 0; font-weight: 600; }

/* empresas */
.selector { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.selector .grow { flex: 1; min-width: 240px; }
.macro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mini { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.mini .n { font-size: 11px; color: var(--muted); }
.mini .v { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.mini canvas { width: 100% !important; height: 28px !important; margin-top: 4px; }
.bullets { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }
.bullets li { margin: 3px 0; }
.co-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.co-head .price { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.score-ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; font-family: var(--mono); }
.bars .row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.kv div { background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
.kv div span { display: block; font-size: 11px; color: var(--muted); }
.kv div b { font-family: var(--mono); font-size: 15px; }
.chart { width: 100%; height: 380px; }
.chart.sm { height: 260px; }
.chart.xs { height: 220px; }
.canvas-wrap { position: relative; height: 260px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12px; cursor: pointer; user-select: none; white-space: nowrap; }
td.num, th.num { text-align: right; font-family: var(--mono); }
tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap { max-height: 520px; overflow: auto; }
.pros li::marker { content: "▲ "; color: var(--up); }
.cons li::marker { content: "▼ "; color: var(--down); }
.pros, .cons { padding-left: 20px; margin: 0; }
.pros li, .cons li { margin: 5px 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .n { color: var(--muted); font-size: 12px; }
.kpi .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 2px; }
.gauge { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--down), #ffa726, #ffee58, var(--up)); position: relative; margin-top: 8px; }
.gauge i { position: absolute; top: -4px; width: 4px; height: 16px; background: #fff; border-radius: 2px; }

.subtabs, .chips { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs button.active, .chips button.active { color: var(--accent2); border-color: var(--accent); background: rgba(224,165,38,.08); }

.gainers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.gainer .top { display: flex; align-items: center; gap: 10px; }
.gainer img { width: 26px; height: 26px; border-radius: 50%; }
.gainer .chg { display: flex; gap: 12px; font-family: var(--mono); font-size: 12px; margin: 6px 0; }

/* daytrading */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.board .asset { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.board .asset.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.board .asset:hover { border-color: var(--accent); }
.board .asset .s { font-weight: 700; font-family: var(--mono); }
.board .asset .p { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.bias-big { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.bias-ALCISTA { color: var(--up); } .bias-BAJISTA { color: var(--down); } .bias-NEUTRAL { color: #ffa726; }
.plan { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel2); }
.plan.COMPRA { border-left: 4px solid var(--up); } .plan.VENTA { border-left: 4px solid var(--down); }
.plan .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.plan .nums div span { display: block; font-size: 11px; color: var(--muted); }
.plan .nums div b { font-family: var(--mono); }
.levels td:first-child { font-family: var(--mono); font-weight: 600; }
.sig-bar { width: 80px; height: 6px; background: var(--bg2); border-radius: 99px; position: relative; display: inline-block; vertical-align: middle; }
.sig-bar i { position: absolute; top: 0; height: 100%; border-radius: 99px; }
.sig-bar::after { content: ""; position: absolute; left: 50%; top: -2px; width: 1px; height: 10px; background: var(--muted); }

.strat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.strat-list { position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; padding: 10px; }
.strat-list .fam { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 12px 8px 4px; }
.strat-list button { display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.strat-list button:hover { background: var(--panel2); }
.strat-list button.active { border-color: var(--accent); background: rgba(224,165,38,.08); color: var(--accent2); }
.strat-list button small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 900px) { .strat-layout { grid-template-columns: 1fr; } .strat-list { position: static; max-height: 300px; } }
.rules { padding-left: 20px; } .rules li { margin: 5px 0; }
.case { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel2); margin-top: 12px; }
.case-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 4px; }


.loading { color: var(--muted); padding: 20px; text-align: center; }
.loading::before { content: ""; display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--down); padding: 12px; }
/* ================= INTRO ================= */
.intro { position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #141d31 0%, #0b0f17 70%); cursor: pointer; }
html.intro-on .intro { display: flex; }
html.intro-on body { overflow: hidden; }
.intro-chart { width: min(760px, 92vw); height: auto; overflow: visible; }
.intro-grid line { stroke: rgba(139,151,176,.13); stroke-width: 1; stroke-dasharray: 600; stroke-dashoffset: 600; animation: introGrid 1.6s ease-out forwards; }
.intro-grid line:nth-child(n+5) { animation-delay: .25s; }
#introArrow { opacity: 0; }
.intro.running #introArrow { opacity: 1; }
.intro-brand { font-size: clamp(30px, 6vw, 52px); font-weight: 700; letter-spacing: .5px; margin-top: 8px; text-align: center;
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.intro-brand b { color: var(--accent); }
.intro-brand .logo { color: var(--accent); display: inline-block; }
.intro-brand small { display: block; font-size: clamp(13px, 1.6vw, 16px); font-weight: 400; color: var(--muted); letter-spacing: 2px; margin-top: 6px; text-transform: uppercase; }
.intro.done .intro-brand { opacity: 1; transform: none; }
.intro.done .intro-brand .logo { animation: introSpin 1.2s cubic-bezier(.2,.8,.2,1); }
.intro-skip { position: absolute; bottom: 26px; font-size: 12px; color: var(--muted); letter-spacing: 1px; opacity: .7; }
.intro.out { opacity: 0; transform: scale(1.03); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
@keyframes introGrid { to { stroke-dashoffset: 0; } }
@keyframes introSpin { from { transform: rotate(-180deg) scale(.4); } to { transform: none; } }

/* ================= PESTAÑAS ================= */
/* píldora que se desliza bajo la pestaña activa */
.tabs { position: relative; }
.tab-ind { position: absolute; top: 0; left: 0; height: 100%; width: 0; border-radius: 8px; background: var(--accent); z-index: 0;
  transition: transform .38s cubic-bezier(.3,1.3,.5,1), width .38s cubic-bezier(.3,1.3,.5,1); pointer-events: none; }
.tabs button { position: relative; z-index: 1; transition: color .25s; }
.tabs.has-ind button.active { background: transparent; color: #1a1200; }

.sh-title { display: flex; gap: 14px; align-items: center; }
.tab-icon { width: 46px; height: 46px; flex: none; overflow: visible; }
/* Noticias: radar */
.ti-news .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-origin: 24px 24px; opacity: 0; animation: tiRing 2.4s ease-out infinite; }
.ti-news .r2 { animation-delay: .8s; } .ti-news .r3 { animation-delay: 1.6s; }
.ti-news .core { fill: rgba(224,165,38,.18); stroke: var(--accent); stroke-width: 1.5; }
.ti-news .spark { fill: none; stroke: var(--accent2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: tiDraw .9s .2s ease forwards; }
/* Empresas: barras */
.ti-stocks .b { fill: var(--blue); transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: tiBar .6s cubic-bezier(.2,.8,.2,1) forwards; }
.ti-stocks .b2 { animation-delay: .1s; } .ti-stocks .b3 { animation-delay: .2s; } .ti-stocks .b4 { animation-delay: .3s; fill: var(--up); }
.ti-stocks .trend { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: tiDraw .7s .55s ease forwards; }
/* Crypto: moneda */
.ti-crypto .coin { transform-box: fill-box; transform-origin: center; animation: tiCoin 1.1s cubic-bezier(.2,.8,.2,1), tiFloat 3s 1.1s ease-in-out infinite; }
.ti-crypto .edge { fill: #b27c10; } .ti-crypto .face { fill: var(--accent); }
.ti-crypto text { fill: #3d2a00; font: 700 17px var(--sans); }
/* Daytrading: escalera con flecha */
.ti-dt .step { fill: none; stroke: var(--up); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 90; stroke-dashoffset: 90; animation: tiDraw 1.4s cubic-bezier(.45,.05,.55,.95) forwards; }
.ti-dt .arrow { fill: var(--accent2); offset-path: path("M5 40 H13 V32 H19 V35 H25 V24 H31 V27 H36 V14 H43"); offset-rotate: auto; offset-distance: 0%;
  animation: tiArrow 1.4s cubic-bezier(.45,.05,.55,.95) forwards; }
@keyframes tiRing { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes tiDraw { to { stroke-dashoffset: 0; } }
@keyframes tiBar { to { transform: scaleY(1); } }
@keyframes tiCoin { from { transform: rotateY(540deg) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tiFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes tiArrow { to { offset-distance: 100%; } }

/* entrada escalonada del contenido (las animaciones se reinician al mostrar la pestaña) */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes fromRight { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.86); } 70% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) rotateX(35deg); } to { opacity: 1; transform: none; } }
.tab.active .section-head { animation: fromLeft .5s cubic-bezier(.2,.8,.2,1) both; }
.tab.active > .panel, .tab.active > .grid-2, .tab.active > .subtabs, .tab.active .sub.active > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
.tab.active > :nth-child(2) { animation-delay: .06s; } .tab.active > :nth-child(3) { animation-delay: .12s; }
.tab.active > :nth-child(4) { animation-delay: .18s; } .tab.active > :nth-child(5) { animation-delay: .24s; }
#tab-news.active .list .card { animation: fromRight .45s cubic-bezier(.2,.8,.2,1) both; }
#tab-stocks.active .mini { animation: pop .5s cubic-bezier(.2,.8,.2,1) both; }
#tab-crypto.active .kpi { animation: drop .55s cubic-bezier(.2,.8,.2,1) both; }
#tab-crypto.active .gainer { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
#tab-daytrading.active .board .asset { animation: pop .45s cubic-bezier(.2,.8,.2,1) both; }
#tab-daytrading.active .strat-list button { animation: fromLeft .4s cubic-bezier(.2,.8,.2,1) both; }
#company > .panel, #company > .grid-2, #dtDetail > *, #cryptoFocus > *, #stratBody > *, #histBody > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
/* retrasos escalonados para listas y rejillas */
.list .card:nth-child(2), .macro-grid .mini:nth-child(2), .kpis .kpi:nth-child(2), .gainers .gainer:nth-child(2), .board .asset:nth-child(2), .strat-list > :nth-child(2) { animation-delay: .04s; }
.list .card:nth-child(3), .macro-grid .mini:nth-child(3), .kpis .kpi:nth-child(3), .gainers .gainer:nth-child(3), .board .asset:nth-child(3), .strat-list > :nth-child(3) { animation-delay: .08s; }
.list .card:nth-child(4), .macro-grid .mini:nth-child(4), .kpis .kpi:nth-child(4), .gainers .gainer:nth-child(4), .board .asset:nth-child(4), .strat-list > :nth-child(4) { animation-delay: .12s; }
.list .card:nth-child(5), .macro-grid .mini:nth-child(5), .kpis .kpi:nth-child(5), .gainers .gainer:nth-child(5), .board .asset:nth-child(5), .strat-list > :nth-child(5) { animation-delay: .16s; }
.list .card:nth-child(6), .macro-grid .mini:nth-child(6), .kpis .kpi:nth-child(6), .gainers .gainer:nth-child(6), .board .asset:nth-child(6), .strat-list > :nth-child(6) { animation-delay: .2s; }
.list .card:nth-child(7), .macro-grid .mini:nth-child(7), .gainers .gainer:nth-child(7), .board .asset:nth-child(7), .strat-list > :nth-child(7) { animation-delay: .24s; }
.list .card:nth-child(8), .macro-grid .mini:nth-child(8), .gainers .gainer:nth-child(8), .board .asset:nth-child(8), .strat-list > :nth-child(8) { animation-delay: .28s; }
.list .card:nth-child(n+9), .macro-grid .mini:nth-child(n+9), .gainers .gainer:nth-child(n+9), .board .asset:nth-child(n+9), .strat-list > :nth-child(n+9) { animation-delay: .32s; }
#company > :nth-child(2), #dtDetail > :nth-child(2), #cryptoFocus > :nth-child(2), #stratBody > :nth-child(2), #histBody > :nth-child(2) { animation-delay: .07s; }
#company > :nth-child(n+3), #dtDetail > :nth-child(n+3), #cryptoFocus > :nth-child(n+3), #stratBody > :nth-child(n+3), #histBody > :nth-child(n+3) { animation-delay: .14s; }
/* el refresco automático no repite animaciones */
.no-anim, .no-anim * { animation: none !important; }
.no-anim .ti-news .ring { animation: tiRing 2.4s ease-out infinite !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.intro-on .intro { display: none; }
  .ti-dt .step, .ti-news .spark, .ti-stocks .trend { stroke-dashoffset: 0; }
  .ti-stocks .b { transform: none; }
  .ti-dt .arrow { offset-distance: 100%; }
}

/* estado del plan del día */
.plan-status { font-size: 12.5px; margin: 8px 0 2px; padding: 5px 9px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); }
.plan-status.st-pending { color: var(--muted); }
.plan-status.st-triggered { color: #90caf9; border-color: rgba(66,165,245,.5); }
.plan-status.st-target { color: var(--up); border-color: rgba(38,166,154,.5); }
.plan-status.st-stopped { color: var(--down); border-color: rgba(239,83,80,.5); }
.plan-status.st-missed { color: #ffb74d; border-color: rgba(255,167,38,.45); }
.live-dot { color: var(--up); margin-left: 6px; font-weight: 600; }

/* selector de idioma */
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.lang-switch button { background: none; border: none; color: var(--muted); font: 600 12px var(--mono); padding: 6px 10px; cursor: pointer; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--accent); color: #1a1200; }
.legal-page .tabs { gap: 8px; }

/* legal: barra de riesgo, avisos en contexto, pie y páginas legales */
body { padding-bottom: 34px; }
.risk-bar { background: #2a1d05; border-bottom: 1px solid #5c4210; color: #f5d38a; font-size: 12.5px; padding: 6px 20px; text-align: center; }
.risk-bar a { color: #ffe3a3; text-decoration: underline; }
.risk-bar.fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-bottom: none; border-top: 1px solid #5c4210; }
.inline-warn { background: rgba(224,165,38,.08); border: 1px solid rgba(224,165,38,.35); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; color: #e9d3a0; margin: 0 0 12px; }
.inline-warn a { color: var(--accent2); }
.site-footer { max-width: 1480px; margin: 30px auto 0; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-footer nav a { color: var(--text); }
.site-footer p { margin: 6px 0; }
.risk-modal { max-width: 640px; }
.risk-modal ul { padding-left: 20px; } .risk-modal li { margin: 6px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.legal-page .brand { color: var(--text); text-decoration: none; }
.legal-page .tabs { justify-content: flex-end; }
.legal { max-width: 860px; margin: 0 auto; padding: 24px 20px; line-height: 1.7; }
.legal h1 { font-size: 26px; margin-top: 10px; }
.legal h2 { font-size: 17px; margin: 26px 0 8px; color: var(--accent2); }
.legal table { margin: 10px 0; font-size: 13px; }
.legal td, .legal th { vertical-align: top; }
.legal ul { padding-left: 22px; }
.risk-box { background: #2a1d05; border: 1px solid #5c4210; border-radius: 10px; padding: 14px 18px; color: #f5d38a; }
mark.todo { background: #5c1a1a; color: #ffb4b4; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.todo-banner { background: #5c1a1a; color: #ffd6d6; border: 1px solid #a33; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }

/* widget de gráfico: temporalidad + pantalla completa */
.cw { display: flex; flex-direction: column; min-width: 0; }
/* sin esto, un gráfico que creció en pantalla completa impide que su columna vuelva a encogerse */
.grid-2 > *, .grid-3 > *, .panel, .cw-area { min-width: 0; }
.cw-area { overflow: hidden; }
body.fs-lock { overflow: hidden; }
.cw-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cw-title { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 120px; }
.cw-title h2, .cw-title h3 { margin: 0; }
.cw-tfs { display: flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; flex-wrap: wrap; }
.cw-tfs button { background: none; border: none; color: var(--muted); font: 600 12px var(--mono); padding: 4px 9px; border-radius: 6px; cursor: pointer; }
.cw-tfs button:hover { color: var(--text); }
.cw-tfs button.active { background: var(--accent); color: #1a1200; }
.cw-fs { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 32px; height: 30px; cursor: pointer; font-size: 15px; }
.cw-fs:hover { color: var(--accent2); border-color: var(--accent); }
.cw-fs.exit { width: auto; padding: 0 12px; font: 600 13px var(--sans); color: #1a1200; background: var(--accent); border-color: var(--accent); }
.cw-area { position: relative; width: 100%; }
.cw-area .loading { padding-top: 60px; }
.cw-foot { margin-top: 6px; }
.cw:fullscreen, .cw.fs-fallback { background: var(--bg); padding: 16px 20px; }
.cw.fs-fallback { position: fixed; inset: 0; z-index: 100; }
.cw:fullscreen .cw-area, .cw.fs-fallback .cw-area { flex: 1; height: auto !important; min-height: 0; }
.cw:fullscreen .cw-fs, .cw.fs-fallback .cw-fs { color: var(--accent2); border-color: var(--accent); }
.mini.clickable { cursor: pointer; }
.mini.clickable:hover { border-color: var(--accent); }
.mini .zoom { float: right; color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.65); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(1200px, 100%); padding: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
