:root {
  --bg: #ffffff;
  --text: #1b1b1b;
  --muted: #6f6f6f;
  --line: #e9e9e7;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --accent: #ff5000;
  --accent-soft: #fff0e8;
  --pos: #00a651;
  --neg: #ff5000;
  --chip: #f2f2f0;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --text: #f5f5f2;
  --muted: #9b9b9b;
  --line: #232323;
  --card: #101010;
  --card-shadow: 0 1px 2px rgba(0,0,0,.5), 0 4px 20px rgba(0,0,0,.45);
  --accent: #ff5b1a;
  --accent-soft: #24140c;
  --pos: #00c805;
  --neg: #ff5b1a;
  --chip: #1b1b1b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  /* Archivo ≈ GT America, the base of Robinhood's proprietary Capsule Sans */
  font-family: "Archivo", -apple-system, "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  transition: background .25s ease, color .25s ease;
}
a { color: var(--accent); text-decoration: none; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand-mark { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.search {
  flex: 0 1 420px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; color: var(--muted); background: var(--card);
}
.search svg { width: 16px; height: 16px; flex: none; }
.search input {
  border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; width: 100%;
}
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.topbar-links a { color: var(--text); font-weight: 700; font-size: 13.5px; }
.topbar-links a:hover { color: var(--accent); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.theme-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.theme-toggle svg { width: 17px; height: 17px; }
:root[data-theme="light"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: none; }

.offline-banner {
  background: var(--accent-soft); color: var(--accent);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; text-align: center; padding: 8px 16px;
}

/* ---------- layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 34px 32px 60px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 48px;
  align-items: start;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .rail { order: -1; }
}

/* ---------- fund header ---------- */
.fund-header h1 { font-size: 37px; font-weight: 700; letter-spacing: -.025em; }
.price-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.price { font-size: 34px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.delta { font-size: 13.5px; font-weight: 700; margin-top: 4px; }
.delta.up { color: var(--pos); }
.delta.down { color: var(--neg); }
.breakdown { font-size: 12.5px; margin-top: 2px; }

/* ---------- next buy countdown ---------- */
.nextbuy {
  margin-top: 20px; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--card); box-shadow: var(--card-shadow);
}
.nextbuy-left { display: flex; flex-direction: column; gap: 8px; }
.nextbuy-head { display: flex; align-items: center; gap: 12px; }
.nextbuy-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mode-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  border-radius: 999px; padding: 4px 11px;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
}
.mode-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.mode-chip.mode-launch::before { background: var(--accent); }
.mode-chip.mode-bond::before { background: var(--pos); }

.bond-watch { display: flex; flex-direction: column; gap: 5px; min-width: 260px; }
.bw-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; }
.bw-sym { width: 76px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-bar {
  flex: 1; height: 5px; border-radius: 999px; overflow: hidden;
  background: var(--chip);
}
.bw-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
  transition: width .6s ease;
}
.bw-pct { width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nextbuy-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted);
}
.nextbuy-label .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.nextbuy-timer {
  font-size: 42px; font-weight: 700; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1;
}
.nextbuy-timer.buying { font-size: 28px; }
.nextbuy-queue { font-size: 13px; color: var(--muted); font-weight: 700; text-align: right; }

/* ---------- chart ---------- */
.chart-block { margin-top: 18px; }
.chart-wrap { position: relative; }
#navChart { width: 100%; height: 300px; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 13.5px; pointer-events: none;
}
.range-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-top: 8px; }
.range-tabs button {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .02em;
  padding: 10px 2px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.range-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.range-tabs button.live-tab {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--pos); letter-spacing: .08em;
}
.range-tabs button.live-tab .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pos);
  animation: pulse 1.6s ease-in-out infinite;
}
.range-tabs button.live-tab.active { border-bottom-color: var(--pos); }
.range-tabs button.live-tab.idle { color: var(--muted); }
.range-tabs button.live-tab.idle .dot { background: var(--muted); animation: none; }

/* ---------- sections ---------- */
.section { margin-top: 44px; }
.section h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.about-text { max-width: 760px; }
.facts-row { display: flex; gap: 64px; margin-top: 22px; flex-wrap: wrap; }
.fact-label { display: block; font-size: 13px; font-weight: 800; }
.fact-value { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 32px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat .stat-label { font-size: 13px; font-weight: 800; }
.stat .stat-value { font-size: 14.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 800; color: var(--muted);
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.tk { display: flex; flex-direction: column; }
.tk b { font-weight: 700; }
.tk span { font-size: 12px; color: var(--muted); }
.chip {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  border-radius: 999px; padding: 3px 9px; background: var(--chip); color: var(--muted);
}
.chip.buy { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.chip.sell { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.chip.ok { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); }
.chip.bad { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); }
.ret.up { color: var(--pos); font-weight: 700; }
.ret.down { color: var(--neg); font-weight: 700; }
.empty { color: var(--muted); font-size: 13.5px; padding: 18px 0; }

/* new rows slide in and flash */
@keyframes rowIn {
  0% { opacity: 0; transform: translateY(-10px); background: var(--accent-soft); }
  60% { opacity: 1; transform: translateY(0); background: var(--accent-soft); }
  100% { background: transparent; }
}
tr.row-new { animation: rowIn .9s ease-out; }

/* ---------- pagers ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--muted);
}
.pager button {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font: inherit; font-weight: 800; display: grid; place-items: center;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .35; cursor: default; }

.copy-inline {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: .92em; padding: 0;
}
.copy-inline:hover { color: var(--accent); }

/* ---------- right rail ---------- */
.rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--card-shadow); padding: 22px;
}
.card-title {
  font-size: 17px; font-weight: 800; display: flex; justify-content: space-between;
  align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.buy-card .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; font-size: 13.5px;
}
.buy-card .row span:first-child { color: var(--text); }
.buy-card .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.buy-card .row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 13px; }
.buy-card .row.total span { font-weight: 800; color: var(--text); }
.fine-print { font-size: 11.5px; color: var(--muted); margin: 10px 0 16px; }

.grad { padding: 10px 0 4px; }
.grad-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; padding-bottom: 8px;
}
.grad-head span:first-child { color: var(--text); }
.grad-head span:last-child { color: var(--pos); font-weight: 800; font-variant-numeric: tabular-nums; }
.grad-bar {
  height: 8px; border-radius: 999px; overflow: hidden; background: var(--chip);
}
.grad-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--pos);
  transition: width .8s ease;
}
.grad-detail { font-size: 11.5px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }
.btn-primary {
  display: block; width: 100%; text-align: center;
  border: 0; cursor: pointer; font: inherit;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
  border-radius: 999px; padding: 13px 0; margin-top: 14px;
  transition: filter .15s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline {
  display: block; text-align: center; font-weight: 800; font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px; padding: 12px 0;
  color: var(--accent); background: var(--card);
}
.btn-outline:hover { border-color: var(--accent); }

/* ---------- footer ---------- */
.disclaimer { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 22px; }
.disclaimer p { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; max-width: 860px; }
