:root {
  --bg: #0a0e14;
  --panel: #111725;
  --panel-2: #0e1420;
  --line: #1e2838;
  --text: #e6edf6;
  --dim: #8a97a8;
  --accent: #38e0b0;
  --accent-2: #4c8dff;
  --pos: #35d07f;
  --neg: #ff6b6b;
  --warn: #ffb454;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(76, 141, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(56, 224, 176, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand .dim { color: var(--dim); font-weight: 500; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 0; color: var(--dim);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--text); background: var(--panel); }
.tabs button.active { color: var(--bg); background: var(--accent); }
.statusdot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.statusdot.ok { background: var(--pos); box-shadow: 0 0 10px var(--pos); }
.statusdot.bad { background: var(--neg); }

/* Layout */
main { max-width: 1080px; margin: 0 auto; padding: clamp(18px, 4vw, 34px); }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Controls */
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.controls input, .controls select {
  flex: 1 1 220px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 12px; font-size: 15px; font-family: inherit;
}
.controls input:focus, .controls select:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: transparent; }
.controls select { flex: 0 0 auto; }
button.primary {
  flex: 0 0 auto; cursor: pointer; border: 0; border-radius: 12px;
  padding: 12px 20px; font-size: 15px; font-weight: 700;
  background: linear-gradient(180deg, var(--accent), #22c79a); color: #04120d;
}
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: .5; cursor: progress; }
.hint { color: var(--dim); font-size: 13px; margin: 12px 2px 18px; line-height: 1.5; }

/* Summary line */
.summary { color: var(--dim); font-size: 13px; margin-bottom: 14px; font-family: var(--mono); }

/* Cards */
.cards { display: grid; gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .8; }
.card.risk-high::before { background: var(--neg); }
.card.risk-spec::before { background: var(--warn); }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rank { font-family: var(--mono); color: var(--dim); font-size: 13px; }
.tkr { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.cname { color: var(--dim); font-size: 14px; }
.spacer { margin-left: auto; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; }
.badge.conservative { background: rgba(53,208,127,.15); color: var(--pos); }
.badge.speculative { background: rgba(255,180,84,.15); color: var(--warn); }
.badge.high { background: rgba(255,107,107,.15); color: var(--neg); }

.scores { display: flex; gap: 18px; margin: 14px 0; flex-wrap: wrap; }
.score { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.score .lab { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.score .val { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.thesis { font-size: 14px; line-height: 1.55; color: #c9d4e2; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--dim); }
.chip.pos { color: var(--pos); border-color: rgba(53,208,127,.25); }
.chip.neg { color: var(--neg); border-color: rgba(255,107,107,.25); }
details.evidence { margin-top: 12px; }
details.evidence summary { cursor: pointer; color: var(--accent-2); font-size: 13px; font-weight: 600; }
details.evidence .ev { font-size: 12.5px; color: var(--dim); border-left: 2px solid var(--line); padding: 6px 10px; margin: 8px 0; line-height: 1.5; }

/* Results (search / signals) */
.results { display: grid; gap: 10px; }
.res {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
}
.res .meta { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.res .meta .t { color: var(--accent); font-weight: 700; }
.res .txt { font-size: 13.5px; line-height: 1.55; color: #c9d4e2; }
.sig-dir { font-weight: 700; }
.sig-dir.positive { color: var(--pos); }
.sig-dir.negative { color: var(--neg); }

/* Stat grid / about */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { font-family: var(--mono); font-size: 24px; display: block; }
.stat span { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.prose { max-width: 720px; line-height: 1.65; }
.prose h2 { letter-spacing: -0.02em; }
.disclaimer { margin-top: 24px; padding: 14px 16px; border-radius: 12px; background: rgba(255,180,84,.07); border: 1px solid rgba(255,180,84,.2); color: #d9c6a3; font-size: 12.5px; line-height: 1.6; white-space: pre-line; }

.empty { color: var(--dim); text-align: center; padding: 40px 20px; font-size: 14px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.footdisc { max-width: 1080px; margin: 30px auto 40px; padding: 0 clamp(18px,4vw,34px); color: var(--dim); font-size: 11.5px; line-height: 1.6; text-align: center; }

/* Clickable tickers */
.tlink { cursor: pointer; color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.tlink:hover { border-bottom-color: var(--accent); }
.tkr.tlink:hover { color: var(--accent); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 11, 0.72); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; z-index: 1; width: min(960px, 100%); margin: clamp(10px, 4vh, 50px) auto;
  max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #0f1522, #0b111c);
  border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(16px, 3vw, 26px); box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.dl-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.dl-head .tkr { font-size: 30px; }
.dl-price { margin-left: auto; text-align: right; }
.dl-price .p { font-family: var(--mono); font-size: 30px; font-weight: 800; }
.dl-price .sub { color: var(--dim); font-size: 12px; }
.close-x { position: sticky; top: 0; float: right; background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; }
.chartbox { margin: 18px 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.chartbox svg { display: block; width: 100%; height: auto; }
.lwchart { width: 100%; height: 320px; position: relative; }
.vp-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.lwchart.rsi { height: 130px; }
.lwchart.macd { height: 150px; }
.chart-empty { color: var(--dim); text-align: center; padding: 40px; font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--dim); padding: 4px 6px 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.kv { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kv .k { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.kv .v { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-top: 3px; }
.kv .v.pos { color: var(--pos); } .kv .v.neg { color: var(--neg); }
.dl-section h3 { margin: 22px 0 8px; font-size: 14px; letter-spacing: -.01em; color: #c9d4e2; }
.src-note { color: var(--dim); font-size: 11.5px; margin-top: 4px; }

/* Sources: transcripts & media */
.sources { display: grid; gap: 12px; }
.source { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.source-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.source-type { color: var(--text); font-size: 13px; font-weight: 600; }
.source-counts { font-size: 12px; font-family: var(--mono); }
.source-counts .pos { color: var(--pos); } .source-counts .neg { color: var(--neg); }
.source-link { margin-left: auto; color: var(--accent-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.source-link:hover { text-decoration: underline; }
.src-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 12px 0 4px; border-radius: 10px; overflow: hidden; background: #000; }
.src-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.src-video { width: 100%; max-height: 420px; border-radius: 10px; margin: 12px 0 4px; background: #000; display: block; }
.src-audio { width: 100%; margin: 12px 0 4px; display: block; }
.badge.audio { background: rgba(196,141,255,.15); color: #c48dff; }
.said { margin-top: 10px; display: grid; gap: 8px; }
.said-row { display: flex; gap: 10px; align-items: baseline; font-size: 13px; line-height: 1.5; }
.said-row .sig-dir { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; text-transform: capitalize; min-width: 150px; }
.said-q { color: #c9d4e2; }

