:root {
  color-scheme: light;
  --paper: #e9e7df;
  --ink: #141512;
  --muted: #6d6d65;
  --line: #b9b8b0;
  --signal: #d8ff3e;
  --danger: #a62e22;
  --bot: #3f8f73;
  --rain: #3576b8;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(20, 21, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 21, 18, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

button { font: inherit; }
a { color: inherit; }
.net-worth strong, .allocation-item strong, .performance-strip strong,
.source-name-line strong, .asset-row strong, .asset-change, .asset-total {
  font-variant-numeric: tabular-nums;
}
.portfolio-board { width: min(1440px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 20px 0 16px; }
.portfolio-header {
  min-height: 100px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.back-link, .kicker, .header-status, .net-worth span, .net-worth small,
.allocation-item span, .allocation-item small, .source-kicker, .source-status,
.wallet-address, .asset-head, .asset-row small, .asset-change, .asset-total,
.performance-strip span, .performance-strip small, footer {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
}
.back-link { font-size: 9px; font-weight: 500; letter-spacing: .06em; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; outline: 0; }
.kicker { color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: .11em; }
.heading-copy h1 { margin: 4px 0 0; font-size: clamp(38px, 5vw, 64px); font-weight: 600; line-height: .86; letter-spacing: -.06em; }
.heading-copy p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.header-status { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 8px; letter-spacing: .07em; }
.header-status button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 5px 0; color: var(--ink); font: 500 8px "DM Mono", monospace; cursor: pointer; }
.header-status button:disabled { color: var(--muted); border-color: var(--line); cursor: wait; }
.refresh-dot { width: 8px; height: 8px; border: 1px solid var(--ink); border-radius: 50%; background: var(--signal); }

.overview { min-height: 132px; display: grid; grid-template-columns: minmax(300px, .95fr) minmax(0, 2.05fr); border-bottom: 1px solid var(--ink); }
.net-worth { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 18px 32px 18px 0; border-right: 1px solid var(--line); }
.net-worth span, .net-worth small { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.net-worth strong { margin: 8px 0 5px; font-size: clamp(44px, 5.4vw, 76px); font-weight: 500; line-height: .86; letter-spacing: -.065em; white-space: nowrap; }
.allocation-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.allocation-item { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 18px 28px; border-right: 1px solid var(--line); }
.allocation-item:last-child { border-right: 0; }
.allocation-item span, .allocation-item small { color: var(--muted); font-size: 7px; line-height: 1.3; letter-spacing: .06em; overflow-wrap: anywhere; }
.allocation-item strong { display: block; margin: 8px 0 5px; font-size: clamp(23px, 2.7vw, 38px); font-weight: 500; line-height: .95; letter-spacing: -.045em; overflow-wrap: anywhere; }
.performance-strip { min-height: 84px; display: grid; grid-template-columns: 1.15fr 1fr .65fr; border-bottom: 1px solid var(--ink); }
.performance-strip article { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "note note"; column-gap: 24px; row-gap: 7px; align-content: center; align-items: baseline; padding: 13px 28px; border-right: 1px solid var(--line); }
.performance-strip article:first-child { padding-left: 0; }
.performance-strip article:last-child { padding-right: 0; border-right: 0; }
.performance-strip span, .performance-strip small { color: var(--muted); font-size: 7px; letter-spacing: .07em; }
.performance-strip span { grid-area: label; }
.performance-strip strong { grid-area: value; font-size: clamp(23px, 2.6vw, 37px); font-weight: 500; line-height: .95; letter-spacing: -.045em; white-space: nowrap; }
.performance-strip small { grid-area: note; text-align: right; }
.allocation-track { display: flex; height: 9px; margin: 12px 0 0; background: var(--line); }
.allocation-segment { min-width: 0; height: 100%; transition: width .2s ease; }
.allocation-segment.etoro { background: var(--ink); }
.allocation-segment.rain { background: var(--rain); }
.allocation-segment.solana-trader { background: var(--bot); }

.source-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; padding: 24px 0 26px; border-bottom: 1px solid var(--ink); }
.source-panel { min-width: 0; }
.source-panel:first-child { grid-column: auto; grid-row: auto; padding: 0 28px 0 0; border-right: 1px solid var(--line); }
.source-panel:nth-child(2) { grid-column: auto; grid-row: auto; padding: 0 28px; border-right: 1px solid var(--line); }
.source-panel:nth-child(3) { grid-column: auto; grid-row: auto; padding: 0 0 0 28px; }
.source-heading { min-height: 88px; display: flex; flex-direction: column; justify-content: flex-start; border-bottom: 1px solid var(--ink); }
.source-heading-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.source-heading-top > *, .source-meta > *, .asset-head > *, .asset-row > * { min-width: 0; }
.source-kicker, .source-status { color: var(--muted); font-size: 7px; letter-spacing: .08em; }
.source-status.live { color: #315b00; }
.source-status.offline { color: var(--danger); }
.source-name-line { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 24px; margin-top: 7px; }
.source-name-line h2 { min-width: 0; margin: 0; font-size: clamp(22px, 2.1vw, 32px); line-height: .95; letter-spacing: -.045em; overflow-wrap: anywhere; }
.source-name-line strong { font-size: clamp(22px, 2.4vw, 34px); font-weight: 500; line-height: .9; letter-spacing: -.045em; white-space: nowrap; }
.source-meta { min-height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 8px; }
.wallet-address { min-width: 0; color: var(--muted); font-size: 7px; line-height: 1.3; letter-spacing: .03em; overflow-wrap: anywhere; text-decoration: none; }
.wallet-address:hover, .wallet-address:focus-visible { color: var(--ink); text-decoration: underline; outline: 0; }
.source-performance { flex: 0 0 auto; font: 500 8px "DM Mono", monospace; }
.positive { color: #315b00; }
.negative { color: var(--danger); }
.asset-table { min-width: 0; }
.asset-head, .asset-row { display: grid; grid-template-columns: minmax(78px, 1.25fr) minmax(0, .68fr) minmax(0, .76fr) minmax(0, .52fr) minmax(0, .48fr); gap: 10px; align-items: center; }
.asset-head { min-height: 30px; color: var(--muted); font-size: 6px; letter-spacing: .07em; }
.asset-head span:not(:first-child) { text-align: right; }
.asset-row { min-height: 54px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
.asset-row:hover .asset-symbol, .asset-row:focus-visible .asset-symbol { text-decoration: underline; }
.asset-row:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.asset-identity { min-width: 0; }
.asset-symbol { display: block; font-size: 14px; line-height: 1.05; overflow-wrap: anywhere; }
.asset-name { display: block; margin-top: 5px; color: var(--muted); font: 500 7px/1.3 "DM Mono", monospace; overflow-wrap: anywhere; text-transform: uppercase; }
.asset-row strong:not(.asset-symbol) { font-size: clamp(9px, .85vw, 12px); font-weight: 600; line-height: 1.15; text-align: right; white-space: nowrap; }
.asset-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 6px; text-align: right; }
.asset-units, .asset-value { min-width: 0; text-align: right; }
.asset-change, .asset-total { justify-self: end; min-width: 0; font-size: 7px; text-align: right; white-space: nowrap; }
.asset-change.unpriced { color: var(--muted); }
.empty-source { min-height: 180px; display: grid; place-items: center; margin: 0; color: var(--muted); font: 500 8px/1.5 "DM Mono", monospace; text-align: center; text-transform: uppercase; }
.trade-ledger { margin-top: 24px; border-top: 1px solid var(--ink); }
.trade-ledger-heading { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font: 500 6px "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.trade-ledger-heading strong { color: var(--ink); font-size: 7px; }
.trade-pager { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.trade-pager button { width: 23px; height: 21px; display: grid; place-items: center; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 0 0 2px; font: 700 14px/1 "DM Mono", monospace; cursor: pointer; }
.trade-pager button:hover, .trade-pager button:focus-visible { background: var(--ink); color: var(--paper); outline: 0; }
.trade-row { min-height: 58px; display: grid; grid-template-columns: minmax(78px, 1fr) minmax(72px, .9fr) minmax(88px, .9fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
.trade-row:hover .trade-identity strong, .trade-row:focus-visible .trade-identity strong { text-decoration: underline; }
.trade-row:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.trade-row > * { min-width: 0; }
.trade-row strong { display: block; font-size: clamp(8px, .72vw, 11px); line-height: 1.15; white-space: nowrap; }
.trade-identity strong { font-size: 13px; overflow-wrap: anywhere; white-space: normal; }
.trade-row small { display: block; margin-top: 4px; color: var(--muted); font: 500 6px/1.25 "DM Mono", monospace; text-transform: uppercase; overflow-wrap: anywhere; }
.trade-closed, .trade-net { text-align: right; }
.trade-return { justify-self: end; font: 500 8px "DM Mono", monospace; white-space: nowrap; }
.empty-trades { min-height: 72px; display: grid; place-items: center; margin: 0; color: var(--muted); font: 500 7px "DM Mono", monospace; text-transform: uppercase; }
.trader-strategy { margin-top: 24px; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.trader-strategy > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 500 7px "DM Mono", monospace; letter-spacing: .06em; }
.trader-strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.trader-strategy-grid div { min-width: 0; }
.trader-strategy-grid strong { display: block; font-size: 14px; line-height: 1; }
.trader-strategy-grid small, .trader-strategy > p { display: block; margin-top: 4px; color: var(--muted); font: 500 6px/1.4 "DM Mono", monospace; letter-spacing: .03em; }
.trader-strategy > p { margin: 10px 0 0; }
.trader-strategy .trader-strategy-error { color: var(--danger); overflow-wrap: anywhere; }
.loading-message { grid-column: 1 / -1; display: grid; place-items: center; min-height: 340px; color: var(--muted); font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
footer { min-height: 42px; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 7px; letter-spacing: .06em; }
footer span:first-child { color: var(--ink); }
footer span:nth-child(2) { margin-right: auto; }
footer a { text-decoration: none; }
footer a:hover, footer a:focus-visible { text-decoration: underline; outline: 0; }

@media (max-width: 980px) {
  .portfolio-header { grid-template-columns: 130px minmax(0, 1fr); }
  .header-status { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
  .overview { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.5fr); }
  .source-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-panel:first-child { padding-right: 18px; }
  .source-panel:nth-child(2) { padding: 0 18px; }
  .source-panel:nth-child(3) { padding-left: 18px; }
}

@media (max-width: 760px) {
  .portfolio-board { width: calc(100% - 20px); padding-top: 10px; }
  .portfolio-header { grid-template-columns: 1fr; gap: 11px; }
  .header-status { grid-column: auto; }
  .heading-copy h1 { font-size: 44px; }
  .overview { grid-template-columns: 1fr; }
  .net-worth { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .net-worth strong { font-size: 58px; }
  .allocation-summary { grid-template-columns: 1fr 1fr 1fr; }
  .allocation-item { padding: 14px 9px; }
  .allocation-item strong { font-size: 21px; }
  .performance-strip { grid-template-columns: 1fr 1fr; }
  .performance-strip article { grid-template-columns: 1fr; grid-template-areas: "label" "value" "note"; gap: 6px; padding: 14px 10px; }
  .performance-strip article:first-child { padding-left: 0; }
  .performance-strip article:nth-child(2) { padding-right: 0; border-right: 0; }
  .performance-strip article:last-child { grid-column: 1 / -1; grid-template-columns: 1fr auto; grid-template-areas: "label value" "note note"; padding: 12px 0; border-top: 1px solid var(--line); }
  .source-layout { display: block; }
  .source-panel, .source-panel:first-child, .source-panel:nth-child(2), .source-panel:nth-child(odd), .source-panel:nth-child(even) { padding: 22px 0; margin: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .source-panel:last-child { border-bottom: 0; }
  .source-heading { min-height: 98px; }
  .source-name-line h2 { font-size: 29px; }
  .source-name-line strong { font-size: 30px; }
  .asset-head { display: none; }
  .asset-row { grid-template-columns: minmax(100px, 1fr) minmax(70px, .6fr) minmax(75px, .7fr); }
  .asset-change, .asset-total { display: none; }
  .trade-row { grid-template-columns: minmax(110px, 1fr) minmax(90px, .7fr) minmax(105px, .8fr) auto; }
  footer { flex-wrap: wrap; padding: 10px 0; }
  footer span:nth-child(2) { width: 100%; order: 3; }
}

@media (width: 800px) and (height: 480px) {
  .portfolio-board { width: calc(100% - 20px); padding: 7px 0 5px; }
  .portfolio-header { min-height: 50px; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 5px 0; }
  .heading-copy h1 { margin-top: 1px; font-size: 27px; }
  .heading-copy p, .header-status button { display: none; }
  .back-link, .kicker, .header-status { font-size: 5px; }
  .header-status { grid-column: auto; padding: 0; border: 0; }
  .overview { min-height: 72px; grid-template-columns: 210px 1fr; }
  .net-worth { padding: 8px 10px 8px 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .net-worth span, .net-worth small { font-size: 5px; }
  .net-worth strong { margin: 4px 0 2px; font-size: 34px; }
  .allocation-item { padding: 6px 9px; }
  .allocation-item span, .allocation-item small { font-size: 4px; }
  .allocation-item strong { margin: 3px 0 2px; font-size: 17px; }
  .allocation-track { height: 5px; margin-top: 5px; }
  .performance-strip { min-height: 42px; grid-template-columns: 1.1fr 1fr .65fr; }
  .performance-strip article, .performance-strip article:last-child { grid-column: auto; grid-template-columns: 1fr; grid-template-areas: "label" "value" "note"; gap: 2px; padding: 4px 7px; border-top: 0; border-right: 1px solid var(--line); }
  .performance-strip article:first-child { padding-left: 0; }
  .performance-strip article:last-child { padding-right: 0; border-right: 0; }
  .performance-strip span, .performance-strip small { font-size: 3px; }
  .performance-strip strong { font-size: 12px; }
  .performance-strip article:last-child small { grid-column: auto; text-align: left; }
  .source-layout { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; padding: 7px 0; }
  .source-panel, .source-panel:first-child, .source-panel:nth-child(2), .source-panel:nth-child(odd), .source-panel:nth-child(even) { grid-column: auto; grid-row: auto; padding: 0 8px; margin: 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .source-panel:first-child { padding-left: 0; }
  .source-panel:last-child { padding-right: 0; border-right: 0; }
  .source-heading { min-height: 48px; }
  .source-kicker, .source-status, .wallet-address, .source-performance { font-size: 4px; }
  .source-name-line { margin-top: 3px; }
  .source-name-line h2, .source-name-line strong { font-size: 16px; }
  .source-meta { min-height: 12px; margin-top: 2px; }
  .asset-head { display: grid; min-height: 14px; font-size: 3px; }
  .asset-head, .asset-row { grid-template-columns: minmax(48px, 1.15fr) .58fr .68fr .48fr .42fr; gap: 2px; }
  .asset-row { min-height: 27px; padding: 3px 0; }
  .asset-row:nth-child(n+8) { display: none; }
  .asset-symbol, .asset-row strong:not(.asset-symbol) { font-size: 6px; }
  .asset-name, .asset-row small, .asset-change { margin-top: 1px; font-size: 3px; }
  .trade-ledger { margin-top: 5px; }
  .trade-ledger-heading { min-height: 12px; font-size: 3px; }
  .trade-ledger-heading strong { font-size: 4px; }
  .trade-pager { gap: 2px; }
  .trade-pager button { width: 10px; height: 9px; padding-bottom: 1px; font-size: 6px; }
  .trade-row { min-height: 24px; grid-template-columns: minmax(48px, 1fr) .72fr .85fr auto; gap: 2px; padding: 2px 0; }
  .trade-row strong, .trade-identity strong { font-size: 5px; }
  .trade-row small, .trade-return { margin-top: 1px; font-size: 3px; }
  footer { min-height: 15px; padding: 0; font-size: 4px; }
}


.source-panel.rain { display: flex; flex-direction: column; }
.source-panel.rain .asset-table { flex: 0 0 auto; }
.vwap500-card { min-height: 230px; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; margin-top: 24px; padding-top: 13px; border-top: 2px solid var(--ink); }
.vwap500-card header, .vwap500-meta, .vwap500-funding-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vwap500-card header, .vwap500-meta, .vwap500-funding-row small { color: var(--muted); font: 500 6px "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.vwap500-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 18px; margin: 9px 0 7px; }
.vwap500-title h3 { margin: 0; font-size: clamp(20px, 1.8vw, 28px); line-height: .95; letter-spacing: -.045em; }
.vwap500-title strong { font: 500 clamp(18px, 2vw, 28px) "DM Mono", monospace; letter-spacing: -.04em; }
.vwap500-meta { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.vwap500-position { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 16px 0; }
.vwap500-position strong { font-size: 16px; }
.vwap500-position span, .vwap500-position small { color: var(--muted); font: 500 6px "DM Mono", monospace; text-transform: uppercase; }
.vwap500-position small { text-align: right; }
.vwap500-funding { border-top: 1px solid var(--line); }
.vwap500-funding-row { min-height: 34px; border-bottom: 1px solid var(--line); }
.vwap500-funding-row strong { font-size: 11px; }
.vwap500-funding-row span { font: 500 9px "DM Mono", monospace; }
@media (max-width: 760px) { .vwap500-card { min-height: 260px; } }
@media (width: 800px) and (height: 480px) {
  .vwap500-card { min-height: 102px; margin-top: 5px; padding-top: 4px; }
  .vwap500-card header, .vwap500-meta, .vwap500-funding-row small, .vwap500-position span, .vwap500-position small { font-size: 3px; }
  .vwap500-title { margin: 2px 0; }
  .vwap500-title h3, .vwap500-title strong { font-size: 8px; }
  .vwap500-meta { padding-bottom: 3px; }
  .vwap500-position { padding: 4px 0; }
  .vwap500-position strong, .vwap500-funding-row strong { font-size: 5px; }
  .vwap500-funding-row { min-height: 14px; }
  .vwap500-funding-row span { font-size: 4px; }
}


.vwap-history { margin-top: 13px; }
.vwap-event-row { min-height: 48px; display: grid; grid-template-columns: minmax(76px, .8fr) minmax(110px, 1.35fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.vwap-event-row > * { min-width: 0; }
.vwap-event-identity strong { display: block; font-size: 11px; }
.vwap-event-identity small { display: block; margin-top: 4px; color: var(--muted); font: 500 6px/1.25 "DM Mono", monospace; text-transform: uppercase; }
.vwap-event-action { color: var(--muted); font: 500 6px/1.35 "DM Mono", monospace; text-transform: uppercase; }
.vwap-event-result { justify-self: end; font: 500 9px "DM Mono", monospace; white-space: nowrap; }
@media (width: 800px) and (height: 480px) {
  .vwap-history { margin-top: 3px; }
  .vwap-event-row { min-height: 20px; grid-template-columns: minmax(38px, .7fr) minmax(55px, 1.4fr) auto; gap: 2px; padding: 2px 0; }
  .vwap-event-identity strong, .vwap-event-result { font-size: 5px; }
  .vwap-event-identity small, .vwap-event-action { margin-top: 1px; font-size: 3px; }
}
