@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
  --bg:              #060608;
  --surface:         #0b0b10;
  --surface-raised:  #0f0f16;
  --surface-hover:   #131319;

  --border:          #16161e;
  --border-bright:   #1e1e28;

  --orange:          #f97316;
  --orange-light:    #fb923c;
  --orange-dim:      rgba(249, 115, 22, 0.07);
  --orange-glow:     0 0 32px rgba(249, 115, 22, 0.10);

  --text:            #dddde8;
  --text-secondary:  #7878a0;
  --text-muted: #999;

  --green:           #22c55e;
  --green-dim:       rgba(34, 197, 94, 0.08);
  --red:             #f43f5e;
  --red-dim:         rgba(244, 63, 94, 0.08);
  --yellow:          #eab308;
  --yellow-dim:      rgba(234, 179, 8, 0.08);
  --blue:            #60a5fa;
  --blue-dim:        rgba(96, 165, 250, 0.08);
  --purple:          #a78bfa;
  --purple-dim:      rgba(167, 139, 250, 0.08);

  --font:            'IBM Plex Mono', 'Courier New', monospace;
  --nav-h:           52px;
  --banner-h:        30px;
  --radius:          3px;
  --max-w:           1380px;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* subtle warm ambient glow */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 60%, rgba(249,115,22,.03) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 20%, rgba(249,115,22,.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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

/* ─── Free-Data Banner ───────────────────────────────────────────── */
.banner {
  height: var(--banner-h);
  background: var(--orange-dim);
  border-bottom: 1px solid rgba(249,115,22,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: rgba(249,115,22,.85);
  position: sticky;
  top: 0;
  z-index: 200;
}
.banner-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .4; }
.banner strong { color: var(--orange); font-weight: 600; }

/* ─── Navigation ─────────────────────────────────────────────────── */
.nav {
  height: var(--nav-h);
  background: rgba(11,11,16,.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 0;
  position: sticky;
  top: var(--banner-h);
  z-index: 199;
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-right: 36px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 1px;
}
.nav-logo .accent { color: var(--orange); }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  padding: 5px 12px;
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.nav-link:hover  { color: var(--text); background: var(--surface-hover); }
.nav-link.active { color: var(--orange); }
.nav-pill {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--orange);
  border: 1px solid rgba(249,115,22,.22);
  border-radius: var(--radius);
}
/* live dot animation */
.nav-pill::before {
  content: '●';
  margin-right: 5px;
  font-size: 7px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ─── Email signup bar (row 2 of nav) ───────────────────────────── */
.nav-email-bar { background: rgba(6,6,8,.96); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; padding: 0 28px; height: 40px; position: sticky; top: 52px; z-index: 99; backdrop-filter: blur(8px); }
.nav-email-bar-form { display: flex; align-items: center; gap: 12px; }
.nav-email-bar-label { font-size: 10px; letter-spacing: .07em; color: var(--text-muted); white-space: nowrap; }
.nav-email-bar-input { height: 26px; padding: 0 10px; background: var(--surface); border: 1px solid var(--border-bright); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 10.5px; width: 200px; outline: none; transition: border-color .15s; }
.nav-email-bar-input::placeholder { color: var(--text-muted); }
.nav-email-bar-input:focus { border-color: rgba(249,115,22,.4); }
.nav-email-bar-btn { height: 26px; padding: 0 14px; background: var(--orange); border: none; border-radius: var(--radius); color: #000; font-family: var(--font); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; white-space: nowrap; transition: opacity .15s; }
.nav-email-bar-btn:hover { opacity: .85; }
@media (max-width: 767px) {
  .nav-email-bar { padding: 0 16px; }
  .nav-email-bar-form { width: 100%; gap: 6px; }
  .nav-email-bar-label { display: none; }
  .nav-email-bar-input { flex: 1; width: auto; min-width: 0; }
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
main { flex: 1; }

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249,115,22,.3), transparent);
}
.hero .container { display: flex; flex-direction: column; gap: 10px; }
.hero-eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--orange);
  opacity: .6;
}
.hero-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.15;
}
.hero-title em { font-style: normal; color: var(--orange); }
.hero-sub { font-size: 12.5px; color: var(--text-secondary); max-width: 520px; margin-top: 2px; }

/* ─── Search ─────────────────────────────────────────────────────── */
.search-row { display: flex; gap: 8px; max-width: 480px; margin-top: 20px; }
.search-input {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
.search-btn {
  padding: 9px 18px;
  background: var(--orange);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  transition: background .15s;
}
.search-btn:hover { background: var(--orange-light); }

/* ─── Section ────────────────────────────────────────────────────── */
.section { padding: 36px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.section-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.section-count { font-size: 10px; color: var(--text-muted); }

/* ─── Table ──────────────────────────────────────────────────────── */
.tbl-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tbl thead tr {
  background: var(--surface);
  border-bottom: 1px solid var(--border-bright);
}
.tbl th {
  padding: 10px 16px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--orange);
  white-space: nowrap;
  user-select: none;
}
.tbl th.r, .tbl td.r { text-align: right; }

.tbl tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background .1s;
}
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--orange);
  opacity: 0;
  transition: opacity .12s;
}
.tbl tbody tr:hover { background: var(--surface-hover); }
.tbl tbody tr:hover::before { opacity: 1; }

.tbl td { padding: 11px 16px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td:last-child { white-space: normal; overflow: visible; }
.tbl td.primary { font-weight: 500; color: var(--text); }
.tbl td.primary a { transition: color .12s; }
.tbl td.primary a:hover { color: var(--orange); }
.cell-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ─── Badges ─────────────────────────────────────────────────────── */
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 2px;
  white-space: nowrap;
}
.b-orange { background: var(--orange-dim);  color: var(--orange);  border: 1px solid rgba(249,115,22,.18); }
.b-green  { background: var(--green-dim);   color: var(--green);   border: 1px solid rgba(34,197,94,.18); }
.b-red    { background: var(--red-dim);     color: var(--red);     border: 1px solid rgba(244,63,94,.18); }
.b-yellow { background: var(--yellow-dim);  color: var(--yellow);  border: 1px solid rgba(234,179,8,.18); }
.b-blue   { background: var(--blue-dim);    color: var(--blue);    border: 1px solid rgba(96,165,250,.18); }
.b-purple { background: var(--purple-dim);  color: var(--purple);  border: 1px solid rgba(167,139,250,.18); }
.b-gray   { background: rgba(120,120,150,.07); color: var(--text-secondary); border: 1px solid rgba(120,120,150,.14); }

/* ─── Weight Bar (in table) ──────────────────────────────────────── */
.w-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.w-pct { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.w-track { width: 72px; height: 3px; background: var(--border-bright); border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.w-fill  { height: 100%; background: var(--orange); border-radius: 2px; transition: width .5s cubic-bezier(.16,1,.3,1); }

/* ─── Ticker tag ─────────────────────────────────────────────────── */
.ticker {
  display: inline-block;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-radius: 2px;
}

/* ─── Manager Header (manager.html) ─────────────────────────────── */
.mgr-header {
  padding: 44px 0 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.mgr-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249,115,22,.25), transparent);
}
.mgr-header .container { display: flex; flex-direction: column; gap: 12px; }
.breadcrumb { font-size: 10px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.breadcrumb a:hover { color: var(--text-secondary); }
.mgr-name { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.mgr-desc { font-size: 12px; color: var(--text-secondary); max-width: 580px; }
.stats-row { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 6px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-lbl { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.stat-val { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-val.hi { color: var(--orange); }

/* ─── Bar Chart ──────────────────────────────────────────────────── */
.chart-wrap {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.chart-label-row {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.chart-bars { display: flex; flex-direction: column; gap: 9px; }
.chart-row { display: flex; align-items: center; gap: 12px; }
.chart-name {
  width: 180px;
  font-size: 10.5px;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
}
.chart-track {
  flex: 1;
  height: 22px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  max-width: 640px;
}
.chart-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--orange) 0%, rgba(249,115,22,.55) 100%);
  transition: width .7s cubic-bezier(.16,1,.3,1);
}
.chart-fill-pct {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 500;
  color: var(--text);
  z-index: 1;
  text-shadow: 0 0 8px rgba(0,0,0,.8);
}

/* ─── Result Cards (stock.html) ─────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  padding-top: 4px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.result-card:hover {
  border-color: rgba(249,115,22,.3);
  box-shadow: var(--orange-glow);
}
.rc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rc-mgr { font-size: 13px; font-weight: 600; color: var(--text); }
.rc-pm  { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.rc-pct { font-size: 26px; font-weight: 700; color: var(--orange); letter-spacing: -.03em; line-height: 1; }
.rc-pct-lbl { font-size: 9px; color: var(--text-muted); margin-top: 2px; text-align: right; }
.rc-stats { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 14px; }
.rc-row { display: flex; justify-content: space-between; font-size: 11px; }
.rc-key { color: var(--text-muted); }
.rc-val { color: var(--text); font-variant-numeric: tabular-nums; }

/* ─── Rank number ────────────────────────────────────────────────── */
.rank { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ─── Loading / Empty ────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 56px 0; color: var(--text-muted); font-size: 12px;
}
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--border-bright);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 64px 0; text-align: center; color: var(--text-muted); font-size: 12px; line-height: 2; }
.empty strong { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 28px;
  margin-top: auto;
}
.footer .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.footer-logo { font-size: 12.5px; font-weight: 700; letter-spacing: -.02em; }
.footer-logo .accent { color: var(--orange); }
.footer-copy { font-size: 10.5px; color: var(--text-muted); text-align: center; flex: 1; }
.footer-copy a { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; opacity: .8; }
.footer-copy a:hover { opacity: 1; }

/* ─── Misc utilities ─────────────────────────────────────────────── */
.mono { font-variant-numeric: tabular-nums; }
.up   { color: var(--green); }
.down { color: var(--red); }
.dim  { color: var(--text-secondary); }

/* ─── Info tooltip ───────────────────────────────────────────────── */
.tip-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.tip-icon {
  font-size: 10px; color: var(--text-muted); cursor: help; line-height: 1;
  border: 1px solid var(--border-bright); border-radius: 50%;
  width: 13px; height: 13px; display: inline-flex; align-items: center;
  justify-content: center; font-style: normal; flex-shrink: 0;
}
.tip-box {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  width: 210px; background: var(--surface-raised);
  border: 1px solid var(--border-bright); border-radius: var(--radius);
  padding: 7px 10px; font-size: 10px; color: var(--text-secondary);
  line-height: 1.5; white-space: normal;
  opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 50;
}
.tip-wrap:hover .tip-box { opacity: 1; }

/* ─── QoQ Changes section ────────────────────────────────────────── */
.changes-wrap {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.changes-title {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.changes-title span { color: var(--text-muted); font-size: 9px; }
.changes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.changes-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.changes-group-head {
  padding: 7px 12px;
  font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.changes-group-head .cnt {
  margin-left: auto; font-size: 10px; font-weight: 400;
  color: var(--text-muted);
}
.ch-new     .changes-group-head { color: var(--green);  background: var(--green-dim); }
.ch-exited  .changes-group-head { color: var(--red);    background: var(--red-dim); }
.ch-added   .changes-group-head { color: var(--green);  background: var(--green-dim); }
.ch-trimmed .changes-group-head { color: var(--yellow); background: var(--yellow-dim); }
.changes-list { padding: 4px 0; }
.changes-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 12px; gap: 8px;
  font-size: 10.5px; border-bottom: 1px solid var(--border);
}
.changes-item:last-child { border-bottom: none; }
.changes-item-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-secondary); flex: 1;
}
.changes-item-val { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.changes-item-pct {
  font-size: 9.5px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.pct-up   { color: var(--green); }
.pct-down { color: var(--red); }
.changes-empty { padding: 10px 12px; font-size: 10px; color: var(--text-muted); }

/* active badge filter */
.badge[data-filter].active {
  box-shadow: 0 0 0 2px currentColor;
}

/* ── Sortable column headers ───────────────────────────────────── */
.tbl th.sort-col { cursor: pointer; transition: opacity .15s; }
.tbl th.sort-col:hover { opacity: .75; }
.sort-arrow {
  display: inline-block;
  font-size: 8px;
  opacity: .4;
  margin-right: 4px;
  line-height: 1;
}
.tbl th.sort-active { font-weight: 600; }
.tbl th.sort-active .sort-arrow { opacity: 1; }

/* ── Manager avatar circles ────────────────────────────────────── */
.mgr-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-raised) no-repeat center 10% / cover;
  border: 1.5px solid var(--border-bright);
  flex-shrink: 0;
}
.mgr-avatar-lg {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--surface-raised) no-repeat center 10% / cover;
  border: 2px solid var(--border-bright);
  flex-shrink: 0;
}
.mgr-identity { display: flex; align-items: center; gap: 20px; }

/* ── Email capture section ─────────────────────────────────────── */
.email-section {
  border-top: 1px solid var(--border);
  padding: 56px 0;
  background: var(--surface);
}
.email-inner { display: flex; flex-direction: column; gap: 18px; max-width: 540px; }
.email-headline { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.email-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: -10px; }
.email-form { display: flex; gap: 8px; }
.email-msg { font-size: 11px; }
