:root {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #172c2a;
  background: #f3f6f5;
  font-size: 14px;
  --green: #087f68;
  --muted: #81908d;
  --line: #e0e8e5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
aside {
  width: 235px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  font-size: 27px;
  color: var(--green);
  text-decoration: none;
}
.brand span {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  font-size: 9px;
  color: #87938f;
  letter-spacing: 3px;
  margin-top: 7px;
}
.workspace {
  margin: 42px 0 20px;
  font-size: 12px;
  color: #768781;
}
.workspace span {
  font-size: 9px;
  background: #eaf3ee;
  padding: 4px 6px;
  margin-left: 20px;
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: #64746e;
  padding: 14px 16px;
  margin: 6px 0;
  border-radius: 8px;
}
nav button.active {
  background: #e7f4ee;
  color: var(--green);
  font-weight: 600;
}
.side-note {
  margin-top: auto;
  font-size: 12px;
  line-height: 2;
}
.side-note small {
  color: #89948f;
}
.side-note i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #19a47b;
  border-radius: 100%;
  margin-right: 7px;
}
main {
  margin-left: 235px;
  padding: 35px 42px;
  max-width: 1850px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
header small {
  font-size: 10px;
  letter-spacing: 2px;
  color: #8a9992;
}
h1 {
  font-size: 27px;
  letter-spacing: -1px;
  margin: 10px 0 0;
}
h2 {
  font-size: 17px;
  margin: 0 0 15px;
}
h3 {
  font-size: 14px;
  margin: 0;
}
p {
  color: #73847b;
  line-height: 1.8;
}
.header-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
#clock {
  font-size: 12px;
  color: #8a9992;
}
button {
  cursor: pointer;
  font: inherit;
  border: 1px solid #d9e3de;
  border-radius: 6px;
  background: white;
  padding: 9px 14px;
  color: #314b41;
}
button:hover {
  filter: brightness(0.97);
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: #263f35;
  background: #fff;
  border: 1px solid #dce5e0;
  border-radius: 6px;
  padding: 10px;
  margin-top: 7px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #91c6b3;
}
label {
  display: block;
  color: #73847b;
  font-size: 12px;
}
small {
  color: var(--muted);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 23px;
  margin-bottom: 22px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 21px;
}
.metric .value {
  font-size: 27px;
  font-weight: 600;
  margin: 17px 0 8px;
  font-variant-numeric: tabular-nums;
}
.positive {
  color: #08866a;
}
.negative {
  color: #cf5750;
}
.metric small {
  font-size: 11px;
}
.columns {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.tabs button.active {
  background: #e7f4ee;
  border-color: #a6cebd;
  color: #087f68;
}
.tag {
  font-size: 10px;
  border-radius: 4px;
  padding: 4px 7px;
  background: #eef2f0;
  color: #698176;
  white-space: nowrap;
}
.tag.green {
  background: #e2f4ea;
  color: #087f68;
}
.empty {
  text-align: center;
  padding: 58px 20px;
}
.empty .icon {
  font-size: 36px;
  color: #a4c2b3;
  margin-bottom: 18px;
}
.empty h2 {
  font-size: 17px;
}
.empty p {
  font-size: 12px;
  max-width: 470px;
  margin: 12px auto 22px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  font-weight: 400;
  color: #829087;
  background: #f8faf9;
}
td,
th {
  padding: 15px 11px;
  border-bottom: 1px solid #edf1ef;
}
td strong {
  display: block;
  font-size: 13px;
}
td small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
}
.table-wrap {
  overflow: auto;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 15px;
}
.section-head input {
  max-width: 300px;
  margin: 0;
}
.banner {
  background: #e8f3ee;
  padding: 15px 20px;
  border: 1px solid #d8e9df;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 22px;
  color: #527362;
}
.error {
  background: #fff0ed;
  border-color: #edc6be;
  color: #9a473c;
}
.chart {
  width: 100%;
  height: 200px;
  display: block;
}
.legend {
  font-size: 11px;
  display: flex;
  gap: 20px;
  color: #84958a;
  margin-top: 12px;
}
.big-rate {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -2px;
  margin: 16px 0;
}
.breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 25px;
}
.breakdown div {
  padding: 12px;
  background: #f7faf8;
  border-radius: 6px;
  font-size: 12px;
}
.breakdown b {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}
.note {
  font-size: 11px;
  line-height: 1.9;
  color: #8b958c;
}
.source {
  font-size: 11px;
  color: #8b958c;
  margin: 8px 0 22px;
}
.money {
  font-variant-numeric: tabular-nums;
}
.danger {
  color: #ba5c51;
}
footer {
  font-size: 10px;
  color: #97a299;
  line-height: 1.8;
  margin: 25px 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 430px;
  padding: 28px;
}
dialog::backdrop {
  background: #163c3050;
}
dialog label {
  margin: 18px 0;
}
pre {
  font-size: 11px;
  max-height: 350px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f6f9f7;
  padding: 15px;
  border-radius: 6px;
}
a {
  color: #087f68;
}
.subtle {
  background: #f7faf8;
}
textarea {
  min-height: 130px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  aside {
    width: 190px;
    padding: 25px 15px;
  }
  main {
    margin-left: 190px;
    padding: 25px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  aside {
    position: static;
    width: auto;
    padding: 15px;
  }
  .workspace,
  .side-note {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  nav button {
    white-space: nowrap;
    width: auto;
    padding: 8px;
  }
  main {
    margin: 0;
    padding: 18px;
  }
  header {
    gap: 10px;
  }
  #clock {
    display: none;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric .value {
    font-size: 23px;
  }
  .form-grid {
    gap: 12px;
  }
}

#research { font-size: 16px; }
#research h2 { font-size: 28px; }
#research th, #research td { font-size: 16px; padding: 14px 10px; }
#research .rank-apr { font-size: 22px; font-weight: 750; }
#stockSearch { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
#stockSearch label { flex: 1; min-width: 220px; }
#rangePanel:not(:empty) { padding-top: 28px; }

#ledgerUtility { margin-top: auto; align-self: start; color: #55716d; border: 0; background: none; }
#research { padding: clamp(12px, 2vw, 28px); }
#research #stockList { margin-top: 18px; }
#research tbody tr:not(.range-row) td { background: #f3f8f7; border-bottom: 5px solid white; }
#research .rank-apr { color: #08624e; font-variant-numeric: tabular-nums; }
#research button[aria-expanded="true"], #research button[aria-pressed="true"] { background: #d5f1e9; color: #075c50; }
#research .range-row > td { padding: 0 0 16px; white-space: normal; }
.range-panel { background: #edf6f4; padding: clamp(12px, 2vw, 24px); border: 1px solid #cfe2de; border-radius: 12px; }
.range-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.55fr); gap: 24px; }
.range-panel canvas { display: block; width: 100%; height: auto; min-height: 140px; margin: 8px 0; background: #fff; border-radius: 10px; }
.range-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.range-panel .form-grid { margin-top: 12px; }
.range-caption { font-size: 13px; color: #46645e; }
.lp-action { margin-top: 16px; }
@media (max-width: 1000px) { .range-layout { grid-template-columns: 1fr; } }

.price-sliders { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin:16px 0; }
.price-sliders input { width:100%; accent-color:#078671; }
.range-panel canvas { touch-action:none; cursor:ns-resize; }
.wallet-dialog { width:min(440px,calc(100vw - 32px)); margin:auto; padding:24px; border:1px solid #3a4860; border-radius:16px; box-shadow:0 24px 80px #0008; }
.wallet-dialog::backdrop { background:#080e17aa; }
.wallet-brand { display:flex; align-items:center; justify-content:center; gap:8px; margin:5px 28px 16px; color:#a9e3ff; font-weight:700; }
.wallet-brand img { width:24px; height:24px; border-radius:6px; }
.wallet-dialog h2 { font-size:20px; text-align:center; margin:0 26px 24px; }
.wallet-dialog p { font-size:14px; line-height:1.55; }
.wallet-close { position:absolute; inset:16px 16px auto auto; width:34px; height:34px; display:grid; place-items:center; padding:0; font-size:20px; }
.wallet-choices, .wallet-more > div { display:grid; gap:8px; }
.wallet-choices[hidden], .wallet-more[hidden], .wallet-message:empty { display:none; }
.wallet-dialog .wallet-option, .wallet-more summary { display:flex; align-items:center; gap:10px; width:100%; min-height:54px; padding:8px 12px; border:1px solid #3a4860; border-radius:10px; background:#121a2b; color:inherit; font:inherit; text-align:left; text-decoration:none; }
.wallet-dialog .wallet-option-metamask { border-color:#39749a; background:#152c40; }
.wallet-dialog .wallet-option:hover:not(:disabled) { background:#243245; border-color:#4fc3f7; }
.wallet-option-icon { width:32px; height:32px; flex:none; display:grid; place-items:center; object-fit:contain; padding:3px; border-radius:8px; background:#243245; color:#d7edff; font-size:12px; font-weight:700; }
.wallet-option-metamask .wallet-option-icon { background:#291f19; }
.wallet-option-label { min-width:0; flex:1; overflow-wrap:anywhere; }
.wallet-option-label strong, .wallet-option-label small { display:block; }
.wallet-option-label strong { font-size:15px; }
.wallet-option-label small, .wallet-message { color:#a7b5c5; }
.wallet-option-action { flex:none; color:#a9e3ff; font-size:13px; font-weight:600; }
.wallet-option:disabled .wallet-option-action { color:#a7b5c5; }
.wallet-more { margin-top:8px; }
.wallet-message, .wallet-copy { margin-top:12px; }
.wallet-more summary { cursor:pointer; font-size:14px; list-style:none; }
.wallet-more summary::-webkit-details-marker { display:none; }
.wallet-more summary:hover { border-color:#4fc3f7; }
.wallet-more-chevron { margin-left:auto; font-size:18px; color:#a9e3ff; }
.wallet-more[open] .wallet-more-chevron { transform:rotate(90deg); }
.wallet-more > div { margin-top:8px; }
.wallet-manage code { overflow-wrap:anywhere; }


.chart-price { font-size:18px; font-weight:650; margin-top:18px; color:#154c41; }

/* Shared palette with the PolyTracker site. */
:root {
  color-scheme: dark;
  color: #f1f5ff;
  background: #0a0e1a;
  --green: #5ee5b3;
  --muted: #9ca9bf;
  --line: #27324a;
  --surface: #111827;
  --accent: #c4b5fd;
}
body { background: radial-gradient(ellipse at 45% 0%, #1b2040 0%, #0a0e1a 58%); min-height:100vh; }
.site-tabs {
  position: sticky; top:0; z-index:4; display:flex; gap:6px; align-items:center;
  height:64px; padding:0 clamp(16px, 4vw, 48px); background:#0a0e1ae8;
  backdrop-filter:blur(18px); border-bottom:1px solid var(--line);
}
.site-tabs a {
  padding:8px 13px; border:1px solid transparent; border-radius:8px;
  color:var(--muted); text-decoration:none; font-weight:600;
}
.site-tabs a:hover { background:#ffffff12; color:white; }
.site-tabs a[aria-current="page"] { color:#c7d2fe; background:#6366f126; border-color:#818cf84d; }
aside { top:64px; background:#0c1221; gap:16px; }
aside .brand, aside a { color:var(--accent); }
aside nav button { color:var(--muted); }
aside nav button.active, .tabs button.active { background:#282552; border-color:#514983; color:#ded5ff; }
.side-note small, #ledgerUtility, #clock, p, label, .note, .source, footer, .legend, th, .range-caption { color:var(--muted); }
header { flex-wrap:wrap; row-gap:14px; margin-bottom:22px; }
h1 { font-size:clamp(24px, 3vw, 34px); }
.header-actions { flex-wrap:wrap; }
.card, .metric, dialog, .wallet-dialog { color:inherit; background:#121a2b; border-color:var(--line); }
.card { border-radius:16px; box-shadow:0 12px 32px #0003; }
button, input, select, textarea { color:#e4eaff; background:#11192b; border-color:#34405a; }
button:hover { filter:brightness(1.18); }
button:focus-visible, a:focus-visible, input:focus, select:focus, textarea:focus { outline:2px solid #a5b4fc; outline-offset:2px; }
button:disabled { opacity:.52; cursor:default; }
.primary { color:white; background:#5146c9; border-color:#8179ee; }
a { color:#b5baff; }
.positive, .tag.green { color:var(--green); }
.negative, .danger { color:#fb9a9a; }
th, pre, .subtle, .breakdown div { background:#0d1526; }
td, th { border-color:var(--line); }
.banner, .tag, .tag.green { background:#1b2541; border-color:var(--line); color:#c4ceeb; }
.error { background:#321b2b; border-color:#713d54; color:#ffc3cb; }
#research tbody tr:not(.range-row) td { background:#151e32; border-bottom:4px solid #121a2b; }
#research .rank-apr { color:var(--green); }
#research button[aria-expanded="true"], #research button[aria-pressed="true"] { background:#282552; border-color:#514983; color:#ded5ff; }
.range-panel { background:#101829; border-color:#34405a; }
.range-panel canvas { background:#0a1020; }
.chart-price { color:#e8e6ff; }
.price-sliders input { accent-color:#a5a7ff; }
.range-layout > div { min-width:0; }
#rangeOutput { overflow:auto; }
@media (max-width:650px) {
  .site-tabs { height:52px; }
  aside { gap:6px; }
  .header-actions { justify-content:flex-end; }
}
/* The ranking is the main content on first load. */
body { color:#f9fafb; background:#0a0e1a; }
main { max-width:none; min-width:0; }
main h1, main h2, main h3, main td, main td strong, .range-panel { color:#f9fafb; }
#research { background:#0d1321; border-color:#242d40; box-shadow:none; padding:clamp(14px, 2vw, 24px); }
.rank-toolbar, .rank-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.rank-toolbar { justify-content:space-between; padding-bottom:16px; border-bottom:1px solid var(--line); }
.rank-toolbar #rankingHeading { font-size:22px; margin:0 0 4px; color:#f9fafb; }
.rank-toolbar p { margin:0; font-size:13px; color:#b4bed2; }
.rank-search { position:relative; }
.rank-search summary { cursor:pointer; padding:9px 13px; color:#eef2ff; background:#151d30; border:1px solid #34405a; border-radius:8px; list-style:none; }
.rank-search summary::-webkit-details-marker { display:none; }
.rank-search summary:focus-visible { outline:2px solid #a5b4fc; }
#stockSearch { position:absolute; right:0; top:calc(100% + 8px); z-index:3; width:min(350px, 82vw); padding:14px; background:#151d30; border:1px solid #3b4761; border-radius:10px; box-shadow:0 14px 36px #0008; flex-wrap:nowrap; }
#stockSearch label { min-width:0; }
.rank-status { color:#f5d890; }
#research #stockList { color:#edf2ff; margin-top:10px; }
#stockList table { font-variant-numeric:tabular-nums; }
#stockList > .table-wrap > table > thead th { color:#b7c3db; background:#111a2a; white-space:nowrap; font-size:13px; }
#research tbody tr:not(.range-row) td { color:#e6edf9; border-bottom:1px solid #222c3e; background:#0d1321; }
#research tbody tr:not(.range-row):hover td { background:#172034; }
#stockList td strong { font-size:16px; color:#f9fafb; white-space:nowrap; }
#research .rank-apr { color:#56e4af; font-size:22px; }
.rank-number { display:inline-grid; place-items:center; min-width:29px; height:29px; color:#d9e1f1; background:#1b2437; border-radius:7px; font-weight:700; font-size:14px; }
tr:nth-child(1) > td > .rank-number { color:#261703; background:#f6bf58; }
tr:nth-child(2) > td > .rank-number { color:#172236; background:#cbd5e5; }
tr:nth-child(3) > td > .rank-number { color:#2b140b; background:#e9a176; }
.pool-fee { color:#b7c3db; font-size:13px; }
#research button[data-row] { white-space:nowrap; }
@media (max-width:650px) {
  .rank-toolbar { align-items:flex-start; }
  #stockSearch { left:0; right:auto; width:min(320px, 70vw); }
  #stockList > .table-wrap > table { min-width:850px; }
}
#research #stockList td.rank-apr { color:#56e4af; }
@media (max-width:650px) {
  #research #stockList td.rank-apr { font-size:17px; }
  #research #stockList > .table-wrap > table > :is(thead,tbody) > tr > :is(th,td):nth-child(-n+3) { padding-inline:7px; }
  #stockList td strong { font-size:14px; }
}
@media (max-width:650px) {
  #stockList > .table-wrap > table { table-layout:fixed; }
  #stockList > .table-wrap > table > thead th:nth-child(1) { width:40px; }
  #stockList > .table-wrap > table > thead th:nth-child(2) { width:105px; }
  #stockList > .table-wrap > table > thead th:nth-child(3) { width:86px; }
  #stockList td strong { white-space:normal; overflow-wrap:anywhere; }
}
/* GM Labs product palette */
:root { --line:#2a3548; --muted:#abb8c8; --accent:#4fc3f7; --green:#55dfa0; }
body { background:#0f1419; color:#e6edf4; }
.site-tabs { background:#0f1419f2; }
.site-tabs .site-brand { display:inline-flex; align-items:center; gap:9px; color:#e6edf4; margin-right:8px; }
.site-brand img { width:28px; height:28px; }
.site-tabs a[aria-current="page"], aside nav button.active { color:#9de2ff; background:#15374a; border-color:#2e6881; }
aside { background:#141a22; }
.card, #research, .wallet-dialog { background:#1a2230; }
.primary { background:#4fc3f7; color:#071820; border-color:#4fc3f7; font-weight:700; }
#research tbody tr:not(.range-row) td { background:#141a22; }
#research tbody tr:not(.range-row):hover td { background:#1e2938; }
#stockList > .table-wrap > table > thead th, .range-panel { background:#182332; }
#research button[aria-expanded="true"], #research button[aria-pressed="true"] { color:#9de2ff; background:#15374a; border-color:#2e6881; }
.chart-price { color:#e6edf4; }
#addWallet input { max-width:400px; }
#addWallet button { align-self:center; }
#walletPositions h3 { margin-top:24px; }

.site-tabs { overflow-x:auto; scrollbar-width:thin; }
.site-tabs a { flex:none; white-space:nowrap; }

/* Typography and controls consistent with the main site. */
body { line-height:1.55; }
.site-tabs { height:auto; min-height:60px; padding:12px 24px; gap:4px; }
.site-tabs .site-brand { font-size:18px; font-weight:700; color:#4fc3f7; margin-right:18px; padding:0; }
.site-brand img { border-radius:6px; }
.site-tabs a { font-size:14px; font-weight:500; border:0; padding:8px 16px; }
.site-tabs a[aria-current="page"] { background:#243245; color:#4fc3f7; }
.primary { background:linear-gradient(135deg,#4fc3f7,#3b82f6); border-color:transparent; color:#07131c; }
.card, #research { border-radius:12px; }
#research .rank-apr { font-size:20px; }
#addWallet { display:grid; grid-template-columns:minmax(240px, 2fr) minmax(120px, 1fr) auto; max-width:760px; gap:10px; align-items:end; margin:12px 0; }
#addWallet input { max-width:none; }
#addWallet button { align-self:end; }
.wallet-list { display:flex; flex-wrap:wrap; gap:10px; }
.wallet-choice { display:flex; align-items:center; gap:4px; }
.wallet-choice > button { min-width:140px; text-align:left; }
.wallet-choice > button small, .position-apr small { display:block; color:var(--muted); }
.wallet-choice > button[aria-pressed="true"] { color:#9de2ff; background:#15374a; border-color:#2e6881; }
.wallet-choice details { position:relative; }
.wallet-choice summary { cursor:pointer; list-style:none; padding:6px; color:var(--muted); }
.wallet-choice details button { position:absolute; top:100%; right:0; z-index:2; white-space:nowrap; background:#182332; }
.wallet-choice details button + button { top:calc(100% + 35px); }
.position-apr strong { color:var(--green); white-space:nowrap; }
#walletTools .toolbar > label { min-width:0; }
@media (max-width:650px) {
  .site-tabs { padding:8px 12px; }
  .site-tabs a { padding:7px 10px; }
  #addWallet { grid-template-columns:1fr; gap:8px; }
}
