/* Shared by every StonkDash page: palette, top bar, ticker tape, header, footer. */
:root {
  --bg: #050608;
  --panel: #0b0d11;
  --row: #10131a;
  --line: #1e232c;
  --amber: #ffb000;
  --cyan: #3ce8ff;
  --magenta: #ff3cac;
  --text: #eef1f5;
  --muted: #7d8696;
  --up: #2fe26a;
  --down: #ff4d4d;
  --menu: #000;          /* dropdowns, tooltips, selects */
  --hover: #1a1f28;
  --row-hover: #171b24;
  --chip-on: #1a1508;    /* selected chip background */
  --fav-a: rgba(60,232,255,.22);
  --fav-b: rgba(60,232,255,.06);
  --fav-glow: rgba(60,232,255,.35);
  --rank-l: 52%;         /* lightness of the rank gradient */
  --dot: #000;           /* chart dot fill */
  color-scheme: dark;
}
/* Light mode (toggle in the top bar; choice remembered per browser) */
:root[data-theme="light"] {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --row: #f6f7f9;
  --line: #d8dce2;
  --amber: #c98100;
  --cyan: #00808f;
  --magenta: #c4237f;
  --text: #11151b;
  --muted: #5b6574;
  --up: #128a3c;
  --down: #c92a2a;
  --menu: #ffffff;
  --hover: #eef1f5;
  --row-hover: #eceff3;
  --chip-on: #fff4dc;
  --fav-a: rgba(0,128,143,.16);
  --fav-b: rgba(0,128,143,.04);
  --fav-glow: rgba(0,128,143,.25);
  --rank-l: 40%;
  --dot: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; }
.pixel { font-family: 'Press Start 2P', monospace; }

/* Tab row under the logo: page tabs on the left, favourite-ticker picker on the right */
.tabs { position: relative; z-index: 20; display: flex; align-items: flex-end; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs .tab { display: block; padding: 10px 20px 9px; font-weight: 700; font-size: 12.5px; letter-spacing: .12em; text-decoration: none;
  color: var(--muted); opacity: .55; border: 1px solid var(--line); border-bottom: 0; margin-bottom: -1px; background: transparent; }
.tabs .tab:hover, .tabs .tab:focus-visible { opacity: 1; color: var(--text); outline: none; }
.tabs .tab[aria-current="page"] { opacity: 1; color: var(--amber); background: var(--panel); border-top: 2px solid var(--amber); padding-top: 9px;
  border-bottom: 1px solid var(--panel); }
.tab-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 0 0 7px; font-weight: 700; font-size: 11.5px; }
.fav-label { letter-spacing: .5px; color: var(--muted); }
.picker { position: relative; }
.picker-btn { display: flex; align-items: center; gap: 8px; height: 24px; min-width: 190px; padding: 0 8px; cursor: pointer;
  background: var(--menu); color: var(--amber); border: 1px solid var(--line); font: inherit; font-weight: 700; }
.picker-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.picker-btn img, .opt img { width: 16px; height: 16px; object-fit: cover; }
.picker-btn .chev { margin-left: auto; font-size: 9px; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; width: 260px; max-height: 60vh; overflow-y: auto;
  background: var(--menu); border: 1px solid var(--amber); box-shadow: 0 10px 30px rgba(0,0,0,.35); display: none; }
.menu.open { display: block; }
.opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; background: none; border: 0;
  color: var(--text); font: inherit; font-weight: 500; font-size: 12px; text-align: left; cursor: pointer; }
.opt:hover, .opt:focus-visible { background: var(--hover); outline: none; }
.opt[aria-selected="true"] { color: var(--cyan); }
.opt .mc { margin-left: auto; color: var(--muted); font-size: 11px; }
.clear { color: var(--muted); background: none; border: 1px solid var(--line); font: inherit; font-size: 10.5px; padding: 2px 6px; cursor: pointer; }
.caret { display: inline-block; width: 7px; height: 12px; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Ticker tape */
.tape { border-bottom: 1px solid var(--line); background: #000; overflow: hidden; height: 30px; }
.tape-track { display: inline-flex; gap: 28px; padding-left: 100%; white-space: nowrap; height: 100%; align-items: center;
  animation: scroll 80s linear infinite; font-size: 12.5px; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-100%); } }
.tk { display: inline-flex; align-items: center; gap: 6px; }
.tk img { width: 16px; height: 16px; object-fit: cover; }
.tk b { color: var(--amber); font-weight: 700; }
.tk.fav { background: rgba(60,232,255,.15); outline: 1px solid var(--cyan); padding: 2px 6px; }
.tk.fav b { color: var(--cyan); }
.tk .up { color: var(--up); } .tk .down { color: var(--down); }

/* Header */
header { padding: 26px 20px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: clamp(22px, 3.4vw, 36px); letter-spacing: 1px; color: var(--amber); text-shadow: 3px 3px 0 #6b2c00; }
h1 .d { color: var(--cyan); text-shadow: 3px 3px 0 #00525c; }
.meta { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-left: auto; }
.meta b { color: var(--text); font-weight: 500; }
.legend { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 90px; height: 6px;
  background: linear-gradient(90deg, hsl(135 85% 48%), hsl(55 95% 52%), hsl(0 85% 55%)); }


@media (max-width: 560px) {
  .fav-label { display: none; }
  .tabs { padding: 0 10px; }
  .tabs .tab { padding: 9px 11px 8px; font-size: 11px; letter-spacing: .06em; }
  .tab-tools { margin-left: 0; width: 100%; padding: 8px 0; }
  .picker-btn { min-width: 120px; }
}
footer { padding: 0 20px 36px; color: var(--muted); font-size: 11.5px; line-height: 1.7; max-width: 1100px; }
footer a { color: var(--text); }

/* Logo links back to the tables page */
h1 a.home { color: inherit; text-decoration: none; }
h1 a.home:hover { filter: brightness(1.15); }

/* Light / dark toggle (top right of the top bar) */
.theme-btn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; background: transparent;
  color: var(--text); border: 1px solid var(--line); font-size: 16px; line-height: 1; padding: 0; }
.theme-btn:hover, .theme-btn:focus-visible { border-color: var(--amber); color: var(--amber); outline: none; }

/* Global analysis window toggle (7D / 30D / 60D), in the tab row */
.period { display: inline-flex; align-items: center; border: 1px solid var(--line); margin-right: 8px; }
.period-lbl { color: var(--muted); font-size: 10.5px; letter-spacing: .1em; padding: 0 8px; font-weight: 700; }
.period button { background: none; border: 0; border-left: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; padding: 5px 10px; cursor: pointer; }
.period button:hover { color: var(--text); }
.period button[aria-pressed="true"] { background: var(--chip-on); color: var(--amber); }
.period button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
@media (max-width: 560px) { .period-lbl { display: none; } }
.period [data-top] { white-space: nowrap; }
@media (max-width: 640px) { .tab-tools { flex-wrap: wrap; } }

/* ---- StonkDash Pro ---- */
:root { --pro: var(--cyan); --pro-ink: #04161c; } /* the blue of DASH in the logo */
:root[data-theme="light"] { --pro-ink: #fff; }
.pro-tag { display: inline-block; background: var(--pro); color: var(--pro-ink); font-size: 9px; font-weight: 700; letter-spacing: .08em; padding: 2px 5px; line-height: 1.2; vertical-align: middle; border-radius: 2px; }
.pro-lock { font-style: normal; background: var(--pro); color: var(--pro-ink); font-size: 8px; padding: 1px 3px; margin-left: 4px; border-radius: 2px; vertical-align: 1px; }
.pro-btn { flex: none; height: 32px; padding: 0 12px; margin-right: 8px; cursor: pointer; background: var(--pro); color: var(--pro-ink); border: 1px solid var(--pro); font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; }
.pro-btn:hover, .pro-btn:focus-visible { filter: brightness(1.12); outline: 2px solid var(--text); outline-offset: 1px; }
.pro-btn.on { background: transparent; color: var(--pro); }
.pro-btn b { font-weight: 700; }
.pro-btn[hidden] { display: none; }
/* Locked content: blurred, with a call to action on top */
.pro-blur { position: relative; }
.pro-blur > .pro-inner { filter: blur(6px); pointer-events: none; user-select: none; }
.pro-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 60px; gap: 10px; z-index: 3; text-align: center; }
.pro-cta button { background: var(--pro); color: var(--pro-ink); border: 0; font: inherit; font-weight: 700; font-size: 13px; letter-spacing: .1em; padding: 12px 20px; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.pro-cta button:hover, .pro-cta button:focus-visible { filter: brightness(1.12); outline: 2px solid var(--text); outline-offset: 2px; }
.pro-cta small { color: var(--text); font-size: 12px; background: var(--panel); padding: 4px 10px; border: 1px solid var(--line); }
/* Dialog */
.pro-dlg { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; padding: 16px; }
.pro-dlg.open { display: flex; }
.pro-card { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--pro); padding: 26px 24px 20px; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.pro-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.pro-x:hover { color: var(--text); }
.pro-kicker { font-size: 11px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.pro-card h2 { margin: 8px 0 12px; font-size: 22px; line-height: 1.2; }
.pro-note { color: var(--pro); font-size: 12px; margin: 0 0 10px; }
.pro-perks { margin: 0 0 14px; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.9; }
.pro-card .pro-perks li { display: block; grid-template-columns: none; padding: 0; margin: 0; background: none; border: 0; min-height: 0; animation: none; opacity: 1; transform: none; }
.pro-perks li::before { content: '✓  '; color: var(--pro); font-weight: 700; }
.pro-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
.pro-sub b { color: var(--text); }
.pro-wallets { display: flex; flex-direction: column; gap: 8px; }
.pro-go { display: block; width: 100%; background: var(--pro); color: var(--pro-ink); border: 0; font: inherit; font-weight: 700; font-size: 13px; letter-spacing: .1em; padding: 12px; cursor: pointer; }
.pro-go:hover, .pro-go:focus-visible { filter: brightness(1.12); outline: 2px solid var(--text); outline-offset: 1px; }
.pro-fine { font-size: 10.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.pro-link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; font: inherit; cursor: pointer; }
.pro-err { color: var(--down); font-size: 12px; margin: 0 0 12px; line-height: 1.5; }
.pro-busy { display: flex; align-items: center; gap: 12px; font-size: 12.5px; padding: 18px 0 10px; line-height: 1.5; }
.pro-spin { flex: none; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--pro); border-radius: 50%; animation: prospin .8s linear infinite; }
@keyframes prospin { to { transform: rotate(360deg); } }
@media print { .pro-btn, .pro-dlg { display: none !important; } }

/* Loading screen (switching the analysis window) */
.load-screen { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(5,6,8,.55); backdrop-filter: blur(2px); }
:root[data-theme="light"] .load-screen { background: rgba(243,244,246,.6); }
.load-screen.on { display: flex; }
.load-box { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--amber); padding: 18px 24px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.load-box .pixel { font-size: 11px; color: var(--amber); letter-spacing: 1px; }
.load-dots::after { content: ''; display: inline-block; width: 18px; color: var(--amber); font-family: 'Press Start 2P', monospace; font-size: 11px; animation: loaddots 1.2s steps(4) infinite; }
@keyframes loaddots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.load-spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: prospin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .load-spin, .load-dots::after { animation: none; } }

/* [BETA] tag on a tab */
.tabs .tab .beta { display: inline-block; margin-left: 5px; padding: 1px 4px; border: 1px solid currentColor; font-size: 8.5px; letter-spacing: .08em; line-height: 1.3; vertical-align: 2px; opacity: .85; }

/* CONNECT (wallet) button in the header */
.conn { position: relative; flex: none; margin-right: 8px; display: flex; align-items: center; gap: 8px; }
.wl-link { height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; }
.wl-link:hover, .wl-link:focus-visible { border-color: var(--amber); color: var(--amber); outline: none; }
.wl-link.on { border-color: var(--amber); color: var(--amber); background: var(--chip-on); }
@media (max-width: 560px) { .wl-link { padding: 0 8px; font-size: 10.5px; } }
.conn-btn { height: 32px; padding: 0 12px; cursor: pointer; background: transparent; color: var(--amber); border: 1px solid var(--amber); font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; display: inline-flex; align-items: center; gap: 7px; }
.conn-btn:hover, .conn-btn:focus-visible { background: var(--chip-on); outline: none; }
.conn-btn.on { color: var(--text); border-color: var(--line); letter-spacing: .02em; }
.conn-btn .chev { font-size: 9px; color: var(--muted); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 6px var(--up); }
.conn-menu { position: absolute; right: 0; top: 38px; z-index: 40; min-width: 170px; background: var(--menu); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; }
.conn-menu[hidden] { display: none; }
.conn-menu a, .conn-menu button { padding: 10px 14px; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; }
.conn-menu a:hover, .conn-menu button:hover { background: var(--hover); color: var(--amber); }
.conn-menu button { color: var(--muted); }
.conn-go { background: var(--amber) !important; color: #000 !important; }
@media (max-width: 560px) { .conn-btn { padding: 0 8px; font-size: 10.5px; } }
@media print { .conn { display: none !important; } }

/* Wallet choices in the connect / Pro dialogs */
.pro-wallets { max-height: 320px; overflow-y: auto; }
.wallet-go { display: flex !important; align-items: center; justify-content: center; gap: 10px; text-decoration: none; text-align: center; }
.wallet-go img { width: 22px; height: 22px; border-radius: 5px; flex: none; }
.pro-wallets.deep { flex-direction: row; gap: 8px; }

/* Wallet menu: Upgrade to Pro */
.conn-menu .conn-pro { color: var(--pro-ink); background: var(--pro); }
.conn-menu .conn-pro:hover { color: var(--pro-ink); background: var(--pro); filter: brightness(1.1); }
.conn-menu .conn-pro.done { background: none; color: var(--pro); }
.conn-menu .conn-pro + button { border-top: 1px solid var(--line); }
.conn-btn .pro-tag { margin-left: 2px; }

/* Logo: in the pixel font the T is a pixel narrower than the other letters, which leaves a wider gap after the S.
   Pull the T in by one font pixel (1/8 em) so every letter in STONKDASH sits the same distance apart. */
.k-s { margin-right: -0.125em; }

/* Logo when signed in with Pro: STONKDASH PRO, the PRO greyed out and semi-transparent */
.logo-pro { margin-left: 0.4em; color: var(--muted); opacity: 0.5; }

/* Donate */
.donate-btn { background: none; cursor: pointer; font-family: inherit; color: var(--cyan); }
.donate-btn:hover, .donate-btn:focus-visible { border-color: var(--cyan); color: var(--cyan); }
.dn-addr { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); padding: 8px 10px; margin: 10px 0 14px; }
.dn-addr code { flex: 1; font-size: 11.5px; word-break: break-all; color: var(--text); }
.dn-addr button { flex: none; height: 28px; padding: 0 10px; border: 1px solid var(--cyan); background: none; color: var(--cyan); font: 700 10.5px 'JetBrains Mono', monospace; letter-spacing: .08em; cursor: pointer; }
.dn-amts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.dn-amts button { height: 32px; padding: 0 12px; border: 1px solid var(--line); background: none; color: var(--text); font: 700 11.5px 'JetBrains Mono', monospace; cursor: pointer; }
.dn-amts button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: var(--chip-on); }
.dn-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.dn-custom input { width: 84px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 11.5px 'JetBrains Mono', monospace; }
.pro-fine a { color: var(--cyan); }

.dn-cur { display: inline-flex; border: 1px solid var(--line); margin: 6px 0 10px; }
.dn-cur button { height: 30px; padding: 0 16px; border: 0; background: none; color: var(--muted); font: 700 11.5px 'JetBrains Mono', monospace; letter-spacing: .08em; cursor: pointer; }
.dn-cur button[aria-pressed="true"] { background: var(--chip-on); color: var(--amber); }
.dn-line { margin: 0 0 14px; font-size: 13px; color: var(--text); }
.dn-line span { color: var(--muted); font-size: 11.5px; }
.dn-with { margin-bottom: 6px; }
.dn-alt { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.dn-alt-h { margin: 0 0 6px; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.dn-alt .dn-addr { margin: 0; }

/* Share on X: small, semi-transparent, top right of each analysis area */
.xshare { position: absolute; top: 6px; right: 6px; z-index: 3; width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text); opacity: .35; cursor: pointer; }
.xshare:hover, .xshare:focus-visible { opacity: 1; color: var(--cyan); outline: none; }
.conn-menu .conn-admin { display: block; padding: 10px 14px; color: var(--cyan); text-decoration: none; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.conn-menu .conn-admin[hidden] { display: none; }
.conn-menu .conn-admin:hover { background: var(--chip-on); }

/* Site-wide legal bar under each page's footer, and the /disclaimer page */
.legal-bar { border-top: 1px solid var(--line); background: var(--panel); padding: 14px 20px 18px; font-size: 11px; line-height: 1.65; color: var(--muted); }
.legal-bar p { margin: 0; max-width: 1100px; }
.legal-bar b { color: var(--amber); letter-spacing: .08em; }
.legal-bar a { color: var(--cyan); font-weight: 700; white-space: nowrap; }
.legal-bar a:hover, .legal-bar a:focus-visible { color: var(--amber); }
.legal { max-width: 820px; padding: 24px 20px 40px; font-size: 13px; line-height: 1.75; }
.legal h2 { margin: 30px 0 8px; font-size: 13px; letter-spacing: .12em; color: var(--amber); }
.legal h2:first-of-type { margin-top: 18px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin-bottom: 4px; }
.legal .lede { border: 1px solid var(--amber); background: var(--chip-on); padding: 14px 16px; font-weight: 500; }
.legal .upd { color: var(--muted); font-size: 11.5px; }
.legal a { color: var(--cyan); }
@media (max-width: 560px) { .legal-bar { padding: 12px 12px 16px; } .legal { padding: 18px 12px 32px; font-size: 12.5px; } }
