/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07111f;
  --bg2:      #0b1929;
  --card:     #0e1f35;
  --card2:    #122440;
  --border:   rgba(0,180,255,.12);
  --border2:  rgba(0,180,255,.30);
  --blue:     #00b4ff;
  --cyan:     #00e5cc;
  --green:    #00e676;
  --red:      #ff4757;
  --orange:   #ff9500;
  --gold:     #ffd700;
  --text:     #dce9f5;
  --muted:    #6a8ca8;
  --faint:    #2a3e52;
  --mono:     'Space Mono', monospace;
  --sans:     'Inter', system-ui, sans-serif;
  --radius:   10px;
  --shadow:   0 6px 30px rgba(0,0,0,.55);
  --header-h: 68px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 1.6rem;
  background: linear-gradient(90deg, #041122 0%, #0a1e38 50%, #041122 100%);
  border-bottom: 1px solid var(--border2);
  position: sticky; top: 0; z-index: 100;
  gap: 1rem;
}

.logo { display: flex; align-items: center; gap: .85rem; }
.logo-img { height: 44px; width: auto; display: block; }
.logo-sub {
  font-size: .7rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase;
  padding: .25rem 0 .25rem .85rem; border-left: 1px solid var(--border2);
}

.header-center { display: flex; align-items: center; gap: .5rem; }

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  transition: background .3s;
}
.live-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
.live-dot.error { background: var(--red); box-shadow: 0 0 8px var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.status-text { font-size: .75rem; color: var(--muted); font-family: var(--mono); }

.header-right { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.update-info { font-size: .72rem; color: var(--muted); }
.update-info .label { color: var(--faint); margin-right: .25rem; }
.update-info span:last-child { color: var(--cyan); font-family: var(--mono); }

.btn-refresh {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--blue);
  padding: .35rem .9rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  transition: all .2s;
}
.btn-refresh:hover { background: rgba(0,180,255,.12); border-color: var(--blue); }
.btn-refresh:disabled { opacity: .45; cursor: not-allowed; }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: .35rem .9rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  transition: all .2s;
}
.btn-logout:hover { background: rgba(255,71,87,.1); border-color: var(--red); color: var(--red); }

/* ── Loading ────────────────────────────────────────────────────────────── */
.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 60px);
}
.loading-box {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 3rem 4rem;
  box-shadow: var(--shadow);
  max-width: 480px;
}
.loading-box h2 { font-size: 1.25rem; color: var(--blue); margin-bottom: .6rem; }
.loading-box p { color: var(--muted); font-size: .85rem; }
.loading-note { font-size: .72rem !important; margin-top: .6rem; color: var(--faint) !important; }

.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--faint);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Intro splash ───────────────────────────────────────────────────────── */
#intro-screen {
  --intro-glow: rgba(0,180,255,.45);   /* themed accent glow (overridden per theme) */
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Cosmic backdrop derived from the active theme's background palette. */
  background: radial-gradient(circle at 50% 40%, var(--bg2) 0%, var(--bg) 62%, #000 100%);
  opacity: 1;
  transition: opacity .8s ease;
}
[data-theme="rare-earth"] #intro-screen { --intro-glow: rgba(212,175,55,.50); }
#intro-screen.intro-hide { opacity: 0; pointer-events: none; }

#intro-canvas-wrap { position: absolute; inset: 0; z-index: 1; }

.intro-logo {
  position: relative;
  z-index: 2;
  width: min(560px, 78vw);
  height: auto;
  /* No card: the logo blends onto the cosmic backdrop with a soft themed glow. */
  filter: drop-shadow(0 0 26px var(--intro-glow));
  animation: introLogoIn 1.2s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes introLogoIn {
  0%   { opacity: 0; transform: translateY(18px) scale(.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-tagline {
  position: absolute;
  z-index: 2;
  bottom: 13%;
  left: 0; right: 0;
  text-align: center;
  color: var(--text);
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: 3px;
  opacity: 0;
  animation: introTagIn .8s ease 1.1s forwards;
}
@keyframes introTagIn { to { opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  .intro-logo, .intro-tagline { animation: none; opacity: 1; }
}

/* ── Login screen ─────────────────────────────────────────────────────────
   Built entirely from theme variables + a themed accent glow, so it adopts
   whatever theme (data-theme on <html>) is active — set by intro.js and
   dashboard.js before this screen is ever shown. */
#login-screen {
  --login-glow: rgba(0,180,255,.45);   /* themed accent glow (overridden per theme) */
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at 50% 35%, var(--bg2) 0%, var(--bg) 62%, #000 100%);
  animation: loginScreenIn .5s ease both;
}
[data-theme="rare-earth"] #login-screen { --login-glow: rgba(212,175,55,.50); }
@keyframes loginScreenIn { from { opacity: 0; } to { opacity: 1; } }

.login-card {
  width: min(420px, 92vw);
  text-align: center;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 2.6rem 2.4rem 2rem;
  box-shadow: var(--shadow);
}

.login-logo {
  width: min(320px, 70%);
  height: auto;
  filter: drop-shadow(0 0 22px var(--login-glow));
  animation: loginLogoIn 1s cubic-bezier(.2,.8,.2,1) both,
             loginLogoFloat 4s ease-in-out 1s infinite;
}
@keyframes loginLogoIn {
  0%   { opacity: 0; transform: translateY(14px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes loginLogoFloat {
  0%, 100% { transform: translateY(0);    filter: drop-shadow(0 0 18px var(--login-glow)); }
  50%      { transform: translateY(-5px); filter: drop-shadow(0 0 32px var(--login-glow)); }
}

.login-sub {
  margin: .4rem 0 1.8rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: .35rem; }
.login-label {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-input {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: .7rem .85rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
}
.login-input::placeholder { color: var(--faint); }
.login-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--border);
}

.login-error {
  min-height: 1rem;
  font-size: .72rem;
  color: var(--red);
  text-align: center;
}

.login-btn {
  margin-top: .3rem;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border: none;
  border-radius: 6px;
  padding: .75rem;
  color: var(--bg);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  transition: filter .2s, transform .05s;
}
.login-btn:hover { filter: brightness(1.12); }
.login-btn:active { transform: translateY(1px); }

.login-note {
  margin-top: 1.4rem;
  font-size: .68rem;
  color: var(--faint);
  font-family: var(--mono);
  letter-spacing: .04em;
}
.login-note strong { color: var(--muted); }

.login-disclaimer {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 1.2rem 2rem;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: .7rem;
  line-height: 1.6;
  color: var(--muted);
}
.login-disclaimer strong { color: var(--orange); }

#login-screen.login-shake .login-card { animation: loginShake .45s; }
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo { animation: none; }
  #login-screen { animation: none; }
}

.hidden { display: none !important; }

/* ── Dashboard layout ───────────────────────────────────────────────────── */
.dashboard { padding: 1.2rem 1.6rem 3rem; max-width: 1600px; margin: 0 auto; }

.section { margin-bottom: 2.4rem; scroll-margin-top: calc(var(--header-h) + 12px); }
.section-header { margin-bottom: 1rem; }
.section-header h2 { font-size: 1.05rem; font-family: var(--mono); color: var(--blue); letter-spacing: .05em; }
.section-sub { font-size: .72rem; color: var(--muted); }
.section-sub.warning { color: var(--orange); }
.tag-note { margin-left: .5rem; font-size: .68rem; color: var(--faint); }

/* ── Social grid ────────────────────────────────────────────────────────── */
.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1rem;
}
@media (max-width: 1100px) {
  .social-grid { grid-template-columns: 1fr 1fr; }
  .card-wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .social-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: .8rem;
  font-family: var(--mono);
  color: var(--cyan);
  margin-bottom: .8rem;
  letter-spacing: .06em;
}

/* ── Ticker cloud ───────────────────────────────────────────────────────── */
.ticker-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.ticker-pill {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: rgba(0,180,255,.12);
  border: 1px solid rgba(0,180,255,.25);
  color: var(--blue);
  cursor: default;
  transition: all .15s;
}
.ticker-pill:hover { background: rgba(0,180,255,.25); }
.ticker-pill.hot { color: var(--gold); border-color: rgba(255,215,0,.4); background: rgba(255,215,0,.08); }
.ticker-pill-count { font-size: .6rem; opacity: .7; margin-left: .2rem; }

/* ── StockTwits list ────────────────────────────────────────────────────── */
.st-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.st-item:last-child { border-bottom: none; }
.st-ticker { font-family: var(--mono); font-size: .8rem; color: var(--blue); font-weight: 700; }
.st-name { font-size: .72rem; color: var(--muted); }
.st-watch { font-size: .7rem; color: var(--cyan); font-family: var(--mono); }

/* ── Reddit posts ───────────────────────────────────────────────────────── */
.reddit-post {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.reddit-post:last-child { border-bottom: none; }
.post-score {
  background: var(--card2);
  border-radius: 6px;
  padding: .25rem .4rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--orange);
  text-align: center;
  min-width: 42px;
  line-height: 1.2;
}
.post-score .val { display: block; font-size: .8rem; font-weight: 700; }
.post-body {}
.post-sub { font-size: .65rem; color: var(--muted); margin-bottom: .15rem; }
.post-title a {
  font-size: .78rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.post-title a:hover { color: var(--blue); }
.post-meta { font-size: .64rem; color: var(--faint); margin-top: .15rem; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.data-table thead {
  background: linear-gradient(90deg, #061424, #0c1e34);
}
.data-table th {
  padding: .65rem .8rem;
  text-align: left;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border2);
}
.data-table td {
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr:hover { background: rgba(0,180,255,.05); }
.data-table tbody tr:last-child td { border-bottom: none; }

.rank-cell { color: var(--faint); font-family: var(--mono); font-size: .7rem; }

.ticker-cell {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .04em;
}
.penny-table .ticker-cell { color: var(--gold); }

.name-cell { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.price-cell { font-family: var(--mono); font-weight: 600; color: var(--text); }

.positive { color: var(--green); font-weight: 600; }
.negative { color: var(--red);   font-weight: 600; }
.neutral  { color: var(--muted); }

.volume-cell { color: var(--muted); font-family: var(--mono); font-size: .74rem; }
.cap-cell    { color: var(--muted); font-family: var(--mono); font-size: .74rem; }
.pe-cell     { color: var(--cyan);  font-family: var(--mono); font-size: .74rem; }
.high-cell   { color: var(--text);  font-family: var(--mono); font-size: .74rem; }

.social-bar {
  display: flex; align-items: center; gap: .4rem;
}
.social-val { font-family: var(--mono); font-size: .72rem; color: var(--gold); }
.social-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .6; }
.social-dot.hot { background: var(--orange); box-shadow: 0 0 4px var(--orange); opacity: 1; }

/* ── Options sections ───────────────────────────────────────────────────── */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 900px) { .options-grid { grid-template-columns: 1fr; } }

.opt-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.calls-panel { border-top: 2px solid var(--green); }
.puts-panel  { border-top: 2px solid var(--red); }

.opt-panel-title {
  padding: .6rem 1rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.calls-title { background: rgba(0,230,118,.06); color: var(--green); }
.puts-title  { background: rgba(255,71,87,.06);  color: var(--red); }

.opt-table { background: var(--card); }
.opt-table th { font-size: .62rem; padding: .5rem .7rem; background: var(--card2); }
.opt-table td { padding: .48rem .7rem; font-size: .75rem; }

.strike-cell { font-family: var(--mono); font-weight: 700; color: var(--text); }
.exp-cell    { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.prem-cell   { font-family: var(--mono); font-weight: 600; }
.calls-panel .prem-cell { color: var(--green); }
.puts-panel  .prem-cell { color: var(--red); }
.vol-cell    { font-family: var(--mono); font-size: .72rem; color: var(--cyan); }
.oi-cell     { font-family: var(--mono); font-size: .72rem; color: var(--blue); }
.iv-cell     { font-family: var(--mono); font-size: .72rem; color: var(--orange); }
.dte-cell    { font-family: var(--mono); font-size: .72rem; }
.dte-cell.urgent { color: var(--red); font-weight: 700; }
.dte-cell.soon   { color: var(--orange); }
.dte-cell.long   { color: var(--muted); }

.empty-row td {
  text-align: center;
  color: var(--faint);
  font-style: italic;
  padding: 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
/* ── Dividend Planner ────────────────────────────────────────────────────── */
.dividend-table .yield-cell   { font-family: var(--mono); font-weight: 700; color: var(--green); }
.dividend-table .div-cell     { font-family: var(--mono); font-size: .74rem; color: var(--text); }
.dividend-table .expense-cell { font-family: var(--mono); font-size: .74rem; color: var(--muted); }

/* ── Dividend Calculator ─────────────────────────────────────────────────── */
.div-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 880px) { .div-calc-grid { grid-template-columns: 1fr; } }

.div-calc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.div-calc-title {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--blue);
  letter-spacing: .03em;
}
.div-calc-field { display: flex; flex-direction: column; gap: .4rem; }
.div-calc-label {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.div-calc-search { position: relative; }
.div-calc-input, .div-calc-shares {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: .55rem .7rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: .8rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.div-calc-input { padding-right: 2rem; }   /* room for the clear (×) button */
.div-calc-input::placeholder, .div-calc-shares::placeholder { color: var(--faint); }
.div-calc-input:focus, .div-calc-shares:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--border);
}

/* Clear (×) button — only visible once the field has a value */
.div-calc-clear {
  position: absolute;
  top: 0; bottom: 0; right: .25rem;
  width: 1.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color .15s;
}
.div-calc-clear:hover { color: var(--text); }
.div-calc-search.has-value .div-calc-clear { display: flex; }
.div-calc-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 250;
  max-height: 240px;
  overflow-y: auto;
}
.div-calc-results:empty,
.div-calc-selected:empty { display: none; }

.div-calc-pick { display: flex; align-items: baseline; gap: .5rem; }
.div-calc-pick-sym { font-family: var(--mono); font-weight: 700; color: var(--blue); font-size: .82rem; }
.div-calc-pick-name {
  font-size: .68rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.div-calc-pick-meta { font-size: .64rem; color: var(--muted); margin-top: .25rem; }
.div-calc-pick-meta strong { color: var(--text); }
.div-calc-loading { font-size: .68rem; color: var(--muted); }
.div-calc-nodiv { font-size: .68rem; color: var(--orange); }

.div-calc-result {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: .9rem;
  text-align: center;
}
.div-calc-result-label {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.div-calc-amount {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--green);
  margin: .3rem 0 .25rem;
}
.div-calc-note { font-size: .6rem; color: var(--faint); }

.footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 2rem;
  font-size: .7rem;
  color: var(--faint);
  text-align: center;
}
.footer-disclaimer { color: var(--muted); margin-bottom: .4rem; line-height: 1.6; }
.footer-disclaimer strong { color: var(--orange); }
.footer-sources { font-size: .65rem; }

/* ── Newly Listed With Potential ─────────────────────────────────────────── */
.newly-listed-table .newly-ticker { color: var(--green); }
.ipo-date-cell { font-family: var(--mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.eps-cell { font-family: var(--mono); font-size: .74rem; color: var(--cyan); }

.new-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(0,230,118,.15);
  color: var(--green);
  border: 1px solid rgba(0,230,118,.35);
  vertical-align: middle;
}
.recent-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(0,180,255,.12);
  color: var(--blue);
  border: 1px solid rgba(0,180,255,.3);
  vertical-align: middle;
}

/* ── Pre-Market Movers ───────────────────────────────────────────────────── */
.premarket-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
@media (max-width: 1200px) { .premarket-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .premarket-grid { grid-template-columns: repeat(2, 1fr); } }

.premarket-empty {
  color: var(--faint);
  font-size: .78rem;
  font-style: italic;
  padding: 1.5rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.premarket-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.premarket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .2rem;
}
.premarket-ticker {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  color: var(--blue);
}
.premarket-name { font-size: .68rem; color: var(--muted); }
.premarket-label-badge {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 4px;
  background: rgba(0,180,255,.12);
  border: 1px solid rgba(0,180,255,.25);
  color: var(--blue);
  letter-spacing: .06em;
  white-space: nowrap;
}
.premarket-price {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.premarket-change {
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 700;
}
.premarket-vol {
  font-size: .68rem;
  color: var(--faint);
}
.premarket-vol span { color: var(--cyan); }
.premarket-catalyst {
  font-size: .68rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: .4rem;
  margin-top: .2rem;
  line-height: 1.35;
  word-break: break-word;
}

/* ── Macro Analysis ──────────────────────────────────────────────────────── */
.macro-grid {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 1rem;
}
@media (max-width: 1100px) { .macro-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px)  { .macro-grid { grid-template-columns: 1fr; } }

.macro-news-card { overflow: hidden; }

.macro-index-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .42rem 0;
  border-bottom: 1px solid var(--border);
}
.macro-index-row:last-child { border-bottom: none; }
.macro-index-name { font-size: .76rem; color: var(--text); }
.macro-index-ticker { font-family: var(--mono); font-size: .64rem; color: var(--faint); }
.macro-index-price { text-align: right; }
.macro-index-price div:first-child {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text);
}

.macro-news-item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.macro-news-item:last-child { border-bottom: none; }
.macro-news-title a {
  font-size: .77rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}
.macro-news-title a:hover { color: var(--blue); }
.macro-news-pub { font-size: .63rem; color: var(--faint); margin-top: .15rem; }

.earnings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .42rem 0;
  border-bottom: 1px solid var(--border);
}
.earnings-item:last-child { border-bottom: none; }
.earnings-ticker {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold);
}
.earnings-date {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  text-align: right;
}
.earnings-soon { color: var(--orange) !important; font-weight: 700; }

/* ── Momentum Screener ───────────────────────────────────────────────────── */
.rsi-cell { font-family: var(--mono); font-size: .74rem; font-weight: 600; }
.rsi-overbought { color: var(--red); }
.rsi-oversold   { color: var(--green); }
.rsi-neutral    { color: var(--cyan); }
.score-cell {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--gold);
  font-weight: 700;
}

/* ── Highly Recommended ──────────────────────────────────────────────────── */
.rec-section {
  border: 1px solid rgba(255,215,0,.28);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem .9rem;
  background: linear-gradient(180deg, rgba(255,215,0,.05) 0%, rgba(255,215,0,0) 55%);
}
.rec-section .section-header h2 { color: var(--gold); }

.rec-action {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
  white-space: nowrap;
}
.rec-action.rec-call  { background: rgba(0,230,118,.12); color: var(--green); border: 1px solid rgba(0,230,118,.35); }
.rec-action.rec-put   { background: rgba(255,71,87,.12);  color: var(--red);   border: 1px solid rgba(255,71,87,.35); }
.rec-action.rec-stock { background: rgba(0,180,255,.12);  color: var(--blue);  border: 1px solid rgba(0,180,255,.35); }

.rec-contract { font-family: var(--mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }

.conviction-wrap { display: flex; align-items: center; gap: .45rem; min-width: 92px; }
.conviction-bar {
  flex: 1;
  height: 5px;
  min-width: 46px;
  background: var(--faint);
  border-radius: 3px;
  overflow: hidden;
}
.conviction-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 3px;
}
.conviction-val { font-family: var(--mono); font-size: .74rem; font-weight: 700; color: var(--gold); }

/* ── Highly Experimental ─────────────────────────────────────────────────── */
.exp-section {
  border: 1px solid rgba(186,104,255,.3);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem .9rem;
  background: linear-gradient(180deg, rgba(186,104,255,.06) 0%, rgba(186,104,255,0) 55%);
}
.exp-section .section-header h2 { color: #c77dff; }

.exp-strategy {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  white-space: nowrap;
  background: rgba(186,104,255,.12);
  color: #c77dff;
  border: 1px solid rgba(186,104,255,.35);
}

.rec-reasons { display: flex; flex-wrap: wrap; gap: .3rem; max-width: 460px; }
.rec-reason {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 9px;
  font-size: .66rem;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Unusual Options Activity ────────────────────────────────────────────── */
.unusual-opt-table .unusual-ticker { color: var(--cyan); }
.call-type { color: var(--green); font-family: var(--mono); font-size: .76rem; font-weight: 700; }
.put-type  { color: var(--red);   font-family: var(--mono); font-size: .76rem; font-weight: 700; }
.calls-prem { color: var(--green); font-family: var(--mono); font-weight: 600; }
.puts-prem  { color: var(--red);   font-family: var(--mono); font-weight: 600; }
.vol-oi-cell {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--orange);
  font-weight: 700;
}

.signal-badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
}
.signal-bullish {
  background: rgba(0,230,118,.1);
  color: var(--green);
  border: 1px solid rgba(0,230,118,.3);
}
.signal-bearish {
  background: rgba(255,71,87,.1);
  color: var(--red);
  border: 1px solid rgba(255,71,87,.3);
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Sticky Nav (Watchlist + Tabs) ───────────────────────────────────────── */
.sticky-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 95;
}

/* ── Watchlist Bar ───────────────────────────────────────────────────────── */
.watchlist-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.6rem;
  background: linear-gradient(90deg, #061424, #0a1c30);
  border-bottom: 1px solid var(--border);
}
.watchlist-bar.hidden { display: none; }

.watchlist-label {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.watchlist-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .7rem;
  flex: 1;
}
@media (max-width: 800px) {
  .watchlist-slots { grid-template-columns: repeat(2, 1fr); }
}

.wl-slot {
  position: relative;
  min-height: 46px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--card);
  transition: border-color .2s, background .2s;
}
.wl-slot.filled { border-color: var(--border2); }
.wl-slot.filled:hover { background: var(--card2); }

.wl-add {
  width: 100%;
  height: 46px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .06em;
  transition: color .2s;
}
.wl-slot:hover .wl-add { color: var(--blue); }

.wl-slot-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
  padding: .45rem .7rem;
  height: 46px;
  cursor: pointer;
}
.wl-symbol {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .04em;
}
.wl-quote { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.wl-quote .wl-price { color: var(--text); }

.wl-clear {
  position: absolute;
  top: 3px; right: 5px;
  background: transparent;
  border: none;
  color: var(--faint);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .15rem;
  transition: color .15s;
}
.wl-clear:hover { color: var(--red); }

.wl-slot.editing { overflow: visible; border-color: var(--blue); }
.wl-input {
  width: 100%;
  height: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: .8rem;
  padding: 0 .7rem;
  letter-spacing: .04em;
}
.wl-input::placeholder { color: var(--faint); }

.wl-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 250;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.wl-result {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .7rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.wl-result:last-child { border-bottom: none; }
.wl-result:hover { background: rgba(0,180,255,.08); }
.wl-r-sym {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
.wl-r-name {
  flex: 1;
  font-size: .68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-r-badge {
  font-family: var(--mono);
  font-size: .56rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 3px;
  letter-spacing: .05em;
  background: rgba(0,180,255,.12);
  color: var(--blue);
  border: 1px solid rgba(0,180,255,.28);
  white-space: nowrap;
}
.wl-noresult {
  padding: .6rem .7rem;
  font-size: .7rem;
  color: var(--faint);
  font-style: italic;
}

/* ── Tab Navigation ──────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 0 1.6rem;
}
.tab-nav.hidden { display: none; }

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: .8rem 1.6rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-content.hidden { display: none; }

/* ── Crypto Social Insights ──────────────────────────────────────────────── */
.crypto-social-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.crypto-social-loading {
  padding: 2rem;
  text-align: center;
  color: var(--faint);
  font-style: italic;
  font-size: .8rem;
}

.social-post-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  align-items: center;
  gap: .8rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.social-post-row:last-child { border-bottom: none; }
.social-post-row:hover { background: rgba(0,180,255,.04); }

.social-rank {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--faint);
  text-align: center;
}
.social-rank.top3 { color: var(--gold); font-weight: 700; font-size: .78rem; }

.social-post-body { min-width: 0; }

.social-post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
  flex-wrap: wrap;
}

.social-platform-badge {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: rgba(255,69,0,.15);
  color: #ff6534;
  border: 1px solid rgba(255,69,0,.3);
  letter-spacing: .05em;
  white-space: nowrap;
}

.social-source {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--blue);
}

.social-flair {
  font-size: .62rem;
  color: var(--muted);
  background: var(--card2);
  padding: .08rem .35rem;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-post-title a {
  font-size: .8rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}
.social-post-title a:hover { color: var(--blue); }

.social-post-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
  min-width: 80px;
}

.social-stat-row {
  display: flex;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .68rem;
  white-space: nowrap;
}

.social-upvotes { color: var(--orange); }
.social-comments { color: var(--cyan); }
.social-age { color: var(--faint); font-size: .63rem; }

.social-viral-badge {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 3px;
  background: rgba(255,149,0,.15);
  color: var(--orange);
  border: 1px solid rgba(255,149,0,.3);
  letter-spacing: .05em;
}

/* ── Crypto Grid ─────────────────────────────────────────────────────────── */
.crypto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
@media (max-width: 900px) { .crypto-grid { grid-template-columns: 1fr; } }

.crypto-table .crypto-ticker {
  color: var(--gold);
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
}

/* ── Theme Dropdown ──────────────────────────────────────────────────────── */
.theme-selector { position: relative; }

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: .35rem .9rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  transition: all .2s;
  white-space: nowrap;
}
.theme-toggle-btn span { color: var(--blue); }
.theme-toggle-btn:hover { background: rgba(0,180,255,.08); border-color: var(--blue); }

.theme-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 140px;
  z-index: 200;
}
.theme-menu.open { display: block; }

.theme-item {
  padding: .55rem 1rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.theme-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.theme-item.active { color: var(--blue); }
.theme-item + .theme-item { border-top: 1px solid var(--border); }

/* ── Rare Earth Theme ────────────────────────────────────────────────────── */
[data-theme="rare-earth"] {
  --bg:       #0e0b06;
  --bg2:      #141009;
  --card:     #1a160e;
  --card2:    #211c11;
  --border:   rgba(212,175,55,.14);
  --border2:  rgba(212,175,55,.40);
  --blue:     #d4af37;
  --cyan:     #b8b4a8;
  --green:    #6dbe6d;
  --red:      #e05555;
  --orange:   #cd7f32;
  --gold:     #f0c040;
  --text:     #ede0c4;
  --muted:    #8a7a62;
  --faint:    #33281a;
  --shadow:   0 6px 30px rgba(0,0,0,.72);
}

[data-theme="rare-earth"] .header {
  background: linear-gradient(90deg, #080600 0%, #130f08 50%, #080600 100%);
}

[data-theme="rare-earth"] .data-table thead {
  background: linear-gradient(90deg, #0a0804, #181410);
}

[data-theme="rare-earth"] .ticker-pill {
  background: rgba(212,175,55,.10);
  border-color: rgba(212,175,55,.28);
}
[data-theme="rare-earth"] .ticker-pill:hover { background: rgba(212,175,55,.20); }

[data-theme="rare-earth"] .data-table tbody tr:hover { background: rgba(212,175,55,.04); }

[data-theme="rare-earth"] .theme-toggle-btn:hover { background: rgba(212,175,55,.08); }

[data-theme="rare-earth"] .premarket-label-badge {
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.28);
}

[data-theme="rare-earth"] .watchlist-bar {
  background: linear-gradient(90deg, #0a0804, #161108);
}
[data-theme="rare-earth"] .wl-result:hover { background: rgba(212,175,55,.08); }
[data-theme="rare-earth"] .wl-r-badge {
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.28);
}
