:root {
  color-scheme: dark;
  --surface: #121316;
  --control: #191a1f;
  --rule: #2b2d35;
  --text: #eeeef1;
  --muted: #a3a5af;
  --accent: #b4b2ff;
  --positive: #81d2a4;
  --negative: #f0a49c;
  --warning: #edc38c;
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); }
main { max-width: 1112px; margin-inline: auto; padding: 0 32px 32px; }
h1, h2, p, dl, dd { margin: 0; }
button, input { font: inherit; }
table, .chart-scale, .timeline { font-variant-numeric: tabular-nums; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 8px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}
h1 {
  align-self: start;
  padding-block: 10px;
  font-size: .9375rem;
  font-weight: 640;
  letter-spacing: -.015em;
}
.wallet-field, .settings-row { display: flex; align-items: center; min-width: 0; }
.wallet-field {
  align-items: stretch;
  height: 44px;
  background: var(--control);
  border: 1px solid var(--rule);
}
.wallet-field input:focus { outline: 1px solid #a3a5af; outline-offset: -1px; }
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
}
.icon-button:hover, .icon-button[aria-expanded="true"] {
  background: var(--control);
  border-color: var(--rule);
  color: var(--text);
}
.wallet-field .icon-button {
  height: auto;
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  background: #dedee3;
  color: #191a1f;
}
.wallet-field .icon-button:hover { background: #f0f0f3; }
.wallet-field .icon-button:focus-visible { outline: 2px solid #35363c; outline-offset: -4px; }
input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 9px;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: system-ui, sans-serif;
  font-size: .875rem;
}
.wallet-field input { height: auto; border: 0; border-radius: 0; background: transparent; }
.wallet-field input:not(:focus) { text-overflow: ellipsis; }
#form-error:not(:empty), #key-status:not(:empty) {
  display: block;
  color: var(--warning);
  font-size: .875rem;
  padding-top: 6px;
}
#settings {
  display: grid;
  gap: 7px;

}
#settings label { color: var(--muted); font-size: .875rem; }
#settings label:not(:first-child) { margin-top: 4px; }
.settings-row { gap: 6px; }
.settings-row .icon-button { border-color: var(--rule); }

.overview { margin-block: 31px 26px; }
.amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  font-size: clamp(2.55rem, 6vw, 4.5rem);
  line-height: 1.06;
  font-weight: 610;
  letter-spacing: -.065em;
  font-variant-numeric: tabular-nums lining-nums;
  margin-top: 5px;
}
#total { overflow-wrap: anywhere; }
.amount small { font: 550 .875rem/1.4 system-ui, sans-serif; letter-spacing: 0; color: var(--muted); }
#coverage { color: var(--warning); font-size: .875rem; margin-top: 5px; }
.chart { height: clamp(132px, 25vw, 235px); margin-top: 16px; position: relative; }
canvas { width: 100%; height: 100%; position: absolute; inset: 0; }
.chart-scale {
  position: absolute;
  inset: 10px 0 10px auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: end;
  width: max-content;
  font: .75rem/1 system-ui, sans-serif;
  color: var(--muted);
  pointer-events: none;
}
.timeline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: .75rem/1.4 system-ui, sans-serif;
  min-height: 17px;
}
.holdings h2 { font-size: 1rem; font-weight: 630; margin-bottom: 10px; }
.notice { color: var(--warning); font-size: .875rem; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--rule); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-size: .875rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
th small { font: .7rem/1 system-ui, sans-serif; }
th:nth-child(2), th:nth-child(3), td:nth-child(2), td:nth-child(3) { text-align: right; }
td:nth-child(2), td:nth-child(3) { font-family: system-ui, sans-serif; white-space: nowrap; font-size: .875rem; }
th:last-child, td:last-child { width: 118px; padding-left: 20px; }
td:last-child { font-size: .875rem; color: var(--muted); }
tr:last-child td { border-bottom: 1px solid var(--rule); }
.asset { display: block; color: inherit; text-decoration: none; width: fit-content; max-width: 100%; }
.asset:hover .asset-name { text-decoration: underline; text-underline-offset: 3px; }
.asset-name, .asset-detail { display: block; max-width: min(32vw, 290px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-name { font-size: .9375rem; font-weight: 630; }
.asset-detail { color: var(--muted); font-size: .8125rem; }
.empty { padding: 18px 0 !important; color: var(--muted); }

@media (max-width: 660px) {
  main { padding-inline: 16px; padding-bottom: 20px; }
  .toolbar { grid-template-columns: 1fr auto auto; gap: 3px; padding-block: 7px 11px; }

  .overview { margin-block: 21px 20px; }
  .chart { margin-top: 12px; }
  th, td { padding-inline: 6px; }
  th:last-child, td:last-child { width: auto; padding-left: 10px; }
  td:nth-child(2), td:nth-child(3), td:last-child { font-size: .8125rem; }
  
}

#welcome {
  width: min(100%, 440px);
  margin: clamp(72px, 29vh, 280px) auto 0;
}
#welcome h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 590;
  letter-spacing: -.055em;
  line-height: 1.08;
  padding: 0;
}
#welcome form { margin-top: 20px; }
.wallet-switch {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start;
  min-height: 42px; background: transparent; border: 0; color: var(--text);
  padding: 0 6px 0 0; font-weight: 560;
}
.wallet-switch svg { width: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
dialog {
  position: fixed; inset: 0; margin: auto; width: min(410px, calc(100% - 32px));
  max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 22px 25px;
  background: #1a1b20; color: var(--text); border: 1px solid #41424a;
  border-radius: 4px; box-shadow: 0 18px 75px #0009;
}
dialog::backdrop { background: rgb(5 6 8 / 72%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.15rem; font-weight: 580; letter-spacing: -.025em; }
