:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f1f3f6; --text: #111827; --muted: #6b7280;
  --line: #e5e7eb; --accent: #2563eb; --yes: #059669; --no: #dc2626; --hold: #6b7280;
  --shock: #f59e0b; --news: #7c3aed; --market: #94a3b8; --model: #2563eb; --brand: #f97316;
  --yes-bg: #ecfdf5; --no-bg: #fef2f2; --hold-bg: #f3f4f6; --shock-bg: #fffbeb;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --panel: #121826; --panel-2: #182032; --text: #e5e7eb; --muted: #94a3b8;
    --line: #243045; --accent: #60a5fa; --yes: #34d399; --no: #f87171; --hold: #94a3b8;
    --shock: #fbbf24; --news: #a78bfa; --market: #64748b; --model: #60a5fa;
    --yes-bg: #052e22; --no-bg: #3a1212; --hold-bg: #1f2937; --shock-bg: #3a2a06;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --panel: #121826; --panel-2: #182032; --text: #e5e7eb; --muted: #94a3b8;
  --line: #243045; --accent: #60a5fa; --yes: #34d399; --no: #f87171; --hold: #94a3b8;
  --shock: #fbbf24; --news: #a78bfa; --market: #64748b; --model: #60a5fa;
  --yes-bg: #052e22; --no-bg: #3a1212; --hold-bg: #1f2937; --shock-bg: #3a2a06;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 17px; } h2 { font-size: 15px; } h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sub { margin: 0; color: var(--muted); font-size: 12px; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hold); }
.conn.ok .dot { background: var(--yes); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yes) 25%, transparent); }
.conn.bad .dot { background: var(--no); }

/* pipeline */
.pipeline { padding: 14px 20px 0; }
.pipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.svc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); position: relative; }
.svc .name { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.svc .name i { width: 7px; height: 7px; border-radius: 50%; background: var(--yes); display: inline-block; }
.svc.down .name i { background: var(--no); }
.svc .role { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.svc .kv { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.svc .kv span:first-child { color: var(--muted); }
.svc .arrow { position: absolute; right: -9px; top: 50%; color: var(--muted); font-size: 12px; transform: translateY(-50%); z-index: 1; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 16px 20px 40px; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
.events, .feed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 1px solid transparent; background: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.tabs button span { font-size: 11px; opacity: .8; margin-left: 2px; }
.tabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--line); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=search], select, input[type=password] { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
input[type=search] { width: 200px; max-width: 100%; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* table */
.table-wrap { overflow-x: auto; }
.ev-table { width: 100%; border-collapse: collapse; }
.ev-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ev-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ev-table tr.row { cursor: pointer; transition: background .15s; }
.ev-table tr.row:hover { background: var(--panel-2); }
.ev-table tr.flash { animation: flash 1.6s ease-out; }
.ev-table tr.flash-shock { animation: flashShock 2.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 16%, transparent); } }
@keyframes flashShock { from { background: color-mix(in srgb, var(--shock) 35%, transparent); } }
.empty { text-align: center; color: var(--muted); padding: 40px !important; }
.t-title { font-weight: 550; max-width: 460px; }
.t-sub { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.pm { color: #2563eb; } .badge.ks { color: #059669; }
.badge.studying::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; }
.badge.shock { background: var(--shock-bg); color: var(--shock); }
@keyframes pulse { 50% { opacity: .2; } }
.sig { font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.sig.BUY_YES { background: var(--yes-bg); color: var(--yes); }
.sig.BUY_NO { background: var(--no-bg); color: var(--no); }
.sig.HOLD { background: var(--hold-bg); color: var(--hold); }
.sig.SETTLED { background: var(--panel-2); color: var(--text); }
.edge.pos { color: var(--yes); } .edge.neg { color: var(--no); }
.probs { min-width: 170px; }
.probs .nums { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.probs .nums b { font-weight: 650; }
.bar { position: relative; height: 6px; background: var(--panel-2); border-radius: 3px; }
.bar .m, .bar .p { position: absolute; top: -3px; width: 2px; height: 12px; border-radius: 1px; }
.bar .m { background: var(--market); }
.bar .p { background: var(--model); width: 3px; }
.bar .fill { position: absolute; top: 0; height: 6px; border-radius: 3px; opacity: .35; }
.news-lbl { font-size: 11px; font-weight: 600; white-space: nowrap; }
.news-lbl.YES { color: var(--yes); } .news-lbl.NO { color: var(--no); } .news-lbl.N { color: var(--muted); }

/* feed */
.feed { padding: 14px; align-self: start; position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; }
.feed ol { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; font-size: 12px; }
.feed li.shock { border-color: color-mix(in srgb, var(--shock) 60%, var(--line)); background: var(--shock-bg); }
.feed li .ft { font-weight: 550; font-size: 12.5px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed li .fm { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.feed li .fd { color: var(--muted); font-size: 11px; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 20; display: none; }
.drawer.open { display: block; }
.drawer-bg { position: absolute; inset: 0; background: rgb(0 0 0 / .35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(860px, 100%); background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 22px 24px 40px; }
.x { position: absolute; right: 14px; top: 10px; border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.d-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.d-head h2 { font-size: 19px; margin-bottom: 6px; padding-right: 30px; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 16px 0; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.stat .l { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.chart-box canvas { width: 100%; display: block; }
.legend { display: flex; gap: 12px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.lg { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: -6px; }
.lg.market { background: var(--market); } .lg.model { background: var(--model); }
.lg.shock { background: var(--shock); width: 8px; height: 8px; border-radius: 50%; }
.lg.news { background: var(--news); width: 8px; height: 8px; border-radius: 50%; }
.d-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .d-cols { grid-template-columns: 1fr; } }
.why { font-size: 13px; }
.why .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.why .row span:first-child { color: var(--muted); }
.why .rat { margin-top: 8px; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; font-size: 12.5px; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.news .nm { color: var(--muted); font-size: 11px; display: flex; gap: 8px; }
.revs { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.revs li { padding: 7px 0 7px 12px; border-left: 2px solid var(--line); font-size: 12px; position: relative; }
.revs li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--model); }
.revs li.shock::before { background: var(--shock); } .revs li.news::before { background: var(--news); }
.revs li.resolved::before { background: var(--text); }
.revs .rh { display: flex; justify-content: space-between; font-weight: 600; }
.revs .rd { color: var(--muted); }
.sim { margin-top: 22px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; }
.sim summary { cursor: pointer; font-weight: 600; }
.sim-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sim-row label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.sim button { font: inherit; font-weight: 600; background: var(--shock); color: #111; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
@media (max-width: 640px) {
  .top, .pipeline, .layout { padding-left: 16px; padding-right: 16px; }
  .sub { display: none; }
  .ev-table th:nth-child(6), .ev-table td:nth-child(6) { display: none; }
  .t-title { max-width: 220px; }
  .drawer-panel { padding: 18px 16px 40px; }
}

/* ---- RocketScience brand layer ---- */
.brand h1 { font-size: 19px; letter-spacing: -.02em; }
.brand h1 span { color: var(--brand); }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 28px 20px 8px; }
.hero h2 { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 8px; }
.hero p { color: var(--muted); margin: 0; max-width: 640px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .kv { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .kl { font-size: 12px; color: var(--muted); }
#kSignals { color: var(--yes); } #kShocks { color: var(--shock); }
.pipeline { margin: 12px 20px 0; padding: 0; }
.pipeline > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600;
  font-size: 13px; color: var(--muted); padding: 6px 0; }
.pipeline > summary::-webkit-details-marker { display: none; }
.pipeline > summary::after { content: "▸"; margin-left: 2px; transition: transform .15s; }
.pipeline[open] > summary::after { transform: rotate(90deg); }
.pipeline > summary .hint { margin: 0; font-weight: 400; }
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--yes); display: inline-block; }
.pipeline.warn .dot-ok { background: var(--no); }
.pipeline .pipe-grid { margin-top: 8px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 18px 20px 28px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 20px; } }
@media (max-width: 640px) { .hero, .foot { padding-left: 16px; padding-right: 16px; } .pipeline { margin-left: 16px; margin-right: 16px; } }

/* ---- nav, calls, track record, sign-up ---- */
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); font-size: 13px; font-weight: 550; }
.nav a:hover { color: var(--text); text-decoration: none; }
.cta { font: inherit; font-weight: 650; font-size: 13px; background: var(--brand); color: #fff; border: 0;
  border-radius: 999px; padding: 8px 16px; cursor: pointer; white-space: nowrap; }
.cta:hover { filter: brightness(1.08); }
.cta.big { font-size: 15px; padding: 12px 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 18px; }
.ghost { font-weight: 600; font-size: 14px; }
.call { font-weight: 750; font-size: 11px; padding: 3px 9px; border-radius: 6px; letter-spacing: .03em; white-space: nowrap; }
.call.YES { background: var(--yes-bg); color: var(--yes); }
.call.NO { background: var(--no-bg); color: var(--no); }
.call.NOT_SURE { background: var(--hold-bg); color: var(--hold); }
td.edge .sig { display: inline-block; margin-top: 4px; font-size: 10px; }
.track { margin: 0 20px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; }
.track-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.track-head h2 { font-size: 18px; }
.track-kpis { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 8px; }
.track-kpis .kpi { padding: 10px 12px; box-shadow: none; background: var(--panel-2); }
.track-kpis .kv { font-size: 20px; }
.wins { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
.wins li { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.w-ok { color: var(--yes); font-weight: 800; font-size: 16px; line-height: 1.2; }
.w-body a { font-weight: 600; color: var(--text); }
.w-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.ssr-wrap { padding: 0 20px 20px; color: var(--muted); font-size: 13px; }
.ssr-wrap table { width: 100%; border-collapse: collapse; }
.ssr-wrap td, .ssr-wrap th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.modal { position: fixed; inset: 0; z-index: 30; display: none; }
.modal.open { display: grid; place-items: center; }
.modal-bg { position: absolute; inset: 0; background: rgb(0 0 0 / .5); }
.modal-panel { position: relative; width: min(440px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 24px 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
.modal-panel h2 { font-size: 19px; padding-right: 24px; }
.interests { border: 0; padding: 0; margin: 12px 0 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.interests legend { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.interests label { display: flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
.gbox { display: flex; justify-content: center; min-height: 44px; margin-bottom: 6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 10px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.su-form { display: flex; gap: 8px; }
.su-form input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; }
.su-msg { min-height: 18px; font-size: 13px; margin: 10px 0 6px; color: var(--muted); }
.su-msg.ok { color: var(--yes); } .su-msg.err { color: var(--no); }
.tg-btn { display: block; text-align: center; margin-top: 8px; padding: 10px; border-radius: 10px; font-weight: 650;
  background: #229ed9; color: #fff; }
.tg-btn:hover { text-decoration: none; filter: brightness(1.08); }
.fine { font-size: 11px; color: var(--muted); margin: 12px 0 0; text-align: center; }
@media (max-width: 760px) {
  .nav a:not(.tg) { display: none; }
  .track { margin: 0 16px 20px; padding: 16px; }
  .track-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .wins { grid-template-columns: 1fr; }
  .ssr-wrap { padding: 0 16px 16px; }
}
[hidden] { display: none !important; }
