:root {
  --bg: #070a12;
  --panel: #0d1424;
  --panel2: #111a2e;
  --line: #1d2b46;
  --cyan: #22d3ee;
  --magenta: #e879f9;
  --text: #e7eefc;
  --muted: #8b9bb4;
  --faint: #5a6b88;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #10203f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--cyan); }
.mono { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 11px 20px; border-bottom: 1px solid var(--line);
  background: rgba(7,10,18,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.surge-word { transition: filter .2s ease; }
.brand:hover .surge-mark { filter: drop-shadow(0 0 22px rgba(244,114,208,.95)); transform: scale(1.12) rotate(-3deg); }
.brand:hover .surge-word { filter: drop-shadow(0 0 22px rgba(139,123,255,.65)); }
.surge-mark {
  width: 24px; height: 26px; flex: 0 0 auto;
  clip-path: polygon(58% 4%,22% 54%,44% 54%,38% 96%,80% 40%,56% 40%,70% 4%);
  background: linear-gradient(0deg,#22d3ee 0%,#8b7bff 50%,#f472d0 100%);
  filter: drop-shadow(0 0 10px rgba(139,123,255,.55));
  transition: filter .2s ease, transform .2s ease;
}
.surge-word {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .04em;
  background: linear-gradient(92deg,#22d3ee 0%,#8b7bff 48%,#f472d0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(139,123,255,.30));
}
.nav { display: flex; gap: 5px; flex-wrap: wrap; }
.nav-btn {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: var(--panel); }
.nav-btn.active { color: #06121b; background: var(--cyan); box-shadow: 0 0 16px -2px var(--cyan); }
.topbar-right { margin-left: auto; display: flex; align-items: center; justify-content: flex-end;
  gap: 14px; flex-wrap: wrap; }
.provenance { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.provenance .ok { color: var(--green); }
.prov-text { line-height: 1.35; }
.refresh-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  cursor: pointer; transition: color .15s, border-color .15s, box-shadow .15s;
}
.refresh-btn:hover { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 14px -4px var(--cyan); }
.refresh-ic { font-size: 16px; line-height: 1; display: inline-block; }
.refresh-btn.spin { pointer-events: none; border-color: var(--cyan); color: var(--cyan); }
.refresh-btn.spin .refresh-ic { animation: rfspin .8s linear infinite; }
@keyframes rfspin { to { transform: rotate(360deg); } }

/* ---- toast ---- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 34px -10px #000; opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .ok { color: var(--green); }

/* ---- layout ---- */
main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: 22px; }

/* ---- Surge charging-bolt loader (ported from the app) ---- */
.surge-loader { display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 70px 0; }
.surge-bolt {
  position: relative; width: 62px; height: 62px;
  clip-path: polygon(58% 4%,22% 54%,44% 54%,38% 96%,80% 40%,56% 40%,70% 4%);
  animation: surgePulse 1.3s ease-in-out infinite, surgeGlow 1.3s ease-in-out infinite;
}
.surge-bolt .base { position: absolute; inset: 0; background: rgba(255,255,255,.06); }
.surge-bolt .fill {
  position: absolute; inset: 0; transform-origin: bottom;
  background: linear-gradient(0deg,#22d3ee 0%,#8b7bff 50%,#f472d0 100%);
  animation: surgeCharge 1.3s ease-in-out infinite;
}
.surge-bolt .flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: surgeFlash 1.3s ease-in-out infinite; }
@keyframes surgeCharge { 0%{transform:scaleY(0)} 55%{transform:scaleY(1)} 100%{transform:scaleY(1)} }
@keyframes surgeFlash { 0%,55%{opacity:0} 64%{opacity:.85} 100%{opacity:0} }
@keyframes surgePulse { 0%{transform:scale(.9)} 55%{transform:scale(1.04)} 64%{transform:scale(1.12)} 80%{transform:scale(1)} 100%{transform:scale(.94)} }
@keyframes surgeGlow {
  0%{filter:drop-shadow(0 0 5px rgba(34,211,238,.35))}
  55%{filter:drop-shadow(0 0 16px rgba(139,123,255,.8))}
  64%{filter:drop-shadow(0 0 24px rgba(244,114,208,.95))}
  100%{filter:drop-shadow(0 0 7px rgba(139,123,255,.45))}
}
.surge-label { color: var(--text); font-size: 14px; font-weight: 600; }
.surge-witty { position: relative; height: 1.2em; width: 260px; }
.surge-witty span {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; opacity: 0;
  animation: surgeWitty 9.6s linear infinite;
}
.surge-witty span:nth-child(1){animation-delay:0s} .surge-witty span:nth-child(2){animation-delay:1.6s}
.surge-witty span:nth-child(3){animation-delay:3.2s} .surge-witty span:nth-child(4){animation-delay:4.8s}
.surge-witty span:nth-child(5){animation-delay:6.4s} .surge-witty span:nth-child(6){animation-delay:8s}
@keyframes surgeWitty { 0%,1%{opacity:0} 3%,14%{opacity:1} 16%,100%{opacity:0} }

.view-head h1 { font-family: "Space Grotesk", sans-serif; font-size: 22px; margin: 0 0 4px; }
.view-head p { color: var(--muted); margin: 0 0 16px; max-width: 760px; }
.tag { color: var(--green); }

/* ---- horizon pills ---- */
.pills { display: flex; gap: 8px; margin: 4px 0 18px; flex-wrap: wrap; }
.pill {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.pill:hover { color: var(--text); border-color: var(--cyan); }
.pill.active { color: #06121b; background: var(--cyan); border-color: var(--cyan); }

/* ---- tables ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.card::-webkit-scrollbar { height: 10px; }
.card::-webkit-scrollbar-track { background: transparent; }
.card::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.card::-webkit-scrollbar-thumb:hover { background: var(--faint); }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--faint); padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel); cursor: pointer; user-select: none; white-space: nowrap;
}
thead th.sortable:hover { color: var(--cyan); }
thead th .arrow { color: var(--cyan); font-size: 10px; }
tbody td { padding: 10px 14px; border-bottom: 1px solid rgba(29,43,70,.5); white-space: nowrap; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--panel2); }
tbody tr.open { background: var(--panel2); }
.tkr { font-weight: 800; letter-spacing: .3px; }
.co { color: var(--muted); display: inline-block; max-width: 180px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
td.co { display: table-cell; }   /* Conviction puts .co on the <td> itself — keep cell-truncation */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); } .dim { color: var(--faint); }

/* conviction bar */
.bar { position: relative; height: 7px; width: 92px; background: var(--line); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--cyan), var(--magenta)); border-radius: 99px; }
.barwrap { display: flex; align-items: center; gap: 9px; }

/* detail row */
.detail td { background: #0a1120; border-bottom: 1px solid var(--line); padding: 0; }
.detail-inner { padding: 16px 18px; }
.odds { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.metric { min-width: 120px; }
.metric .k { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.metric .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.metric .d { font-size: 12px; color: var(--muted); }
.reasons { list-style: none; padding: 0; margin: 0; color: var(--text); }
.reasons li { padding: 3px 0 3px 18px; position: relative; color: #c7d4ea; }
.reasons li:before { content: "▸"; position: absolute; left: 0; color: var(--cyan); }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--cyan); }
.count { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* segmented toggle (Alerts bull/bear filter) */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg-btn { background: transparent; color: var(--muted); border: none; cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { color: #06121b; background: var(--cyan); }

/* Alerts table cells */
.sub { display: block; font-size: 11px; color: var(--faint); font-weight: 400; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-msg { color: var(--muted); max-width: 360px; }
.fineprint { color: var(--faint); font-size: 12px; margin: 14px 2px 0; }

/* OG Flock Radar — embedded original tool */
.og-frame { width: 100%; height: calc(100vh - 215px); min-height: 540px; display: block;
  border: 1px solid var(--line); border-radius: 12px; background: #010409; margin-top: 4px; }

/* 🦅 Surge Flock Radar */
.fr-app { display: grid; grid-template-columns: 1fr 300px; gap: 12px; height: 70vh; min-height: 520px; margin-top: 4px; }
.fr-czone { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; }
#fr-canvas { flex: 1; display: block; width: 100%; }
.fr-qlbl { position: absolute; font-family: "JetBrains Mono", monospace; font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; pointer-events: none; opacity: .6; }
.fr-timebar { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-top: 1px solid var(--line);
  background: var(--panel2); }
.fr-side { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow-y: auto; display: flex; flex-direction: column; }
.fr-title { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--cyan); padding: 10px 12px 4px; }
.fr-anal { font-size: 11px; color: var(--muted); padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.fr-pf { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 11px; border-bottom: 1px solid var(--line); }
.fr-pf input { flex: 1; }
.fr-card { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fr-card:hover, .fr-card.sel { background: var(--panel2); }
.fr-r1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fr-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.fr-tk { font-family: "JetBrains Mono", monospace; font-weight: 800; font-size: 13px; }
.fr-px { margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text); }
.fr-co { font-size: 11px; color: var(--faint); margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-bars { display: flex; gap: 5px; flex-wrap: wrap; }
.fr-bars .tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted); }
.fr-symp { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.fr-symbar { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.fr-symbar i { display: block; height: 100%; }
.vault-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.vault-tab { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  font-size: 13px; color: var(--muted); cursor: pointer; transition: all .12s; font-family: inherit; }
.vault-tab:hover { color: var(--text); border-color: var(--cyan); }
.vault-tab.active { background: var(--cyan); color: #04121b; border-color: var(--cyan); font-weight: 600; }
.sec-sub { font-family: "Space Grotesk", sans-serif; font-size: 15px; font-weight: 600; color: var(--text); margin: 18px 0 8px; }
.sq-detail { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 16px; }
tbody tr.sel { background: var(--panel2); }
/* Guide accordions */
.guide-acc { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.guide-acc summary { cursor: pointer; padding: 11px 14px; font-weight: 600; color: var(--text); list-style: none; user-select: none; }
.guide-acc summary::-webkit-details-marker { display: none; }
.guide-acc summary::before { content: "▸"; color: var(--cyan); margin-right: 9px; display: inline-block; transition: transform .15s; }
.guide-acc[open] summary::before { transform: rotate(90deg); }
.guide-acc[open] summary { border-bottom: 1px solid var(--line); }
.guide-body { padding: 11px 16px 13px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.guide-body ul { margin: 6px 0; padding-left: 18px; }
.guide-body li { margin: 3px 0; }
/* Macro */
.mac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mac-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.mac-lbl { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.mac-val { font-family: "JetBrains Mono", monospace; font-size: 20px; font-weight: 700; margin: 2px 0; }
.mac-card .spark { display: block; width: 100%; height: 28px; margin-top: 6px; }
.mac-read { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mac-read li { font-size: 13px; color: var(--muted); }
/* Correlations */
.corr-grid { border-collapse: collapse; }
.corr-grid th, .corr-grid td { padding: 4px 7px; text-align: center; border: 1px solid var(--bg); }
.corr-ratio { margin-bottom: 14px; }
.corr-ratio .spark { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px; width: 100%; max-width: 380px; height: 46px; }
/* Prediction */
.pred-list { display: flex; flex-direction: column; gap: 8px; }
.pred-row { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.pred-q { font-size: 13.5px; color: var(--text); margin-bottom: 7px; }
.pred-bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.pred-bar i { display: block; height: 100%; background: var(--cyan); }
.pred-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }

.fr-detail-wrap { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 40px 14px 16px; }
.fr-detail-x { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 4px; }
.fr-detail-x:hover { color: var(--text); }
.fr-detail { padding: 0; background: none; }
.fr-d-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.fr-d-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 14px; margin-bottom: 10px; }
.fr-sl { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.fr-sv { font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.fr-sv.pos { color: var(--green); } .fr-sv.neg { color: var(--red); } .fr-sv.amber { color: var(--amber); }
#fr-spark { width: 100%; display: block; margin-bottom: 6px; }
@media (max-width: 720px) { .fr-app { grid-template-columns: 1fr; height: auto; } .fr-czone { height: 56vh; } .fr-d-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- Curated (bring-your-own-AI) ---- */
.cur-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 18px; }
.cur-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; color: var(--text); }
.cur-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 999px; background: var(--cyan);
  color: #06121b; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.btn-mini { background: var(--cyan); color: #06121b; border: none; border-radius: 999px; cursor: pointer;
  padding: 6px 14px; font-size: 13px; font-weight: 700; transition: filter .15s; }
.btn-mini:hover { filter: brightness(1.1); }
.ai-links { display: inline-flex; gap: 7px; flex-wrap: wrap; }
.ai-link { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; transition: all .15s; }
.ai-link:hover { border-color: var(--cyan); }
.ai-link.pref { border-color: var(--magenta); color: var(--magenta);
  box-shadow: 0 0 14px -5px var(--magenta); }
.cur-prompt { margin-top: 10px; }
.cur-prompt summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.cur-prompt pre { white-space: pre-wrap; max-height: 280px; overflow: auto; margin-top: 8px;
  background: #0a1120; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  font-size: 11.5px; color: var(--muted); }

.cur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 14px; align-items: start; }
.cur-card { padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cur-card:hover { border-color: var(--cyan); }
.cur-card.picked { border-color: var(--magenta); box-shadow: 0 0 22px -10px var(--magenta); }
.cur-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cur-head .co { color: var(--muted); font-size: 13px; }
.cur-thesis { background: var(--panel2); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.cur-setup { font-weight: 700; color: var(--text); margin-bottom: 5px; display: flex; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; align-items: center; }
.pick-badge { font-size: 11.5px; font-weight: 600; color: var(--magenta); }
.cur-thesis p { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.cur-risk { font-size: 12.5px; color: var(--faint); }
.cur-risk span { margin-right: 6px; }
.cur-ev { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 12.5px; }
.cur-ev li { padding: 2px 0; border-top: 1px solid var(--line); }
.cur-ev li:first-child { border-top: none; }
.cur-ev b { color: var(--text); }

/* ---- Journal ---- */
.jr-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.jr-stat { flex: 1 1 120px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.jr-stat .k { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.jr-stat .v { font-size: 20px; font-weight: 700; font-family: "JetBrains Mono", monospace; margin-top: 3px; }
.jr-add { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.jr-add summary { cursor: pointer; font-weight: 700; color: var(--text); }
.jr-form { margin-top: 12px; }
.jr-row { display: flex; gap: 10px; flex-wrap: wrap; }
.jr-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .3px; }
.jr-form input, .jr-form select { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; min-width: 84px; }
.jr-form input:focus, .jr-form select:focus { border-color: var(--cyan); }
.jr-notes { width: 100%; margin: 10px 0; }
.jr-notes input { width: 100%; }
.jr-h { font-family: "Space Grotesk", sans-serif; font-size: 16px; margin: 22px 0 10px; }
.jr-h .dim { color: var(--faint); font-weight: 400; }
.jr-io { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-mini.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: pointer; }
.btn-mini.ghost:hover { color: var(--text); border-color: var(--cyan); }
.btn-mini.ghost.danger:hover { color: var(--red); border-color: var(--red); }
.lnk { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 12.5px; padding: 0; }
.lnk.danger { color: var(--red); }
.lnk:hover { text-decoration: underline; }

/* ---- auth (login gate) ---- */
.auth-screen { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: radial-gradient(1200px 600px at 70% -10%, #10203f 0%, var(--bg) 55%); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 28px; box-shadow: 0 24px 70px -20px #000; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 18px; }
.auth-brand .surge-mark { width: 30px; height: 33px; }
.auth-brand .surge-word { font-size: 24px; }
.auth-card h1 { font-family: "Space Grotesk", sans-serif; font-size: 21px; text-align: center; margin: 0 0 6px; }
.auth-sub { color: var(--muted); text-align: center; font-size: 13.5px; margin: 0 0 18px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .4px; }
.auth-card input { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 13px; font-size: 14px; outline: none; }
.auth-card input:focus { border-color: var(--cyan); }
.auth-btn { margin-top: 4px; background: var(--cyan); color: #06121b; border: none; border-radius: 999px;
  padding: 12px; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: filter .15s; }
.auth-btn:hover { filter: brightness(1.08); }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-err { color: var(--red); font-size: 13px; min-height: 17px; text-align: center; }
.auth-foot { color: var(--faint); font-size: 12px; text-align: center; margin: 16px 0 0; }

/* ---- user chip + menu ---- */
.user-slot { position: relative; flex: 0 0 auto; margin-left: auto; }
.user-chip { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s; }
.user-chip:hover { border-color: var(--cyan); }
.user-chip .caret { color: var(--faint); }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; z-index: 30; box-shadow: 0 14px 40px -12px #000;
  display: flex; flex-direction: column; }
.user-menu[hidden] { display: none; }   /* the [hidden] attr loses to display:flex without this */
.user-menu a, .user-menu button { background: none; border: none; color: var(--text); text-align: left;
  text-decoration: none; padding: 9px 11px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.user-menu a:hover, .user-menu button:hover { background: var(--panel); }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(3,6,12,.66); }
.modal { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 22px 20px; box-shadow: 0 24px 70px -20px #000; }
.modal h2 { font-family: "Space Grotesk", sans-serif; font-size: 17px; margin: 0 0 14px; }
.modal form { display: flex; flex-direction: column; gap: 11px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .3px; }
.modal input { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 13.5px; outline: none; }
.modal input:focus { border-color: var(--cyan); }
.modal-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---- admin: one-time credential card ---- */
.cred-card { background: var(--panel2); border: 1px solid var(--green); border-radius: 12px;
  padding: 14px 16px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.cred-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.cred-card code { background: #0a1120; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px;
  font-family: "JetBrains Mono", monospace; color: var(--text); font-size: 14px; letter-spacing: .5px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 12px 22px; color: var(--faint); font-size: 11.5px;
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.foot .disclaimer strong { color: var(--muted); }
.foot-prov { display: inline-flex; align-items: center; gap: 8px; }
.foot-prov .prov-text { color: var(--muted); }
.foot .refresh-btn { width: 24px; height: 24px; }
.foot .refresh-ic { font-size: 13px; }

.empty { color: var(--muted); padding: 40px; text-align: center; }

/* ---- ticker detail page ---- */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.back:hover { color: var(--cyan); }
.tk-head h1 { font-family: "Space Grotesk", sans-serif; font-size: 24px; margin: 0 0 14px; }
.tk-head .tk-name { color: var(--muted); font-weight: 500; font-size: 17px; font-family: inherit; }
.plan { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 11px 16px; margin: 2px 0 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.plan .lbl { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.plan .dim { color: var(--faint); }
.tk-odds { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 10px; margin-bottom: 16px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin: 0 2px 8px; flex-wrap: wrap; }
.chart { width: 100%; }
.chart-tag { font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); margin: 10px 0 0 2px; }
.verdict-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 4px 0 12px; }
.vc-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.verdict-cols .reasons li { font-size: 13px; }
@media (max-width: 680px) { .verdict-cols { grid-template-columns: 1fr; } }

/* ---- homepage ---- */
.hero { text-align: center; padding: 46px 16px 26px; }
.hero-mark { width: 56px; height: 62px; margin: 0 auto 14px;
  clip-path: polygon(58% 4%,22% 54%,44% 54%,38% 96%,80% 40%,56% 40%,70% 4%);
  background: linear-gradient(0deg,#22d3ee,#8b7bff 50%,#f472d0);
  filter: drop-shadow(0 0 26px rgba(139,123,255,.6)); }
.hero-title { font-family: "Space Grotesk", sans-serif; font-size: 56px; line-height: 1; margin: 0; font-weight: 700;
  background: linear-gradient(92deg,#22d3ee,#8b7bff 48%,#f472d0); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 30px rgba(139,123,255,.3)); }
.hero-tag { font-size: 20px; font-weight: 700; margin: 14px 0 8px; }
.hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 15px; line-height: 1.6; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin: 24px 0 20px; flex-wrap: wrap; }
.btn { padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; transition: all .15s; }
.btn:hover { border-color: var(--cyan); }
.btn.primary { background: var(--cyan); color: #06121b; border-color: var(--cyan); box-shadow: 0 0 22px -4px var(--cyan); }
.btn.primary:hover { filter: brightness(1.08); }
.hero-stats { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.hero-stats b { color: var(--text); } .hero-stats .ok { color: var(--green); }
.val-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0 8px; }
.val { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.val .vi { font-size: 24px; }
.val h3 { margin: .5rem 0 .35rem; font-size: 16px; font-family: "Space Grotesk", sans-serif; }
.val p { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.55; }
.sec-h { font-family: "Space Grotesk", sans-serif; font-size: 15px; color: var(--muted); margin: 30px 0 12px;
  letter-spacing: .06em; text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: all .15s; }
.tile:hover { border-color: var(--cyan); transform: translateY(-2px); }
.tile .ti { font-size: 22px; line-height: 1; }
.tile .tt { color: var(--text); font-weight: 700; font-size: 14.5px; }
.tile .td { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
@media (max-width: 760px) { .val-cards, .tiles { grid-template-columns: 1fr; } .hero-title { font-size: 44px; } }

/* ── 🤖 Brief tab (additive, scoped to .brief-*) ──────────────────────────── */
.brief-banner {
  background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .35);
  color: var(--amber); border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; line-height: 1.45; margin: 0 0 16px;
}
.brief-hero { padding: 16px 18px; margin-bottom: 14px; border-left: 3px solid var(--cyan); }
.brief-headline {
  font-family: "Space Grotesk", sans-serif; font-size: 19px; line-height: 1.35; color: var(--text);
}
.brief-regime { color: var(--muted); font-size: 14px; margin-top: 8px; }
.brief-section { padding: 14px 16px; margin-bottom: 12px; }
.brief-sec-head {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.brief-sec-body { color: var(--muted); margin: 0; line-height: 1.55; }
.brief-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.brief-chip {
  font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 12px; color: var(--cyan);
  background: rgba(34, 211, 238, .08); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 8px; cursor: pointer; transition: border-color .15s;
}
.brief-chip:hover { border-color: var(--cyan); }
.brief-watch { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.brief-watch li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief-watch .dim { font-size: 13px; }
.brief-bottom { padding: 14px 16px; color: var(--muted); border-left: 3px solid var(--green); line-height: 1.55; }

/* ── 🔎 Deep Dive tab (additive, scoped to .dd-*) ──────────────────────────── */
.dd-banner {
  background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .30);
  color: var(--cyan); border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; line-height: 1.45; margin: 0 0 16px;
}
.dd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.dd-card { text-align: left; cursor: pointer; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.dd-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.dd-tkr { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--cyan); font-size: 15px; }
.dd-snip {
  color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.dd-hero { padding: 16px 18px; margin-bottom: 14px; border-left: 3px solid var(--cyan); }
.dd-summary { color: var(--text); line-height: 1.5; }
.dd-sent { color: var(--muted); margin-top: 10px; font-size: 13.5px; }
.dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.dd-sec { padding: 14px 16px; margin-bottom: 12px; }
.dd-sec ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.5; }
.dd-h { font-family: "Space Grotesk", sans-serif; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.dd-list { list-style: none; padding-left: 0; }
.dd-list li { margin: 7px 0; }
.dd-conf, .dd-lean { font-size: 11px; }
.dd-bottom { padding: 14px 16px; margin-bottom: 12px; color: var(--muted); border-left: 3px solid var(--green); line-height: 1.55; }
.dd-sources summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 8px 2px; }
.dd-sources ul { color: var(--faint); font-size: 12.5px; line-height: 1.6; }
@media (max-width: 760px) { .dd-cols { grid-template-columns: 1fr; } }
