/* ============ StockHunter design system — deep space / glass / neon ============ */
:root {
  --bg-0: #060912;
  --bg-1: #0a0f1d;
  --glass: linear-gradient(165deg, rgba(22, 31, 54, 0.72), rgba(12, 18, 33, 0.88));
  --glass-hi: linear-gradient(165deg, rgba(28, 40, 70, 0.85), rgba(14, 21, 38, 0.92));
  --line: rgba(110, 168, 255, 0.10);
  --line-hi: rgba(110, 168, 255, 0.22);
  --text: #e6edf8;
  --dim: #7e90ac;
  --faint: #54647e;
  --teal: #2dd4bf;
  --cyan: #38bdf8;
  --gold: #fbbf24;
  --violet: #a78bfa;
  --green: #34d399;
  --red: #fb7185;
  --value: var(--teal);
  --dividend: var(--gold);
  --options: var(--violet);
  --ratio: #f472b6;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: Inter, system-ui, sans-serif;
  --r: 16px;
  --shadow: 0 18px 50px rgba(2, 6, 16, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: rgba(45, 212, 191, 0.25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1c2942; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 12% -8%, rgba(37, 78, 158, 0.16), transparent 60%),
    radial-gradient(900px 520px at 95% 0%, rgba(34, 116, 108, 0.13), transparent 55%),
    radial-gradient(1000px 700px at 50% 115%, rgba(96, 58, 168, 0.10), transparent 60%),
    var(--bg-0);
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 80%);
}
#root { position: relative; z-index: 1; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--dim); letter-spacing: 2px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drawRing { from { stroke-dashoffset: var(--circ); } }

/* ---------- nav ---------- */
nav {
  display: flex; align-items: center; gap: 26px;
  padding: 0 30px; height: 62px;
  background: rgba(8, 12, 23, 0.78);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-weight: 800; font-size: 17px; letter-spacing: 0.4px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.logo .glyph {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  color: #04211c; font-size: 14px; font-weight: 900;
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.45);
}
.logo em { font-style: normal; background: linear-gradient(90deg, var(--teal), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav a {
  color: var(--dim); text-decoration: none; font-weight: 600; font-size: 13px;
  padding: 4px 2px; position: relative; transition: color 0.18s;
}
nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: linear-gradient(90deg, var(--teal), transparent);
  transition: right 0.22s ease;
}
nav a.active, nav a:hover { color: var(--text); }
nav a.active::after { right: 10%; }
.spacer { flex: 1; }
.live { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 11.5px; font-family: var(--mono); white-space: nowrap; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2.4s infinite; }
.searchbtn {
  display: flex; align-items: center; gap: 10px;
  background: rgba(20, 30, 52, 0.7); border: 1px solid var(--line); border-radius: 10px;
  color: var(--faint); padding: 7px 12px; cursor: pointer; font-size: 12.5px; min-width: 190px;
  transition: border-color 0.18s;
}
.searchbtn:hover { border-color: var(--line-hi); color: var(--dim); }
.searchbtn kbd {
  margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; background: rgba(0,0,0,0.25);
}
.user { color: var(--faint); font-size: 12px; }
.user b { color: var(--dim); cursor: pointer; font-weight: 600; }
.user b:hover { color: var(--text); }

/* ---------- search modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center;
  padding-top: 14vh; background: rgba(4, 7, 14, 0.72); backdrop-filter: blur(6px);
  animation: fadeUp 0.18s ease;
}
.modal {
  width: min(560px, 92vw); height: fit-content;
  background: var(--glass-hi); border: 1px solid var(--line-hi); border-radius: 18px;
  box-shadow: var(--shadow), 0 0 60px rgba(45, 212, 191, 0.08); overflow: hidden;
}
.modal input {
  width: 100%; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 22px; letter-spacing: 2px;
  padding: 22px 24px; text-transform: uppercase;
}
.modal .hint { padding: 0 24px 18px; color: var(--faint); font-size: 12px; }
.modal .hint b { color: var(--dim); font-family: var(--mono); cursor: pointer; margin-right: 12px; }
.modal .hint b:hover { color: var(--teal); }

/* ---------- layout ---------- */
main { padding: 30px 34px 70px; max-width: 1560px; margin: 0 auto; }
.view { animation: fadeUp 0.3s ease both; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 12px; font-weight: 700; }
section { margin-bottom: 30px; }

.panel {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  margin-bottom: 16px;
}

/* ---------- stat cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; }
.stat {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: fadeUp 0.35s ease both;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 55%; height: 2px;
  background: linear-gradient(90deg, var(--c, var(--teal)), transparent);
  box-shadow: 0 0 14px var(--c, var(--teal));
}
.stat .k { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 700; font-family: var(--mono); margin-top: 7px; }
.stat .v small { font-size: 13px; color: var(--dim); font-weight: 500; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 5px; font-family: var(--mono); }

/* ---------- candidate pools ---------- */
.pools { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 16px; }
.pool {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow); animation: fadeUp 0.4s ease both;
}
.pool > header {
  padding: 14px 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); font-weight: 800; font-size: 12px; letter-spacing: 1.6px;
}
.pool > header .n { margin-left: auto; color: var(--faint); font-family: var(--mono); font-weight: 500; }
.pool > header .dot { width: 8px; height: 8px; border-radius: 50%; }
.pool.value > header { color: var(--value); } .pool.value .dot { background: var(--value); box-shadow: 0 0 10px var(--value); }
.pool.dividend > header { color: var(--dividend); } .pool.dividend .dot { background: var(--dividend); box-shadow: 0 0 10px var(--dividend); }
.pool.options > header { color: var(--options); } .pool.options .dot { background: var(--options); box-shadow: 0 0 10px var(--options); }
.pool.ratio > header { color: var(--ratio); } .pool.ratio .dot { background: var(--ratio); box-shadow: 0 0 10px var(--ratio); }
.pool table { width: 100%; border-collapse: collapse; }
.pool td { padding: 9px 18px; font-family: var(--mono); font-size: 13px; border-top: 1px solid rgba(110, 168, 255, 0.04); }
.pool tr { cursor: pointer; transition: background 0.15s; }
.pool tr:hover { background: rgba(110, 168, 255, 0.06); }
.pool tr:hover .tk { color: var(--teal); }
.pool .rank { color: var(--faint); width: 34px; font-size: 11px; }
.pool .tk { font-weight: 700; transition: color 0.15s; }
.pool .co { font-family: var(--sans); color: var(--faint); font-size: 12px; max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool .sc { text-align: right; }
.scorebar { display: inline-block; width: 54px; height: 5px; background: rgba(110,168,255,0.08); border-radius: 3px; overflow: hidden; vertical-align: 2px; margin-left: 8px; }
.scorebar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--c, var(--teal)), transparent 160%); }

/* ---------- badges & pills ---------- */
.badge {
  font-size: 10px; font-weight: 800; padding: 3.5px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.8px; border: 1px solid transparent;
}
.badge.value { background: rgba(45, 212, 191, 0.10); color: var(--value); border-color: rgba(45, 212, 191, 0.25); }
.badge.dividend { background: rgba(251, 191, 36, 0.10); color: var(--dividend); border-color: rgba(251, 191, 36, 0.25); }
.badge.options { background: rgba(167, 139, 250, 0.10); color: var(--options); border-color: rgba(167, 139, 250, 0.25); }
.badge.ratio { background: rgba(244, 114, 182, 0.10); color: var(--ratio); border-color: rgba(244, 114, 182, 0.3); }
.badge.recommend, .badge.buy, .badge.hit, .badge.long_vol { background: rgba(52, 211, 153, 0.10); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.badge.pass, .badge.miss, .badge.short_vol { background: rgba(251, 113, 133, 0.10); color: var(--red); border-color: rgba(251, 113, 133, 0.3); }
.badge.open { background: rgba(56, 189, 248, 0.10); color: var(--cyan); border-color: rgba(56, 189, 248, 0.3); }
.badge.expired, .badge.superseded { background: rgba(126, 144, 172, 0.10); color: var(--dim); border-color: rgba(126, 144, 172, 0.3); }

/* conviction meter: 10 segments */
.convmeter { display: inline-flex; gap: 2.5px; align-items: center; }
.convmeter i { width: 7px; height: 12px; border-radius: 2px; background: rgba(110, 168, 255, 0.10); }
.convmeter i.on { background: linear-gradient(180deg, var(--teal), var(--cyan)); box-shadow: 0 0 7px rgba(45, 212, 191, 0.5); }
.convmeter span { margin-left: 7px; font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- recommendation cards ---------- */
.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(470px, 1fr)); gap: 14px; }
@media (max-width: 1060px) { .recs { grid-template-columns: 1fr; } }
.rec {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s; animation: fadeUp 0.4s ease both;
}
.rec:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.rec::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--teal)); opacity: 0.8; box-shadow: 0 0 16px var(--c, var(--teal)); }
.rec .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec .tk { font-family: var(--mono); font-weight: 800; font-size: 17px; cursor: pointer; }
.rec .tk:hover { color: var(--teal); }
.rec .co { color: var(--faint); font-size: 12.5px; }
.pnl { font-family: var(--mono); font-weight: 700; margin-left: auto; font-size: 14px; }
.pnl.up { color: var(--green); text-shadow: 0 0 14px rgba(52, 211, 153, 0.35); }
.pnl.down { color: var(--red); }
.rec .thesis { margin-top: 11px; line-height: 1.6; color: #c6d4e8; font-size: 13.5px; }
.rec .thesis a { color: var(--teal); text-decoration: none; }
.rec .skeptic { margin-top: 9px; color: var(--dim); line-height: 1.55; font-size: 12.5px; border-left: 2px solid rgba(251, 113, 133, 0.4); padding-left: 10px; }
.rec .skeptic b { color: var(--red); }
.rec .meta { margin-top: 11px; color: var(--faint); font-size: 11.5px; font-family: var(--mono); display: flex; gap: 14px; flex-wrap: wrap; }
.income {
  margin-top: 11px; background: rgba(251, 191, 36, 0.05); border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 10px; padding: 10px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
.income b { color: var(--dividend); }
.structure {
  margin-top: 11px; background: rgba(167, 139, 250, 0.05); border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 10px; padding: 10px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #cbc0ee;
}

/* ---------- ticker page ---------- */
.tickerhead { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.tickerhead .sym { font-family: var(--mono); font-size: 32px; font-weight: 800; letter-spacing: 1px; }
.tickerhead .px { font-family: var(--mono); font-size: 24px; color: var(--teal); text-shadow: 0 0 22px rgba(45, 212, 191, 0.35); }
.tickerhead .co { color: var(--dim); font-size: 13px; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1060px) { .grid2 { grid-template-columns: 1fr; } }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; justify-items: center; }
.ring { text-align: center; width: 86px; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: rgba(110, 168, 255, 0.09); }
.ring .arc { stroke-linecap: round; animation: drawRing 1s ease both; filter: drop-shadow(0 0 5px var(--c)); }
.ring .num { font-family: var(--mono); font-weight: 700; font-size: 15px; transform: rotate(90deg); fill: var(--text); }
.ring .lbl { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 6px; }

.factgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 7px 22px; font-size: 12.5px; }
.factgrid .f { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(110, 168, 255, 0.09); padding: 5px 0; }
.factgrid .f span:first-child { color: var(--faint); }
.factgrid .f span:last-child { font-family: var(--mono); color: #cdd9ea; }

.newsitem { padding: 9px 0; border-bottom: 1px solid rgba(110, 168, 255, 0.06); font-size: 13px; line-height: 1.45; }
.newsitem:last-child { border-bottom: 0; }
.newsitem a { color: #c9d6ea; text-decoration: none; }
.newsitem a:hover { color: var(--teal); }
.newsitem .m { color: var(--faint); font-size: 11px; margin-top: 3px; font-family: var(--mono); }
.sent-positive { color: var(--green); } .sent-negative { color: var(--red); } .sent-neutral { color: var(--dim); }

/* ---------- chart ---------- */
.chart { width: 100%; display: block; }
.chart .axis { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.chart .grid { stroke: rgba(110, 168, 255, 0.06); }
.chartbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.chartbar .gap { width: 12px; }
.chip {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--faint); background: rgba(20, 30, 52, 0.6); border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 9px; cursor: pointer; user-select: none;
  transition: all 0.15s;
}
.chip:hover { color: var(--dim); border-color: var(--line-hi); }
.chip.on { color: var(--c, var(--teal)); border-color: var(--c, var(--teal)); background: rgba(45, 212, 191, 0.06); box-shadow: 0 0 10px rgba(45, 212, 191, 0.12); }
.readout {
  font-family: var(--mono); font-size: 11px; color: var(--dim); min-height: 17px;
  margin-bottom: 6px; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden;
}
.readout b { color: var(--text); font-weight: 600; }
.readout .up { color: var(--green); } .readout .down { color: var(--red); }

/* ---------- buttons & inputs ---------- */
button {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  color: #03241e; border: 0; border-radius: 10px; padding: 10px 20px;
  font-weight: 800; cursor: pointer; font-size: 13px; font-family: var(--sans);
  box-shadow: 0 4px 22px rgba(45, 212, 191, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 7px 28px rgba(45, 212, 191, 0.4); }
button:disabled { opacity: 0.55; cursor: wait; transform: none; }
button.ghost { background: rgba(20, 30, 52, 0.7); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
input.field, select.field {
  background: rgba(13, 20, 36, 0.8); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 13px; font-family: var(--mono); width: 100%; outline: none;
  transition: border-color 0.15s;
}
input.field:focus { border-color: rgba(45, 212, 191, 0.45); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08); }
.row { display: flex; gap: 10px; align-items: center; }

/* ---------- tables ---------- */
table.flat { width: 100%; border-collapse: collapse; }
table.flat th {
  text-align: left; color: var(--faint); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; padding: 9px 12px; border-bottom: 1px solid var(--line);
}
table.flat td { padding: 10px 12px; border-bottom: 1px solid rgba(110, 168, 255, 0.05); font-family: var(--mono); font-size: 12.5px; }
table.flat tr:hover td { background: rgba(110, 168, 255, 0.035); }

/* ---------- misc ---------- */
.note { color: var(--faint); font-size: 12.5px; line-height: 1.6; }
.err { color: var(--red); padding: 12px 0; font-family: var(--mono); font-size: 13px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
.skel { border-radius: 8px; height: 14px; background: linear-gradient(90deg, rgba(110,168,255,0.05), rgba(110,168,255,0.12), rgba(110,168,255,0.05)); background-size: 400px 100%; animation: shimmer 1.3s infinite linear; margin: 8px 0; }
.health-ok { color: var(--green); } .health-warn { color: var(--gold); } .health-bad { color: var(--red); }
.demo-banner {
  background: linear-gradient(90deg, rgba(251,191,36,0.12), transparent);
  border: 1px solid rgba(251,191,36,0.25); color: var(--gold);
  border-radius: 10px; padding: 8px 14px; font-size: 12px; margin-bottom: 18px; font-family: var(--mono);
}
