:root {
  color-scheme: dark;
  --paper: #0d1410;
  --sheet: #17221b;
  --raised: #1c2a21;
  --hover: #25382b;
  --ink: #eef5ed;
  --muted: #a6b7aa;
  --green: #a6dfae;
  --on-green: #14291b;
  --focus: #bcf1ae;
  --dark: #14271b;
  --line: #324638;
  --line-strong: #627c67;
  --gain: #a1e8b0;
  --loss: #ffb2a1;
  --gain-cell: #223c2a;
  --loss-cell: #402b29;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse 900px 370px at 50% -160px, #213d2b, transparent), var(--paper); font: 16px/1.5 var(--sans); }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.frame { width: min(1210px, calc(100% - 96px)); margin: 0 auto; }
.site-header { border-bottom: 1px solid var(--line); background: #111a14; }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 65px; gap: 16px; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 9px; text-decoration: none; font: 700 19px/1 var(--sans); letter-spacing: -.055em; }
.header-inner nav, .utilities { display: flex; align-items: center; gap: 16px; }
.header-inner nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; padding: 10px 3px; }
.header-inner nav a:hover { color: var(--green); text-decoration: underline; }
.utilities { justify-self: end; gap: 8px; }
button { transition: background-color .15s ease, border-color .15s ease; }
.plain-button, .outline-button, .solid-button, .icon-button { background: transparent; border: 1px solid transparent; border-radius: 6px; min-height: 42px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-size: 14px; font-weight: 700; }
.plain-button:hover { background: var(--hover); }
.outline-button, .icon-button { border-color: var(--line-strong); background: var(--sheet); }
.outline-button:hover, .icon-button:hover { background: var(--hover); border-color: #83a38b; }
.solid-button { border-color: var(--green); background: var(--green); color: var(--on-green); }
.solid-button:hover { background: #b9ecc1; border-color: #b9ecc1; }
.icon-button { min-width: 42px; padding: 0; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--green); font: 600 12px/1.4 var(--mono); letter-spacing: .075em; }
.intro { display: grid; grid-template-columns: minmax(0,1fr) minmax(440px,.84fr); align-items: center; gap: 30px; padding: 45px 0 29px; }
.protocol .icon { width: 19px; height: 19px; }
.intro h1 { font: 400 clamp(55px, 6.1vw, 91px)/.98 var(--serif); letter-spacing: -.043em; margin: 8px 0 13px; }
.intro h1 span { color: var(--green); }
.intro-copy p { color: var(--muted); line-height: 1.4; }
.lookup { align-self: center; border: 1px solid var(--line-strong); background: var(--raised); border-radius: 8px; padding: 13px 15px 9px; }
.lookup label { font-size: 14px; font-weight: 700; }
.wallet-entry { display: flex; gap: 7px; margin-top: 6px; }
.input-wrap { display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); background: var(--sheet); border-radius: 6px; min-width: 0; color: var(--muted); }
.input-wrap:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.input-wrap:has([aria-invalid="true"]) { border-color: var(--loss); }
.input-wrap input { padding: 0; min-height: 41px; width: 100%; min-width: 0; border: 0; background: transparent; outline: 0; font: 400 14px/1.4 var(--mono); }
.input-wrap input::placeholder { font-family: var(--sans); color: var(--muted); opacity: 1; }
.wallet-entry .input-wrap { flex: 1; }
.wallet-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.compact { min-height: 32px; font-size: 13px; }
.compact .icon { width: 14px; height: 14px; }
.wallet-feedback { margin-top: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.wallet-feedback:empty { display: none; }
.wallet-feedback[data-error="true"] { color: var(--loss); }
.journal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-strong); padding: 12px 0; }
.source { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--mono); color: var(--green); }
.source > span:first-child { width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.source[data-source="live"] > span:first-child { background: var(--gain); }
.source[data-source="loading"] > span:first-child { background: #f8ce87; }
.journal-tools { display: flex; align-items: center; gap: 12px; }
.timezone { color: var(--muted); font-size: 13px; }
.journal-source { display: flex; align-items: baseline; gap: 4px 13px; flex-wrap: wrap; min-width: 0; }
.fx-status { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fx-status:empty { display: none; }
.fx-status[data-error="true"] { color: var(--loss); }
.currency-select select { width: clamp(129px, 19vw, 178px); font-family: var(--mono); }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .49fr); gap: 15px; scroll-margin-top: 12px; }
.calendar-panel { padding: 16px 18px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); min-width: 0; }
.calendar-kicker { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.calendar-kicker h2, .period-heading h2 { font-size: 15px; font-weight: 700; }
.calendar-key { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.calendar-key i { width: 10px; height: 10px; border-radius: 2px; background: var(--gain-cell); border: 1px solid #78ae84; }
.calendar-key i:nth-of-type(2) { margin-left: 4px; background: var(--loss-cell); border-color: #d38477; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.calendar-month { font: 400 clamp(29px, 3vw, 42px)/1.05 var(--serif); letter-spacing: -.018em; }
.calendar-nav { display: flex; gap: 5px; }
.calendar-arrow { min-width: 38px; min-height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--sheet); color: var(--green); }
.calendar-arrow { font-size: 22px; line-height: 1; }
.calendar-arrow:hover:not(:disabled) { background: var(--hover); }
.calendar-nav svg { width: 16px; height: 16px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.calendar-weekday { padding: 4px 0; text-align: center; color: var(--muted); font: 500 12px var(--mono); }
.calendar-blank, .calendar-day { border-radius: 4px; border: 1px solid var(--line); min-height: 49px; min-width: 0; background: #19271e; }
.calendar-blank { border-color: #25342a; background: transparent; }
.calendar-day { width: 100%; padding: 4px 5px; min-height: 49px; display: flex; align-items: flex-start; gap: 2px; flex-direction: column; text-align: left; color: var(--muted); font: 500 12px/1 var(--mono); }
.calendar-day:disabled { opacity: 1; }
.calendar-day.has-positions { color: var(--ink); }
.calendar-day.has-positions:hover { border-color: #91ae98; }
.calendar-day.is-positive { background: var(--gain-cell); border-color: #4a7456; color: var(--gain); }
.calendar-day.is-negative { background: var(--loss-cell); border-color: #85564b; color: var(--loss); }
.calendar-day.is-flat, .calendar-day.is-missing { background: var(--raised); border-color: var(--line-strong); }
.calendar-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.calendar-day:focus-visible { outline-offset: 1px; }
.calendar-date { font-size: 12px; }
.calendar-pnl { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-top: 3px; }
.calendar-count { font-family: var(--sans); font-size: 11px; line-height: 1; opacity: .9; }
.calendar-hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.period { display: flex; flex-direction: column; border: 1px solid #3b5a43; background: linear-gradient(145deg, #223f2d 0%, var(--dark) 75%); color: var(--ink); border-radius: 8px; padding: 17px 20px 18px; min-width: 0; }
.period-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #4a6550; }
.period-heading .icon { color: var(--green); }
#period-body { display: flex; flex-direction: column; flex: 1; }
.period-context { color: var(--muted); font: 500 12px var(--mono); margin-top: 13px; }
.period-value { font: 400 clamp(33px, 4vw, 60px)/1 var(--serif); letter-spacing: -.02em; overflow-wrap: anywhere; margin-top: 5px; }
.period-value.gain { color: var(--gain); }
.period-value.loss { color: var(--loss); }
.period-caption { font-size: 14px; color: var(--muted); margin-top: 5px; }
.period-metrics { display: grid; margin: 17px 0 12px; }
.period-metrics div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid #3e5945; font-size: 14px; }
.period-metrics dt { color: var(--ink); }
.period-metrics dd { margin: 0; font: 500 13px/1.6 var(--mono); text-align: right; }
.outcomes { margin-top: auto; }
.outcomes-bar { height: 6px; border-radius: 6px; overflow: hidden; display: flex; background: #3c5542; }
.outcomes-bar .wins { background: #9bd7a3; }
.outcomes-bar .losses { background: #e19584; }
.outcomes-bar .flat { background: #bdc8b4; }
.outcomes-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.outcomes-label strong { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.token-section { margin-top: 27px; scroll-margin-top: 12px; }
.token-search { width: min(220px, 48%); }
.token-note { margin: 9px 0; color: var(--muted); font-size: 13px; }
.token-table th:not(:first-child), .token-table td:not(:first-child) { text-align: right; }
.token-table td:nth-child(5) { width: 128px; }
.token-table td:nth-child(4) { font-weight: 600; }
.token-table td.empty-state { text-align: center; }
.token-table .position-name { min-width: 105px; }
.token-table .token { width: 28px; height: 28px; flex: none; }
.token-table .outline-button { min-height: 36px; font-size: 13px; }
.token-table .outline-button[aria-pressed="true"] { background: var(--gain-cell); border-color: var(--green); }
.token-section + .log { margin-top: 19px; }
.active-token { display: inline-flex; align-items: center; gap: 5px; width: fit-content; margin: 0 0 9px; padding-left: 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--gain-cell); color: var(--green); font-size: 13px; font-weight: 700; }
.active-token .icon-button { min-height: 34px; min-width: 36px; background: transparent; border: 0; }
.active-token .icon-button:hover { background: #36523c; }
.active-token .icon { width: 14px; height: 14px; }
.log { margin-top: 27px; scroll-margin-top: 12px; }
.log-heading, .log-controls, .log-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.log-heading h2 { font: 400 clamp(36px, 4vw, 49px)/1 var(--serif); }
.log-heading p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.log-controls { justify-content: flex-start; margin: 14px 0 9px; }
.select-label { position: relative; }
.select-label select { min-height: 42px; appearance: none; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 30px 0 10px; font-size: 14px; font-weight: 600; }
.select-label [data-icon] { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); pointer-events: none; }
.select-label .icon { width: 14px; height: 14px; }
.filter-field { margin-left: auto; width: min(260px, 45%); }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead { background: var(--raised); color: var(--muted); }
th { font-size: 13px; font-weight: 700; padding: 4px 12px; height: 40px; border-bottom: 1px solid var(--line); }
td { padding: 7px 12px; border-top: 1px solid var(--line); font-size: 14px; }
td:nth-child(4),td:nth-child(5),th:nth-child(4),th:nth-child(5) { text-align: right; }
td:nth-child(5) { font-weight: 600; }
td:last-child { width: 56px; text-align: right; }
td:first-child { min-width: 107px; }
tr:hover td { background: #223228; }
.sort-button { min-height: 33px; padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 4px; font-size: inherit; font-weight: inherit; }
.sort-button .icon { width: 13px; height: 13px; }
.table-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.position-name { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.position-name strong { font-size: 15px; }
.date-cell strong { font-weight: 500; }
.secondary-line { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.pool-code { font: 400 12px var(--mono); }
.token-pair { display: flex; padding-right: 2px; }
.token { display: grid; place-items: center; position: relative; overflow: hidden; width: 26px; height: 26px; border: 1px solid var(--sheet); border-radius: 50%; color: var(--ink); background: var(--token-color, #3a6043); font: 700 11px var(--sans); }
.token + .token { margin-left: -7px; }
.token img { position: absolute; width: 100%; height: 100%; object-fit: cover; background: var(--token-color, #3a6043); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.row-button { min-width: 41px; min-height: 39px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--raised); color: var(--green); display: inline-grid; place-items: center; }
.row-button:hover { background: var(--hover); border-color: var(--line-strong); }
.row-button .icon { width: 15px; height: 15px; }
td.empty-state { height: 92px; white-space: normal; text-align: center; color: var(--muted); }
.log-footer { min-height: 51px; color: var(--muted); font-size: 13px; }
#pagination { display: flex; gap: 5px; }
#pagination button { min-height: 36px; }
.site-footer { border-top: 1px solid var(--line-strong); display: flex; justify-content: space-between; gap: 12px; padding: 15px 0 22px; color: var(--muted); font-size: 13px; }
.site-footer span span { margin: 0 5px; }
dialog { border: 1px solid var(--line-strong); border-radius: 9px; background: var(--sheet); color: var(--ink); padding: 19px 22px 22px; width: min(633px, calc(100% - 24px)); max-height: 87dvh; overflow: auto; box-shadow: 0 16px 76px #0009; }
dialog::backdrop { background: #080e0bc9; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 13px; }
.dialog-heading h2 { font: 400 38px/.99 var(--serif); margin-top: 4px; overflow-wrap: anywhere; }
.dialog-copy { font-size: 15px; }
.dialog-copy p + p { margin-top: 10px; }
.detail-meta { color: var(--muted); font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 13px 0; }
.detail-grid div { padding: 8px 9px; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; display: grid; gap: 4px; }
.detail-grid small { color: var(--muted); }
.detail-grid strong { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.detail-links { display: flex; gap: 6px 13px; flex-wrap: wrap; font-size: 14px; margin: 10px 0; }
.external { color: var(--green); }
.activity { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.activity h3 { font-size: 16px; margin-bottom: 7px; }
.activity ul { padding: 0; list-style: none; margin: 0; }
.activity li { border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; font-size: 14px; }
.activity li p { overflow-wrap: anywhere; }
.activity li time { white-space: nowrap; }
.toast { position: fixed; z-index: 1; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: 90vw; width: max-content; padding: 8px 14px; border-radius: 7px; color: var(--ink); background: var(--dark); border: 1px solid var(--line-strong); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1050px) {
  .frame { width: calc(100% - 56px); }
  .intro { grid-template-columns: minmax(0,1fr) minmax(355px,.87fr); gap: 20px; }
  .review-grid { grid-template-columns: minmax(0, 1fr) minmax(252px,.51fr); }
  .calendar-panel { padding-inline: 12px; }
}
@media (max-width: 750px) {
  .frame { width: calc(100% - 28px); }
  .intro { grid-template-columns: 1fr; gap: 16px; padding: 26px 0 18px; }
  .review-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .period { padding: 15px; }
  .header-inner { grid-template-columns: 1fr auto; min-height: 59px; gap: 0 10px; }
  .header-inner nav { grid-row: 2; grid-column: 1 / -1; }
  .header-inner nav a { padding: 8px 0 9px; }
  .brand,.utilities { min-height: 52px; }
  .log-controls { gap: 6px; }
  .calendar-day,.calendar-blank { min-height: 47px; }
  .table-wrap { width: 100%; }
}
@media (max-width: 430px) {
  .intro h1 { font-size: clamp(44px, 12vw, 58px); }
  .lookup { padding-inline: 9px; }
  .wallet-entry .solid-button { padding-inline: 8px; }
  .wallet-entry .input-wrap { padding-inline: 8px; }
  .utilities { gap: 4px; }
  .utilities .utility-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .calendar-grid { gap: 3px; }
  .calendar-day { padding-inline: 3px; }
  .calendar-pnl { font-size: 10px; letter-spacing: -.045em; }
  .calendar-count { font-size: 10px; }
  .log-controls { flex-wrap: wrap; }
  .token-heading { align-items: flex-start; }
  .token-search { padding-inline: 6px; gap: 5px; }
  .filter-field { width: 100%; margin-left: 0; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .source { font-size: 12px; gap: 5px; }
  .journal-tools { gap: 7px; }
  .journal-bar { align-items: flex-start; }
  .timezone { display: none; }
  dialog { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } button { transition: none; } }
