/* Qlib Signal Lab — understated dark, responsive research interface. */
:root {
  --background: #0c121b;
  --surface: #151e2b;
  --surface-soft: #192534;
  --text: #d7e0eb;
  --heading: #eef3f9;
  --muted: #a6b3c3;
  --quiet: #8798aa;
  --border: #2a3747;
  --blue: #8bbdff;
  --blue-soft: #22374f;
  --teal: #72d3ad;
  --teal-soft: #1d3a34;
  --red: #ff9198;
  --red-soft: #382b38;
  --amber: #efc580;
  --amber-soft: #383426;
  --shadow: 0 5px 22px rgba(0, 0, 0, .10);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #95c7ff;
  outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }

.shell, .doc-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 50px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 23px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -.025em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: #f4f7fc;
  background: #254a72;
  font-size: 15px;
  font-weight: 800;
}
.topnav { display: flex; gap: 8px; align-items: center; }
.nav-link {
  display: inline-flex;
  color: #a5b5c7;
  font-size: 13px;
  font-weight: 590;
  text-decoration: none;
  border-radius: 8px;
  padding: 9px 12px;
}
.nav-link:hover { background: #202e40; color: var(--heading); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(255px, .8fr);
  gap: 42px;
  align-items: center;
  margin-bottom: 28px;
}
.hero-copy {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 4px 0;
}
.hero-copy::after { display: none; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--teal);
}
.pool-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}
.pool-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 660;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pool-btn span {
  color: var(--quiet);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
}
.pool-btn:hover {
  background: #202f42;
  color: var(--heading);
}
.pool-btn.current {
  background: var(--blue-soft);
  border-color: #4f77a3;
  color: var(--blue);
  font-weight: 740;
}
.pool-btn.current span {
  color: #a9cdfc;
}
.hero h1 {
  margin: 0 0 15px;
  color: var(--heading);
  font-size: clamp(30px, 3.6vw, 43px);
  line-height: 1.16;
  font-weight: 780;
  letter-spacing: -.045em;
}
.hero h1 span { display: block; font-weight: 760; }
.hero-lede {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}
.protocol-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.protocol-card h2 {
  margin: 0 0 12px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 760;
}
.protocol-list { display: grid; gap: 0; }
.protocol-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid #2a3543;
  padding: 9px 0;
}
.protocol-row:last-child { border-bottom: 0; padding-bottom: 0; }
.protocol-row span { color: var(--quiet); font-size: 12px; }
.protocol-row strong { font-size: 12px; color: var(--text); text-align: right; font-weight: 675; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 25px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}
.stat-card {
  min-width: 0;
  padding: 19px 21px;
  border-right: 1px solid var(--border);
}
.stat-card:last-child { border-right: 0; }

/* Six forward-MVP status cells: two rows on desktop, two columns on mobile. */
.status-grid.mvp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-grid.mvp-grid .stat-card { border-bottom: 1px solid var(--border); }
.status-grid.mvp-grid .stat-card:nth-child(3n) { border-right: 0; }
.status-grid.mvp-grid .stat-card:nth-last-child(-n+3) { border-bottom: 0; }
.mvp-health { border-left-color: var(--amber); }
.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.stat-value {
  min-width: 0;
  color: var(--heading);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin-top: 6px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 23px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 25px 19px;
  border-bottom: 1px solid var(--border);
}
.panel-kicker {
  margin: 0 0 5px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.panel-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.035em;
}
.panel-note {
  color: var(--muted);
  text-align: right;
  line-height: 1.6;
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 730;
  letter-spacing: .01em;
}
.status-pill.history { color: var(--amber); background: var(--amber-soft); }

.table-wrap { width: 100%; overflow-x: auto; }
.signal-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.signal-table th {
  padding: 14px 15px;
  text-align: left;
  color: var(--quiet);
  background: #192432;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}
.signal-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #273544;
  color: var(--text);
  vertical-align: middle;
  font-size: 13px;
}
.signal-table tbody tr:last-child td { border-bottom: 0; }
.signal-table tbody tr:hover { background: #1b2939; }
.signal-table th:first-child, .signal-table td:first-child { padding-left: 25px; }
.signal-table th:nth-child(1), .signal-table td:nth-child(1) { width: 9%; }
.signal-table th:nth-child(2), .signal-table td:nth-child(2) { width: 17%; }
.signal-table th:nth-child(3), .signal-table td:nth-child(3) { width: 18%; }
.signal-table th:nth-child(4), .signal-table td:nth-child(4) { width: 15%; }
.signal-table th:nth-child(5), .signal-table td:nth-child(5) { width: 13%; }
.signal-table th:last-child, .signal-table td:last-child {
  width: 180px;
  min-width: 180px;
  padding-left: 18px;
  padding-right: 25px;
  text-align: center;
}
.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: #a9bacb;
  background: #283648;
  font-size: 12px;
  font-weight: 710;
  font-variant-numeric: tabular-nums;
}
.rank-badge.top { background: #253b56; color: var(--blue); }
.stock-link {
  color: var(--blue);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 640;
  white-space: nowrap;
}
.stock-link:hover { text-decoration: underline; }
.stock-name { font-size: 13px; font-weight: 680; color: var(--heading); }
.score {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.score.positive { color: var(--red); }
.score.negative { color: var(--teal); }
.tag {
  display: inline-block;
  min-width: 38px;
  padding: 4px 7px;
  border-radius: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}
.tag-new { background: var(--blue-soft); color: var(--blue); }
.tag-up { background: var(--red-soft); color: var(--red); }
.tag-dn { background: var(--teal-soft); color: var(--teal); }
.tag-neutral { background: #283647; color: #97a7b8; }
/* Keep desktop <td> as a real table cell; flex would break column sizing. */
.signal-table td.spark {
  display: table-cell;
  text-align: center;
}
.sparkline-svg {
  display: block;
  width: 128px;
  height: 34px;
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
}
/* Show the reason for a missing sparkline as text, including on touch devices. */
.spark-empty {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 128px;
  max-width: 100%;
  min-height: 34px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}
.mobile-cards .spark-empty { width: 104px; min-height: 27px; }

.mobile-cards .spark {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.muted { color: var(--quiet); font-size: 12px; }
.mobile-cards { display: none; }

.history-wrap { padding: 18px 24px 22px; }
.history-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.date-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transition: background .15s ease, border-color .15s ease;
}
.date-btn:hover { background: #223449; border-color: #4b6685; color: var(--blue); }
.date-btn.current { background: var(--blue-soft); color: var(--blue); border-color: #557ca8; font-weight: 720; }
.callout {
  margin: 0 0 24px;
  padding: 14px 17px;
  border: 1px solid var(--border);
  border-left: 3px solid #708dac;
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.callout strong { color: var(--text); font-weight: 710; }
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.footer a { color: var(--blue); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Methodology: plain research report, matching the dashboard. */
.doc-shell { width: min(1080px, calc(100% - 40px)); }
.doc-hero { padding: 0 0 24px; margin-bottom: 24px; }
.doc-hero h1 {
  color: var(--heading);
  max-width: 760px;
  font-size: clamp(29px, 3.5vw, 40px);
  line-height: 1.22;
  letter-spacing: -.04em;
  margin: 0 0 15px;
}
.doc-hero p { max-width: 820px; color: var(--muted); line-height: 1.85; }
.doc-status { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 17px; }
.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #3d6082;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 670;
}
.mini-pill.paused { background: var(--amber-soft); border-color: #5d5138; color: var(--amber); }
.doc-grid {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.doc-nav {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.doc-nav a {
  display: block;
  padding: 10px 11px;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
}
.doc-nav a:hover { color: var(--blue); background: #223449; }
.doc-content { min-width: 0; }
.doc-section {
  scroll-margin-top: 18px;
  padding: 26px 28px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.doc-section h2 {
  color: var(--heading);
  font-size: 20px;
  margin: 0 0 17px;
  font-weight: 750;
  letter-spacing: -.02em;
}
.doc-section h3 { font-size: 14px; margin: 24px 0 10px; color: var(--heading); }
.doc-section p, .doc-section li { color: #b7c4d2; font-size: 13px; line-height: 1.85; }
.doc-section p strong, .doc-section li strong { color: var(--text); }
.doc-section ul { padding-left: 18px; margin: 12px 0 0; }
.doc-section li { margin-bottom: 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 15px 0 17px; }
.metric { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.metric span { display: block; margin-bottom: 7px; font-size: 10px; color: var(--quiet); letter-spacing: .02em; }
.metric strong { color: var(--heading); font-size: 17px; line-height: 1.45; }
.kv {
  display: grid;
  grid-template-columns: minmax(135px, .47fr) minmax(0, 1fr);
  border-top: 1px solid #2a3543;
}
.kv:first-of-type { border-top: 0; }
.kv > div { min-width: 0; padding: 11px 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.kv > div:first-child { color: var(--muted); padding-right: 20px; }
.kv > div:last-child { color: var(--text); }
.doc-table-wrap { overflow-x: auto; margin: 14px 0; }
.doc-table { width: 100%; min-width: 590px; border-collapse: collapse; }
.doc-table th { color: var(--quiet); background: var(--surface-soft); font-weight: 660; }
.doc-table th, .doc-table td { text-align: left; border-bottom: 1px solid var(--border); padding: 11px; font-size: 12px; white-space: nowrap; }
.doc-table td { color: var(--text); }
.doc-table tr:last-child td { border-bottom: 0; }
code {
  padding: 2px 4px;
  border-radius: 5px;
  background: #21344b;
  color: #9bc3f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}
details { border: 1px solid var(--border); border-radius: 9px; padding: 13px 15px; background: var(--surface-soft); }
summary { cursor: pointer; color: var(--heading); font-weight: 710; font-size: 13px; }
details p { margin: 12px 0 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .protocol-card { width: 100%; }
  .protocol-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; }
  .doc-grid { grid-template-columns: 1fr; gap: 12px; }
  .doc-nav { position: static; flex-direction: row; overflow-x: auto; white-space: nowrap; }
  .doc-nav a { flex: none; }
}
@media (max-width: 700px) {
  .shell, .doc-shell { width: min(100% - 28px, 1080px); padding: 17px 0 32px; }
  .topbar { padding-bottom: 16px; margin-bottom: 22px; }
  .brand { font-size: 13px; }
  .hero { margin-bottom: 20px; }
  .hero h1 { font-size: clamp(29px, 8vw, 36px); line-height: 1.19; }
  .hero-lede { font-size: 13px; line-height: 1.75; }
  .protocol-card { padding: 16px; }
  .protocol-list { column-gap: 15px; }
  .protocol-row { gap: 8px; }
  .protocol-row span, .protocol-row strong { font-size: 11px; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-grid.mvp-grid { grid-template-columns: 1fr 1fr; }
  .status-grid.mvp-grid .stat-card { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .status-grid.mvp-grid .stat-card:nth-child(2n) { border-right: 0; }
  .status-grid.mvp-grid .stat-card:nth-last-child(-n+2) { border-bottom: 0; }
  .stat-card { padding: 15px; border-bottom: 1px solid var(--border); }
  .stat-card:nth-child(2n) { border-right: 0; }
  .stat-card:nth-last-child(-n+2) { border-bottom: 0; }
  .stat-value { font-size: 15px; }
  .panel-head { padding: 17px 17px 15px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .panel-head h2 { font-size: 20px; }
  .panel-note { text-align: left; }
  .table-wrap { display: none; }
  .mobile-cards { display: grid; gap: 0; }
  .stock-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 15px 16px;
    border-bottom: 1px solid #273544;
  }
  .stock-card:last-child { border-bottom: 0; }
  .stock-main { min-width: 0; }
  .stock-main .stock-name {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stock-side {
    min-width: 108px;
    text-align: right;
  }
  .stock-side .tag { margin-left: 5px; }
  .stock-side .spark {
    justify-content: flex-end;
    margin-top: 8px;
  }
  .stock-side .sparkline-svg {
    width: 104px;
    height: 27px;
    margin-inline: 0;
  }
  .history-wrap { padding: 15px 16px 18px; }
  .history-buttons { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .date-btn { white-space: nowrap; flex: 0 0 auto; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .doc-hero { padding-bottom: 9px; }
  .doc-hero h1 { font-size: 29px; }
  .doc-section { padding: 19px 17px; }
  .doc-section h2 { font-size: 18px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric strong { font-size: 15px; }
  .kv { grid-template-columns: 1fr; padding: 7px 0; }
  .kv > div { padding: 2px 0; }
}
@media (max-width: 380px) {
  .mobile-cards .spark-empty { width: 78px; min-height: 22px; font-size: 10px; }
  .topnav { gap: 0; }
  .nav-link { padding: 8px; }
  .protocol-list { grid-template-columns: 1fr; }
  .protocol-row { padding: 7px 0; }
  .stock-card { grid-template-columns: 27px minmax(0, 1fr) auto; gap: 8px; padding: 13px 11px; }
  .stock-side { min-width: 82px; }
  .stock-side .sparkline-svg { width: 78px; height: 22px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Calm dark finish: no glows, gradients or oversized decorative cards. */
html { color-scheme: dark; }
body { background: #0c121b; }
.panel, .protocol-card, .status-grid, .stat-card, .doc-nav, .doc-section {
  box-shadow: none;
}
.signal-table tbody tr:hover { background: #1d2b3b; }
.signal-table th { background: #182331; }
.date-btn { background: #192432; }
.date-btn:hover { background: #26384d; }
.date-btn.current { background: #213c5e; }
.doc-nav a:hover { background: #213247; }
.callout { background: #15202e; }
.ranking-date {
  color: var(--heading);
  font-size: 12px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.ranking-note { margin-top: 6px; }


/* Forward-only live paper performance */
.performance-panel { overflow: hidden; }
.performance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 25px 10px;
}
.performance-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.035em;
}
.performance-status {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.performance-summary {
  flex: none;
  min-width: 150px;
  text-align: right;
}
.performance-value {
  color: var(--heading);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}
.performance-value.gain { color: var(--red); }
.performance-value.loss { color: var(--teal); }
.performance-latest {
  margin-top: 8px;
  color: var(--quiet);
  font-size: 11px;
}
.performance-chart {
  min-height: 190px;
  padding: 8px 20px 4px;
}
.performance-svg {
  display: block;
  width: 100%;
  height: 180px;
}
.performance-zero {
  stroke: #344354;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}
.performance-line {
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* A return curve is always a stroke, never a filled area. */
.performance-line.gain { stroke: var(--red); }
.performance-line.loss { stroke: var(--teal); }
.performance-dot.gain { stroke: var(--red); fill: var(--red); }
.performance-dot.loss { stroke: var(--teal); fill: var(--teal); }
.performance-empty {
  display: grid;
  place-items: center;
  min-height: 165px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.75;
}
.performance-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 25px 19px;
  border-top: 1px solid var(--border);
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .performance-head {
    padding: 17px 17px 8px;
    flex-direction: column;
    gap: 15px;
  }
  .performance-summary {
    min-width: 0;
    text-align: left;
  }
  .performance-value { font-size: 32px; }
  .performance-chart {
    min-height: 150px;
    padding: 5px 8px 0;
  }
  .performance-svg { height: 145px; }
  .performance-empty {
    min-height: 130px;
    padding: 0 18px;
  }
  .performance-foot {
    padding: 11px 17px 16px;
    flex-direction: column;
    gap: 5px;
  }
}


/* Information-first polish: navigation remains one compact, touch-scrollable row. */
.history-buttons {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 8px;
  scrollbar-width: thin;
  padding-block: 2px 10px;
}
.date-btn {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
}
.performance-axis {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 2px;
  color: var(--quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.performance-status.stale,
.performance-latest.stale { color: var(--amber); }

/* Tablet portrait has too little space for six financial table columns.
   Reuse compact cards; preserve a real table for laptop/desktop. */
@media (min-width: 701px) and (max-width: 860px) {
  .table-wrap { display: none; }
  .mobile-cards { display: grid; }
  .stock-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 120px;
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #273544;
  }
  .stock-card:last-child { border-bottom: 0; }
  .stock-main { min-width: 0; }
  .stock-main .stock-name {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stock-side { min-width: 0; text-align: right; }
  .stock-side .tag { margin-left: 5px; }
  .stock-side .spark { justify-content: flex-end; margin-top: 8px; }
  .stock-side .sparkline-svg { width: 104px; height: 27px; margin-inline: 0; }
}
@media (max-width: 700px) {
  .stock-side > div:first-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
  }
  .stock-side .tag { margin-left: 0; }
  .performance-axis { font-size: 10px; }
}

/* Centered high-end boot loader */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 74, 114, 0.22), transparent 54%),
    var(--background);
}
.boot-card {
  width: min(420px, 100%);
  padding: 38px 32px 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(25, 37, 52, 0.92), rgba(21, 30, 43, 0.96));
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}
.boot-emblem {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}
.boot-rings {
  position: absolute;
  inset: 0;
  width: 88px;
  height: 88px;
  overflow: visible;
}
.boot-ring-outer {
  fill: none;
  stroke: #2e435c;
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
  transform-origin: 44px 44px;
  animation: boot-orbit-cw 14s linear infinite;
}
.boot-ring-arc {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 56 140;
  transform-origin: 44px 44px;
  animation: boot-orbit-ccw 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.boot-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #254a72;
  border: 1px solid rgba(139, 189, 255, 0.32);
  color: #f4f7fc;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.boot-kicker {
  color: var(--blue);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.boot-title {
  color: var(--heading);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.boot-bars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 18px;
  margin-bottom: 14px;
}
.boot-bars span {
  display: inline-block;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal);
  animation: boot-bar-pulse 1.2s ease-in-out infinite;
}
.boot-bars span:nth-child(2) { animation-delay: 0.15s; background: var(--blue); }
.boot-bars span:nth-child(3) { animation-delay: 0.30s; background: var(--amber); }
.boot-bars span:nth-child(4) { animation-delay: 0.45s; background: var(--blue); }
.boot-bars span:nth-child(5) { animation-delay: 0.60s; background: var(--teal); }
.boot-sub {
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.6;
}
@keyframes boot-orbit-cw {
  to { transform: rotate(360deg); }
}
@keyframes boot-orbit-ccw {
  0% { transform: rotate(0deg); stroke: var(--blue); }
  50% { stroke: var(--teal); }
  100% { transform: rotate(360deg); stroke: var(--blue); }
}
@keyframes boot-bar-pulse {
  0%, 100% { transform: scaleY(0.55); opacity: 0.45; }
  50% { transform: scaleY(1.65); opacity: 1; }
}

/* Consolidated bottom governance & disclosure card */
.governance-panel {
  margin-bottom: 26px;
}
.governance-body {
  padding: 20px 25px 22px;
}
.governance-meta-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.65fr);
  gap: 12px;
  margin-bottom: 16px;
}
.governance-meta-item {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}
.governance-meta-label {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  margin-bottom: 5px;
}
.governance-meta-value {
  display: block;
  color: var(--heading);
  font-size: 13px;
  font-weight: 710;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.governance-meta-sub {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 11px;
}
.governance-health {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.governance-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.governance-list li {
  margin-bottom: 5px;
}
.governance-list li:last-child {
  margin-bottom: 0;
}
.governance-list strong {
  color: var(--text);
}
@media (max-width: 860px) {
  .governance-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
  .governance-meta-wide {
    grid-column: 1 / -1;
  }
}
@media (max-width: 700px) {
  .governance-body {
    padding: 16px 17px 18px;
  }
  .governance-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
