:root {
  color-scheme: only dark;
  --canvas: #000;
  --surface: #1c1c1e;
  --inset: #2a2a2c;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: #38383c;
  --control: #8e8e93;
  --green: #63e789;
  --green-fill: #18743e;
  font: 400 106.25%/1.47 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: -.015em;
  background: var(--canvas);
  color: var(--ink);
  accent-color: var(--green);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, p, dl, dd, pre { margin: 0; }
strong, h1, h2, .brand, .balance { font-weight: 600; }
button, input, select { font: inherit; }
button, .primary-link {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--green-fill);
  color: #fff;
  cursor: pointer;
  font-size: .94rem;
  touch-action: manipulation;
}
a { color: var(--green); }
.primary-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
:where(button, a, summary):active { opacity: .8; }
:where(button, a, summary, select, input):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
button:disabled { opacity: .45; cursor: default; }
.skip {
  position: fixed;
  z-index: 4;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  background: var(--surface);
  transform: translateY(-180%);
}
.skip:focus { transform: none; }
.masthead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1008px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
}
.brand {
  color: var(--ink);
  font-size: 1.18rem;
  letter-spacing: -.025em;
}
nav { display: flex; align-items: stretch; gap: 20px; }
nav button {
  position: relative;
  min-height: 60px;
  padding: 8px 4px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  letter-spacing: 0;
}
nav button[aria-current] { color: var(--green); }
nav button[aria-current]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: currentColor;
}
.nav-icon { display: none; }
main {
  max-width: 784px;
  padding: 56px 32px max(64px, env(safe-area-inset-bottom));
  margin: auto;
}
main:focus, h1:focus { outline: none; }
.page-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
h1 {
  font-size: clamp(2rem, 5vw, 2.82rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
h2 {
  margin: 32px 0 12px;
  font-size: 1.3rem;
  letter-spacing: -.005em;
  line-height: 1.25;
}
#view > h2:first-child { margin-top: 0; }
#view > p { margin-bottom: 8px; overflow-wrap: anywhere; }
#view > button:not(.tile) { margin: 8px 8px 8px 0; }
.meta, label, .state, .empty, .metric-label, .loading {
  color: var(--muted);
  font-size: .88rem;
}
.quiet {
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  padding: 8px 12px;
}
.secondary { border: 1px solid var(--control); background: transparent; color: var(--ink); }
.back { padding-left: 0; margin-bottom: 8px; }
.back::before, .chevron {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
}
.back::before { transform: rotate(135deg); margin: 0 8px 2px 2px; }
.refresh {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--green);
  background: var(--surface);
}
.refresh span { font-size: 1.4rem; line-height: 1; }
.tile {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 8px;
  padding: 20px 24px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.tile-body { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.tile-body strong { font-size: 1.06rem; }
.chevron { flex-shrink: 0; transform: rotate(-45deg); color: var(--muted); }
.entry, .overview {
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.entry p { margin-bottom: 20px; }
.empty { padding: 20px 0; border-top: 1px solid var(--line); }
.metric-label { color: var(--ink); }
.balance, .value, dd, pre, input { font-variant-numeric: tabular-nums; }
.balance {
  margin: 8px 0 0;
  font-size: clamp(2rem, 7vw, 3.3rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  color: var(--green);
}
.unit {
  display: inline-block;
  margin-inline-start: 8px;
  font-size: .4em;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
.overview > .meta { margin-top: 12px; }
.breakdown { border-top: 1px solid var(--line); }
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.breakdown-row dt { overflow-wrap: anywhere; }
.breakdown-row small { display: block; margin-top: 4px; }
.breakdown-row dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.value { font-size: 1.76rem; letter-spacing: -.015em; }
#notice:not(:empty) {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface);
  border-left: 2px solid var(--control);
}
form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
form > button { grid-column: 1 / -1; justify-self: start; }
label { display: grid; gap: 8px; }
input, select {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
summary { min-height: 44px; cursor: pointer; padding: 12px 0; overflow-wrap: anywhere; }
details form, details > label { margin: 8px 0 16px; }
pre {
  margin: 12px 0;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  font-family: inherit;
  font-size: .94rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  button:hover, .primary-link:hover { filter: brightness(1.13); }
  nav button:hover { color: var(--ink); }
  .tile:hover { border-color: var(--control); }
}
@media (max-width: 700px) {
  .masthead { position: static; }
  .masthead-inner {
    min-height: 48px;
    padding: 0 max(20px, env(safe-area-inset-left));
  }
  nav {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  @supports (backdrop-filter: blur(20px)) {
    nav { background: rgb(28 28 30 / 92%); backdrop-filter: blur(20px); }
  }
  nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 64px;
    padding: 6px 4px 4px;
    font-size: .79rem;
    line-height: 1.15;
    text-wrap: balance;
  }
  nav button[aria-current]::after {
    width: 16px;
    bottom: auto;
    top: -5px;
    margin: 0 auto;
    border-radius: 2px;
  }
  .nav-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    flex: none;
  }
  .nav-icon::before, .nav-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
  }
  .icon-deals::before {
    inset: 5px 0 1px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
  }
  .icon-deals::after {
    inset: 2px 5px auto;
    height: 4px;
    border: 1.6px solid currentColor;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
  }
  .icon-summary::before {
    bottom: 1px; left: 2px;
    width: 3px; height: 7px;
    background: currentColor;
    border-radius: 1px;
    box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor;
  }
  .icon-summary::after { inset: auto 0 0; border-bottom: 1.6px solid currentColor; }
  .icon-docs::before {
    inset: 1px 3px 1px;
    border: 1.6px solid currentColor;
    border-radius: 2px;
  }
  .icon-docs::after {
    inset: 7px 7px auto;
    height: 5px;
    border-block: 1.4px solid currentColor;
  }
  main {
    padding: 28px max(20px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .page-heading { gap: 8px; margin-bottom: 24px; }
  .tile { padding: 16px; }
  .breakdown-row { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
}
@media (max-width: 360px) {
  form { grid-template-columns: 1fr; }
  .breakdown-row { grid-template-columns: 1fr; }
  .breakdown-row dd { text-align: left; }
}
@media (prefers-reduced-transparency: reduce) {
  nav { backdrop-filter: none; background: var(--surface); }
}
