/* First paint: shell, hero, and reserved boxes. Full stylesheets load after this. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.64%;
  ascent-override: 90%;
  descent-override: 22.43%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root, [data-theme="light"] {
  --bg: #f3f4f8;
  --bg-2: #ffffff;
  --bg-3: #eef0f6;
  --panel: #ffffff;
  --border: rgba(18, 20, 26, 0.08);
  --text: #12141a;
  --muted: #5e6772;
  --accent: #6d4ef0;
  --accent-hover: #5838e6;
  --accent-soft: rgba(109, 78, 240, 0.12);
  --green: #0e9f6e;
  --red: #e11d48;
  --green-soft: rgba(14, 159, 110, 0.12);
  --red-soft: rgba(225, 29, 72, 0.12);
  --font: "Inter", "Inter Fallback", system-ui, sans-serif;
  --sidebar-bg: rgba(255, 255, 255, 0.8);
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --shell-border: rgba(18, 20, 26, 0.08);
  --shell-hover: rgba(109, 78, 240, 0.08);
  --shell-active: #ffffff;
  --search-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.06);
}

[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-2: #12151c;
  --bg-3: #1a1e28;
  --panel: #141821;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f6fb;
  --muted: #9aa3b2;
  --accent: #8b6cf6;
  --sidebar-bg: rgba(14, 16, 22, 0.92);
  --topbar-bg: rgba(14, 16, 22, 0.82);
  --shell-border: rgba(255, 255, 255, 0.08);
  --shell-active: #1c2030;
  --search-bg: #1a1e28;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.011em;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { max-width: 100%; }

.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 256px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--shell-border);
  display: flex;
  flex-direction: column;
  padding-top: 16px;
}
.main-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--shell-border);
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-logo { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 15px; letter-spacing: -0.03em; }
.topbar-logo .brand-mark-svg { width: 22px; height: 22px; }
.topbar-search, .search-wrap { flex: 1; min-width: 0; max-width: 440px; position: relative; }
.search-field { position: relative; }
.topbar-search input, .search-wrap input {
  width: 100%;
  height: 34px;
  background: var(--search-bg);
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  color: var(--text);
  padding: 0 1rem 0 2.5rem;
  font-size: 14px;
}
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-toggle { display: none; width: 40px; height: 40px; }
.btn-icon, .alert-bell-btn, .topbar .ask-ai-fab { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.alert-bell { position: relative; }
.alert-bell-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
}
.page-content { flex: 1; width: 100%; min-width: 0; padding: 12px 40px 64px; }
.page-title { margin: 0; font-size: 2.25rem; font-weight: 650; letter-spacing: -0.045em; line-height: 1.1; min-height: 1.1em; }
.btn-primary { border: 0; border-radius: 999px; padding: 10px 16px; background: var(--accent); color: #fff; }

.market-board { min-height: 260px; margin-bottom: 24px; }
.market-col { min-height: 248px; }
.home-screener { min-height: 560px; }
.screener-section { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.home-screener .screener-table-wrap { min-height: 640px; }
#tabContent { min-height: 520px; }
#ssr { min-height: 280px; }
.cookie-banner {
  position: fixed;
  z-index: 80;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin: 0 auto;
}
.table-search-input { width: 100%; height: 40px; }

.stock-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}
.stock-hero-title { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.05; min-height: 1.05em; }
.stock-price { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stock-symbol, .company-name { color: var(--muted); }
.stock-chart-wrap { height: 240px; position: relative; }
.linked-price-chart { width: 100%; height: 200px; }
.linked-score-chart { height: 120px; }
.chart-stats { min-height: 2.75rem; }
#technical-analysis .stock-panel-body { min-height: 420px; }
.stock-hero .score-gauge-pending { min-height: 136px; }
.stock-hero .skeleton-score { width: 240px; height: 136px; }
.signup-banner { min-height: 92px; }

@media (max-width: 1100px) {
  .stock-hero { grid-template-columns: 1fr; min-height: 0; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .app-shell > .sidebar {
    position: fixed;
    width: min(280px, 86vw);
    height: 100vh;
    transform: translate3d(-110%, 0, 0);
    visibility: hidden;
  }
  .main-column { width: 100%; max-width: 100%; }
  .page-content { padding: 12px 16px 48px; }
  .nav-toggle { display: inline-flex; }
  .page-title { font-size: 1.7rem; }
  .stock-hero { min-height: 280px; padding: 10px 12px; }
  .stock-hero .score-gauge-pending { min-height: 52px; }
  .market-board, .market-col { min-height: 248px; }
}
.compare-rich .cmp-plot { height: 280px; min-height: 280px; }
.compare-rich .table-scroll { overflow-x: auto; }
@media (max-width: 720px) {
  .compare-rich .cmp-plot, .compare-rich .cmp-chart-svg { height: 240px; min-height: 240px; }
}
