:root {
  --bg: #0b0d12;
  --panel: #12151c;
  --panel-2: #181c25;
  --line: #242a36;
  --text: #e7e9ee;
  --muted: #8a93a6;
  --gold: #d4a537;
  --gold-2: #f0c75e;
  --up: #22c55e;
  --up-bg: rgba(34, 197, 94, .12);
  --down: #ef4444;
  --down-bg: rgba(239, 68, 68, .12);
  --neutral: #94a3b8;
  --neutral-bg: rgba(148, 163, 184, .12);
  --high: #ef4444;
  --med: #f59e0b;
  --low: #64748b;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(212, 165, 55, .08), transparent 60%);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px;
  background: rgba(11, 13, 18, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 17px; letter-spacing: .2px; }
.brand small { color: var(--muted); font-size: 11.5px; }
.logo.nq { background: linear-gradient(145deg, #93c5fd, #3b82f6); color: #0b1530; box-shadow: 0 0 18px rgba(59, 130, 246, .35); }
.logo.sp { background: linear-gradient(145deg, #c4b5fd, #7c3aed); color: #1a0b38; box-shadow: 0 0 18px rgba(124, 58, 237, .35); }
.logo.dj { background: linear-gradient(145deg, #94a3b8, #475569); color: #0b1220; box-shadow: 0 0 18px rgba(71, 85, 105, .35); }
.logo.btc { background: linear-gradient(145deg, #fdba74, #f97316); color: #2a1203; box-shadow: 0 0 18px rgba(249, 115, 22, .35); font-size: 17px; }
.logo {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #1a1305; font-weight: 800; font-size: 14px;
  box-shadow: 0 0 18px rgba(212, 165, 55, .35);
}
.label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.price-box { display: flex; flex-direction: column; }
.price { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--gold-2); transition: color .4s; }
.price.tick-up { color: var(--up); }
.price.tick-down { color: var(--down); }
.price-change { font-size: 11px; color: var(--muted); }
.clocks { display: flex; gap: 20px; flex-wrap: wrap; }
.clocks .mono { font-size: 15px; }
.session { font-size: 13px; font-weight: 600; color: var(--gold-2); }
.actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color .2s, background .2s, opacity .2s;
}
.btn:hover { border-color: #3a4252; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px 11px; }
.btn.gold { background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: #1a1305; border-color: transparent; }
.btn.gold:hover { filter: brightness(1.07); }
.btn.full { width: 100%; margin-top: 10px; }

/* ---------- Risk banner ---------- */
.risk-banner {
  margin: 14px 24px 0; padding: 12px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 12px; font-weight: 600;
  border: 1px solid;
}
.risk-banner.warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .45); color: #fcd34d; }
.risk-banner.danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .55); color: #fca5a5; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); } }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px;
  padding: 18px 24px; max-width: 1500px; margin: 0 auto;
}
.col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head.wrap { flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 15.5px; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.tag {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; vertical-align: middle;
  background: rgba(212, 165, 55, .15); color: var(--gold-2); letter-spacing: .05em;
}

/* ---------- Brief ---------- */
.brief { border-color: rgba(212, 165, 55, .35); }
.bias-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.bias {
  font-size: 26px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 12px;
}
.bias.alcista { color: var(--up); background: var(--up-bg); }
.bias.bajista { color: var(--down); background: var(--down-bg); }
.bias.neutral, .bias.mixto { color: var(--neutral); background: var(--neutral-bg); }
.confidence { display: flex; flex-direction: column; gap: 4px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--gold); }
.brief-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.brief-summary { color: #cfd4de; margin: 0 0 14px; }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.brief-box h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.brief-box ul { margin: 0; padding-left: 18px; }
.brief-box li { margin: 4px 0; color: #cfd4de; }
.brief-box.up h3 { color: var(--up); }
.brief-box.down h3 { color: var(--down); }
.brief-box.events h3 { color: var(--gold-2); }
.brief-box.scalp h3 { color: #93c5fd; }
.empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.empty p { margin: 0 0 12px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block; vertical-align: middle;
  border: 2px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #fca5a5; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.chip.active { color: #1a1305; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.filter-row { display: flex; gap: 8px; }
input, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 11px; border-radius: 10px; font: inherit; min-width: 0;
}
.filter-row input { flex: 1; }
input:focus, select:focus { outline: 1px solid var(--gold); }

/* ---------- News ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item {
  display: grid; grid-template-columns: 4px 1fr; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.news-item:first-child { border-top: 0; }
.news-item .bar { border-radius: 2px; background: var(--line); }
.news-item.alcista .bar { background: var(--up); }
.news-item.bajista .bar { background: var(--down); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.news-title { font-weight: 600; text-decoration: none; line-height: 1.4; }
.news-title:hover { color: var(--gold-2); }
.news-summary { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.news-ai { margin-top: 6px; font-size: 13px; color: #d7dbe4; background: var(--panel-2); border-left: 2px solid var(--gold); padding: 6px 10px; border-radius: 0 8px 8px 0; }
.pill { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.pill.alcista { color: var(--up); background: var(--up-bg); }
.pill.bajista { color: var(--down); background: var(--down-bg); }
.pill.neutral { color: var(--neutral); background: var(--neutral-bg); }
.pill.alto { color: #fca5a5; background: var(--down-bg); }
.pill.medio { color: #fcd34d; background: rgba(245, 158, 11, .12); }
.pill.bajo { color: var(--neutral); background: var(--neutral-bg); }
.pill.auto { opacity: .7; font-weight: 600; }
.src { color: var(--gold-2); font-weight: 600; }

/* ---------- Next event ---------- */
.next-card { border-color: rgba(239, 68, 68, .3); }
.next-card .label { margin-bottom: 4px; }
.next-title { font-size: 15px; font-weight: 700; margin: 2px 0 4px; }
.countdown { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--gold-2); }
.next-note { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* ---------- Calendar ---------- */
.toggle { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { accent-color: var(--gold); }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin-bottom: 12px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 4px; border-radius: 7px; cursor: pointer; }
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 0 var(--line); }
.cal-body { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.day-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); margin: 12px 0 4px; font-weight: 700; }
.day-head:first-child { margin-top: 0; }
.ev {
  display: grid; grid-template-columns: 78px 10px minmax(0, 1fr); gap: 8px; align-items: start;
  padding: 8px 6px; border-radius: 8px; cursor: pointer;
}
.ev:hover { background: var(--panel-2); }
.ev.past { opacity: .5; }
.ev.next { background: rgba(212, 165, 55, .1); outline: 1px solid rgba(212, 165, 55, .35); }
.ev-time { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.imp { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; }
.imp.High { background: var(--high); }
.imp.Medium { background: var(--med); }
.imp.Low, .imp.Holiday { background: var(--low); }
.ev-title { font-weight: 600; font-size: 13px; }
.ev-cur { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-right: 6px; }
.ev-vals { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.ev-vals b { color: var(--text); }
.ev-note { font-size: 12px; color: #cbd2de; margin-top: 4px; display: none; }
.ev-more { font-size: 11.5px; color: var(--gold-2); margin-top: 2px; }
.ev-sub { display: none; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.ev.open .ev-sub { display: block; }
.ev-sub div { font-size: 12.5px; padding: 3px 0; }
.ev-sub .ev-vals { margin-top: 0; }
.tag-est { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }
.ev.open .ev-note { display: block; }
.cal-status { margin: 10px 0 0; }
.fomc-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fomc-row.past { opacity: .45; }
.fomc-row.next { color: var(--gold-2); font-weight: 700; }
.fomc-row .badge { font-size: 10.5px; color: #93c5fd; margin-left: 6px; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 16px 0 6px; }
.fed-item { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fed-item a { text-decoration: none; }
.fed-item a:hover { color: var(--gold-2); }

/* ---------- Footer & dialog ---------- */
.footer { max-width: 1500px; margin: 0 auto; padding: 8px 24px 30px; font-size: 11.5px; color: var(--muted); }
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  width: min(520px, calc(100vw - 32px)); padding: 22px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin: 0 0 14px; font-size: 17px; }
dialog h3 { font-size: 13px; margin: 18px 0 6px; color: var(--muted); }
dialog label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.sources-list { list-style: none; padding: 0; margin: 0; font-size: 12.5px; max-height: 180px; overflow: auto; }
.sources-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ok { color: var(--up); }
.bad { color: var(--down); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { order: -1; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .clocks { gap: 12px; width: 100%; order: 3; }
  .actions { margin-left: auto; }
  .layout { padding: 14px 16px; }
  .risk-banner { margin: 12px 16px 0; }
  .brief-grid { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }
  .footer { padding: 8px 16px 24px; }
  .bias { font-size: 21px; }
}

/* =========================================================
   Modo simple: semáforo, línea del día, semana
   ========================================================= */
[hidden] { display: none !important; }
:root {
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, .14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, .14);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, .12);
  --gray: #64748b;
  --gray-bg: rgba(100, 116, 139, .14);
}
.simple { max-width: 1240px; margin: 0 auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.simple > .layout { padding: 0; max-width: none; width: 100%; }

/* Selector de activo */
.asset-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.asset-tab {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  color: var(--muted); font: inherit; transition: border-color .2s, background .2s, color .2s;
}
.asset-tab b { display: block; font-size: 15px; color: var(--text); }
.asset-tab small { font-size: 12px; }
.asset-tab:hover { border-color: #3a4252; }
.asset-tab.active { border-color: var(--gold); background: rgba(212, 165, 55, .08); color: var(--gold-2); }
.asset-tab > span:nth-child(2) { min-width: 0; }
.asset-tab b, .asset-tab small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-dot { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; background: var(--line); flex-shrink: 0; }
.tab-dot.rojo { background: var(--red); box-shadow: 0 0 8px var(--red); }
.tab-dot.amarillo { background: var(--amber); }
.tab-dot.verde { background: var(--green); }
.tab-dot.gris { background: var(--gray); }
.settings-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.settings-group legend { font-size: 13px; padding: 0 4px; }
.move-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.move-alerts label { margin: 0; font-size: 12px; gap: 4px; }
.brief-assets { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.brief-assets label { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.brief-assets input { accent-color: var(--gold); }
.asset-ico {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: #1a1305; font-weight: 800; font-size: 12.5px;
}
.asset-ico.nq { background: linear-gradient(145deg, #93c5fd, #3b82f6); color: #0b1530; }
.asset-ico.sp { background: linear-gradient(145deg, #c4b5fd, #7c3aed); color: #1a0b38; }
.asset-ico.dj { background: linear-gradient(145deg, #94a3b8, #475569); color: #0b1220; }
.asset-ico.btc { background: linear-gradient(145deg, #fdba74, #f97316); color: #2a1203; font-size: 16px; }

/* Semáforo */
.light {
  display: flex; gap: 22px; align-items: center;
  border-radius: 18px; padding: 22px 26px; border: 1px solid;
  transition: background .4s, border-color .4s;
}
.light.verde { background: var(--green-bg); border-color: rgba(34, 197, 94, .45); }
.light.amarillo { background: var(--amber-bg); border-color: rgba(245, 158, 11, .5); }
.light.rojo { background: var(--red-bg); border-color: rgba(239, 68, 68, .6); animation: pulse 2.4s infinite; }
.light.gris { background: var(--gray-bg); border-color: rgba(100, 116, 139, .5); }
.light-lamp {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; flex-shrink: 0;
  background: #07080b; border-radius: 16px; border: 1px solid var(--line);
}
.light-lamp span { width: 34px; height: 34px; border-radius: 50%; background: #1b1f28; transition: background .3s, box-shadow .3s; }
.light.rojo .light-lamp span:nth-child(1) { background: var(--red); box-shadow: 0 0 22px var(--red); }
.light.amarillo .light-lamp span:nth-child(2) { background: var(--amber); box-shadow: 0 0 22px var(--amber); }
.light.verde .light-lamp span:nth-child(3) { background: var(--green); box-shadow: 0 0 22px var(--green); }
.light-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.light-q { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.light h2 { margin: 0; font-size: 30px; line-height: 1.15; text-wrap: balance; }
.light.verde h2 { color: #86efac; }
.light.amarillo h2 { color: #fcd34d; }
.light.rojo h2 { color: #fca5a5; }
.light p { margin: 2px 0 0; font-size: 15.5px; color: #d7dbe4; max-width: 70ch; }
.light-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; margin-top: 8px; }
.light-count { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); }
.light-next { font-size: 13px; color: var(--muted); }
.light-count:empty, .light-next:empty { display: none; }

.simple-grid {
  display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "day urgent" "day price" "week week";
  align-items: start;
}
.area-day { grid-area: day; } .area-urgent { grid-area: urgent; } .area-price { grid-area: price; }
.area-week { grid-area: week; }

/* Línea del día */
.timeline { position: relative; height: 34px; border-radius: 9px; background: var(--green); margin-top: 18px; }
.timeline.gris { background: var(--gray); }
.seg { position: absolute; top: 0; bottom: 0; }
.seg.rojo { background: var(--red); }
.seg.amarillo { background: var(--amber); }
.now-mark { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--bg); }
.now-mark::after { content: "ahora"; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text); }
.timeline-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.blocks { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.blocks li { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 14px; }
.blocks li.past { opacity: .45; }
.blocks .when { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.blocks .what small { color: var(--muted); display: block; font-size: 12px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.sw.rojo { background: var(--red); } .sw.amarillo { background: var(--amber); } .sw.verde { background: var(--green); } .sw.gris { background: var(--gray); }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* Noticias urgentes y precio */
.state-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.state-pill.rojo { color: #fca5a5; background: var(--red-bg); }
.state-pill.amarillo { color: #fcd34d; background: var(--amber-bg); }
.state-pill.verde { color: #86efac; background: var(--green-bg); }
.state-pill.gris { color: #cbd5e1; background: var(--gray-bg); }
.urgent-item { padding: 10px 0; border-top: 1px solid var(--line); }
.urgent-item:first-of-type { border-top: 0; padding-top: 0; }
.urgent-item a { font-weight: 600; text-decoration: none; }
.urgent-item a:hover { color: var(--gold-2); }
.calm { color: var(--muted); font-size: 13.5px; margin: 0; }
.big-number { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.spark { width: 100%; height: 64px; display: block; margin-top: 8px; }
.spark .line { fill: none; stroke: var(--gold-2); stroke-width: 2; }
.spark .area { fill: rgba(212, 165, 55, .12); stroke: none; }
.spark text { fill: var(--muted); font-size: 10px; font-family: var(--mono); }

/* Semana */
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.day {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; cursor: pointer;
  background: var(--panel-2); color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.day b { font-size: 13px; text-transform: capitalize; }
.day span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.day.rojo { background: var(--red-bg); border-color: rgba(239, 68, 68, .45); }
.day.rojo span { color: #fca5a5; }
.day.amarillo { background: var(--amber-bg); border-color: rgba(245, 158, 11, .45); }
.day.amarillo span { color: #fcd34d; }
.day.verde { background: var(--green-bg); border-color: rgba(34, 197, 94, .35); }
.day.verde span { color: #86efac; }
.day.sel { outline: 2px solid var(--gold); }
.day:focus-visible, .btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* IA */
.risk-level { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 14px; border-radius: 10px; display: inline-block; }
.risk-level.bajo { color: #86efac; background: var(--green-bg); }
.risk-level.medio { color: #fcd34d; background: var(--amber-bg); }
.risk-level.alto, .risk-level.muy-alto { color: #fca5a5; background: var(--red-bg); }
.ai-section { margin-top: 12px; }
.ai-section h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ai-section ul { margin: 0; padding-left: 18px; }
.ai-section li { margin: 4px 0; color: #cfd4de; }
.tip { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: #d7dbe4; }

.details-toggle { font-size: 14px; padding: 12px; margin-top: 0; }
.news-item.alto .bar { background: var(--red); }
.news-item.medio .bar { background: var(--amber); }
.btn.on { border-color: var(--gold); color: var(--gold-2); }

@media (max-width: 1100px) {
  .asset-tabs { display: flex; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory;
                scrollbar-width: thin; scrollbar-color: var(--line) transparent; color-scheme: dark; }
  .asset-tab { flex: 0 0 auto; min-width: 150px; scroll-snap-align: start; }
}
@media (max-width: 960px) {
  .topbar { position: static; }
  .simple-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "day" "urgent" "price" "week"; }
}
@media (max-width: 640px) {
  .simple { padding: 14px 16px; }
  .light { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
  .light-lamp { flex-direction: row; }
  .light-lamp span { width: 26px; height: 26px; }
  .light h2 { font-size: 24px; }
  .week { gap: 5px; }
  .day { padding: 8px 2px; }
  .day span { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .light.rojo, .risk-banner.danger { animation: none; }
}
