:root {
  color-scheme: light;
  --paper: #f3efe6;
  --slip: #fffdf8;
  --bg: var(--paper);
  --card: var(--slip);
  --ink: #221e1a;
  --muted: #4e483f;
  --line: #cfc6b8;
  --rule: #221e1a;
  --side: var(--paper);
  --side-ink: var(--ink);
  --red: #9d1c1c;
  --accent: var(--red);
  --accent-ink: var(--paper);
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ok: #1f6b45;
  --ok-bg: #e4efe6;
  --bad: var(--red);
  --bad-bg: #f6e6e2;
  --wait: #8a5a1a;
  --wait-bg: #f3ead8;
  --info: var(--ink);
  --info-bg: #e7e0d4;
  --shadow: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.45;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

a { color: var(--red); }

a:hover { text-decoration-thickness: 2px; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.boot {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 6;
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 0.8rem;
  transform: translateY(-150%);
}

.skip:focus { transform: none; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(26rem, 100%);
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.15rem 1.15rem 1.35rem;
}

.brand-mark {
  display: block;
  width: max-content;
  margin: 0 0 0.85rem;
  color: inherit;
  font-weight: 600;
  font-style: italic;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.login-card h1,
.page-head h1 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.15;
}

.page-head h1:focus,
.page-head h1:focus-visible {
  outline: none;
}

.lead,
.page-head p { margin: 0.35rem 0 0; color: var(--muted); }

.login-card .lead { margin-bottom: 1.25rem; }

label { display: block; margin: 1.15rem 0; }

label span,
.k,
.card .label,
.facts dt,
.list-head {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label span,
.k {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background-color: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  padding: 0.55rem 0;
}

input:not([type="checkbox"]):focus,
input:not([type="checkbox"]):focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--red);
}

textarea {
  resize: vertical;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.field-hint {
  margin: -0.6rem 0 1.15rem;
  font-size: 0.85rem;
}

.transfer-list {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.transfer-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--line);
}

.transfer-address {
  overflow-wrap: anywhere;
  color: var(--muted);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6.2 8 10.2 12 6.2' fill='none' stroke='%23221e1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}

.field { margin: 1.15rem 0; }
.field > label { margin: 0; }

.exact-block { margin-top: 0.35rem; }

.exact {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.check input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin-top: 0.2rem;
  padding: 0;
  border: 0;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.exact .check {
  margin: 0;
  align-items: center;
  gap: 0.5rem;
}

.exact .check input { margin-top: 0; }

.check span {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

button.help-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  flex: 0 0 auto;
}

button.help-mark:hover,
button.help-mark[aria-expanded="true"] {
  border-color: var(--red);
  background: transparent;
  color: var(--red);
}

.help-tip {
  position: fixed;
  z-index: 20;
  margin: 0;
  width: min(22rem, calc(100vw - 1rem));
  padding: 0.6rem 0.75rem;
  background: var(--card);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  border: 1px solid var(--rule);
}

.quote-line {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
}

button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

button:hover:not(:disabled),
a.button:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

.login-card button[type="submit"] { width: 100%; margin-top: 0.85rem; }

.login-terms {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#login-email-locked {
  margin: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.login-links {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0.15rem 0 0.35rem;
}

.login-links:not(:has(button:not([hidden]))) { display: none; }

#login-resend,
#login-change-email {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-transform: uppercase;
}

#login-resend:hover,
#login-change-email:hover { background: transparent; color: var(--ink); }

button.secondary,
a.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

button.secondary:hover:not(:disabled),
a.button.secondary:hover {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

button.ghost {
  background: transparent;
  border: 0;
  color: var(--red);
  min-height: 0;
  padding: 0.35rem 0;
  font-weight: 400;
  justify-content: flex-start;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}

button.ghost:hover { background: transparent; color: var(--ink); }

.shell { display: flex; min-height: 100vh; }

.side {
  width: 240px;
  flex: 0 0 240px;
  background: var(--side);
  color: var(--side-ink);
  border-right: 1px solid var(--rule);
  padding: 1.25rem 1.15rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.brand {
  color: var(--ink);
  font-weight: 600;
  font-style: italic;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  padding: 0.15rem 0.15rem 0;
}

.nav { display: flex; flex-direction: column; gap: 0.2rem; }

.nav-label {
  margin: 0.85rem 0 0.1rem;
  padding: 0 0.15rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-label:first-child { margin-top: 0; }

.nav a.nav-gap { margin-top: 0.85rem; }

.nav a {
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
  min-height: 2.4rem;
  padding: 0.35rem 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a.active,
.nav a:hover { background: transparent; color: var(--red); }

.who {
  margin-top: auto;
  padding: 0.35rem 0.15rem 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#who { word-break: break-all; }

#side-balance {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.card .balance-amounts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.4rem 0 1.5rem;
}

.card .balance-amounts .balance-num { margin: 0; }

.main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
}

.content { max-width: 960px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.85rem;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 28rem);
  gap: 1rem;
  margin-bottom: 1rem;
}

.earn-panel > h2 { margin-bottom: 0; }

.earn-panel > .earn-lead { margin: 0.35rem 0 0.9rem; font-size: 0.92rem; }

.earn-card .label { color: var(--muted); }

.earn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

a.earn-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}

a.earn-card:hover { border-color: var(--ink); color: inherit; text-decoration: none; }

.earn-panel .earn-card p { margin: 0; }

.earn-panel .earn-num {
  margin-top: 0.35rem;
  font-size: 1.7rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.earn-num span {
  margin-left: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.earn-panel .earn-note {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.earn-go {
  margin-top: 0.75rem;
  color: var(--red);
  font-weight: 500;
}

a.earn-card:hover .earn-go { color: var(--ink); }

.card,
.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
}

.card { padding: 1.15rem 1.25rem; }

.balance-card { border-top: 3px solid var(--red); }

.card .label { color: var(--muted); }
.card p { margin: 0.35rem 0 0; }

.card .balance-num {
  margin: 0.4rem 0 0;
  font-size: 2.6rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.balance-num span {
  margin-left: 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.balance-card .saved-line {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.balance-card .saved-line.down { color: var(--muted); }

.balance-card .saved-note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card .key-value {
  margin: 0.55rem 0 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
}

.panel { padding: 1.15rem 1.25rem; }
.panel h2 { margin: 1rem 0 0.45rem; }
.panel > h2:first-child { margin-top: 0; }
.panel p { margin: 1rem 0 0; }
.panel form > button { margin-top: 1.25rem; }
.panel > p:first-child { margin-top: 0; }

.panel + .panel,
.stack > * + *,
.stack:not(:empty) { margin-top: 1rem; }

#supply-error:not(:empty) { margin-top: 1rem; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.panel-head h2 { margin: 0; font-size: 1.35rem; }
.panel h2 { font-size: 1.35rem; }

a.text-link { color: var(--red); font-weight: 500; }
a.text-link:hover { color: var(--ink); }

.back { display: inline-block; margin-bottom: 0.75rem; }

.list-head,
.order-row {
  display: grid;
  grid-template-columns: minmax(23.5rem, 1fr) 7.5rem 6.5rem 7.25rem 8rem;
  gap: 0.75rem;
  align-items: center;
}

.list-head {
  color: var(--muted);
  font-weight: 400;
  padding: 0.35rem 0.25rem 0.45rem;
  border-bottom: 1px solid var(--rule);
}

.order-row {
  color: inherit;
  text-decoration: none;
  min-height: 52px;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}

.order-row:hover { background: #efe8dc; color: inherit; }

.order-row > :first-child { min-width: 0; }
.order-id { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.order-when,
.open-when {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.order-when { white-space: nowrap; }
.open-main { display: contents; }
.open-topup .mono {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  word-break: normal;
}
.open-when {
  grid-column: 1 / -1;
  grid-row: 2;
  white-space: normal;
}
.order-row .mono { white-space: nowrap; word-break: normal; }

/* Rentals: a full TRON address needs a wide column, the date does not. */
.rental-row { grid-template-columns: 11.5rem 5.5rem 5.5rem 6.5rem minmax(0, 1fr) 8rem; }
.rental-row > .cell { min-width: 0; overflow-wrap: anywhere; }

/* Witness table: own column widths, so long names do not overlap. */
.witness-row { grid-template-columns: minmax(0, 1fr) 9rem 5.5rem 7rem; }
.witness-row > .cell { min-width: 0; overflow-wrap: anywhere; }
.vote-row { grid-template-columns: minmax(0, 1fr) 8rem 9rem; }
.vote-row > .cell { min-width: 0; overflow-wrap: anywhere; }

.tx-head,
.tx-row {
  display: grid;
  grid-template-columns: 13rem 6.25rem 6.5rem minmax(0, 1fr) 10.5rem 9.5rem;
  gap: 0.75rem;
  align-items: center;
}

.tx-order { min-width: 0; }
.tx-order .mono { white-space: normal; overflow-wrap: anywhere; }
.tx-note { overflow-wrap: anywhere; }

.tx-row {
  min-height: 52px;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}

.tx-kind { display: flex; flex-direction: column; gap: 0.15rem; }
.tx-detail { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; color: var(--muted); font-size: 0.85rem; }
.tx-detail .mono { word-break: break-all; }

.tx-filters {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.25rem 0.6rem;
  background: var(--info-bg);
}

.tx-filter-grid {
  display: grid;
  grid-template-columns: 17rem 6.25rem 6.5rem minmax(0, 1fr) 10.5rem;
  gap: 0.4rem 0.75rem;
  align-items: end;
}

.tx-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.5rem;
}

.rental-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tx-filters label { margin: 0; }

.tx-filters label span {
  margin-bottom: 0.12rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.tx-filters input,
.tx-filters select {
  min-height: 1.85rem;
  padding: 0.15rem 0;
  border-bottom-color: var(--line);
  background-color: transparent;
  font-size: 0.8rem;
}

.tx-filters select {
  padding-right: 1.2rem;
  background-position: right 0 center;
  background-size: 0.75rem;
}

.tx-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  min-height: 44px;
}

.tx-filters .tx-tools {
  min-height: 0;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.tx-filters .tx-tools label { width: 11rem; }

.tx-filters button {
  min-height: 1.85rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.66rem;
}

.tx-count { margin: 0 0 0.75rem; }

.tx-pages {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tx-pages span { color: var(--muted); }
.amount-plus { color: var(--ok); font-variant-numeric: tabular-nums; }
.amount-minus { color: var(--bad); font-variant-numeric: tabular-nums; }

.order-row .k,
.tx-row .k {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pill {
  display: inline-block;
  border-radius: 0;
  padding: 0.12rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--info-bg);
  color: var(--info);
}

.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }

.banner {
  background: var(--info-bg);
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  margin: 0 0 1rem;
}

.banner.bad { background: var(--bad-bg); color: var(--bad); }

/* Inside the panel the banner does not stick to the text above or the buttons below. */
.panel .banner { margin: 1rem 0; }
.panel > .banner:last-child,
.panel :last-child > .banner:last-child { margin-bottom: 0; }
.panel > .banner:first-child,
.panel > :first-child > .banner:first-child { margin-top: 0; }

.login-card .banner { margin-top: 0.25rem; }

.empty { margin: 0.75rem 0 0; color: var(--muted); }

.narrow { max-width: 32rem; }

#topup-form input { width: 9rem; }

#withdraw-form input[name="amount"] { width: 9rem; }
#withdraw-form input[name="address"] { width: 100%; }
#withdraw-form #withdraw-error .banner { margin: 1.15rem 0 0; }
#withdraw-form #withdraw-error:not(:empty) ~ button { margin-top: 0.5rem; }
#withdraw-form span.withdraw-amount-head,
#exchange-form span.amount-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
#withdraw-form span.withdraw-amount-head > span,
#exchange-form span.amount-head > span { margin-bottom: 0; }
#withdraw-max,
#exchange-max { margin-bottom: 0; }
.calc-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}
#withdraw-form .calc-line input[name="amount"],
#exchange-form .calc-line input,
#buy-form .calc-line input,
#bandwidth-form .calc-line input {
  width: 9rem;
  flex: 0 0 auto;
}
form span.calc-math,
form span.calc-fig {
  display: inline;
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}
form span.calc-math { color: var(--muted); }
form span.calc-fig { color: var(--wait); }
form span.calc-label {
  display: inline;
  margin: 0 0 0 0.28rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts { display: grid; gap: 0.9rem; margin: 0; }
#exchange-quote:not(:empty),
#withdraw-quote:not(:empty) { margin-top: 1.15rem; }
#withdraw-quote button { margin-top: 1.25rem; }
.facts div { display: grid; gap: 0.25rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts dd .text-link { display: inline-block; margin-top: 0.5rem; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.panel .pay-id {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel .pay-id .mono,
.panel .pay-id .pay-when { color: var(--ink); }

.pay-amount {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.copy-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #e7e0d4;
  padding: 0.75rem 0.85rem;
}

.copy-line button { flex: 0 0 auto; }

.supply-guide { max-width: 40rem; margin: 0.35rem 0 1.25rem; }
.supply-guide > p { margin: 0 0 0.75rem; }
.steps { margin: 0; padding-left: 1.25rem; }
.steps li + li { margin-top: 0.55rem; }
.supply-card .supply-k {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.supply-card h2 { margin: 0.2rem 0 0; word-break: break-all; }
.supply-card .supply-hint { margin: 0.85rem 0 0; }
.supply-card .actions { margin-top: 0.85rem; }
.supply-card .banner { margin: 0.85rem 0 0; }
.supply-rewards { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border, rgba(127, 127, 127, 0.25)); }
.supply-rewards h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin-top: 0.9rem; }
.stat { padding: 0.7rem 0.85rem; background: var(--info-bg); }
.stat-k { display: block; margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-v { display: block; margin-top: 0.25rem; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.85rem; }
.supply-sub { margin: 1.1rem 0 0.35rem; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.supply-rewards .supply-note { margin: 0.5rem 0 0; font-size: 0.9rem; }
.supply-witnesses { margin-top: 1.25rem; }
.supply-witnesses h2 { margin: 0 0 0.5rem; }
.supply-witnesses .list-head { margin-top: 1.25rem; }
.witness-wallet { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border, rgba(127, 127, 127, 0.25)); }
.witness-wallet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.witness-wallet-head .mono { min-width: 0; overflow-wrap: anywhere; }
.witness-wallet > .muted { margin: 0.6rem 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.actions-break { flex-basis: 100%; height: 0; }

.open-topup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: #e7e0d4;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.open-topup:hover { background: #ddd4c4; color: inherit; }
.open-topup .pill { grid-column: 2; grid-row: 1; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(28rem, calc(100% - 2rem));
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 0.95rem;
}

.muted { color: var(--muted); }

#pay-clock { font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 800px) {
  .shell { flex-direction: column; }

  .side {
    width: auto;
    flex-basis: auto;
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand who"
      "nav nav";
    gap: 0.35rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0.65rem 0.85rem 0.7rem;
  }

  .brand { grid-area: brand; padding-left: 0; font-size: 1.45rem; }
  .nav { grid-area: nav; flex-direction: row; flex-wrap: wrap; gap: 0.1rem 0.15rem; align-items: center; }
  .nav-label { margin: 0 0.2rem 0 0.35rem; }
  .nav-label:first-child { margin-left: 0; }
  .nav a { white-space: nowrap; padding: 0.28rem 0.4rem; gap: 0.35rem; font-size: 0.68rem; }
  .nav a.nav-gap { margin: 0 0 0 0.85rem; }
  .who {
    grid-area: who;
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0;
  }
  #side-balance { flex: 0 0 auto; font-size: 0.85rem; }
  #who {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
  }
  #logout { flex: 0 0 auto; }
  .main { padding: 1rem 1rem 2.5rem; }
  h1 { scroll-margin-top: 8.5rem; }
  .home-grid,
  .earn-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 1240px) {
  .list-head:not(.tx-head) { display: none; }
  .tx-head { display: none; }
  .tx-filter-grid { grid-template-columns: 1fr 1fr; }
  .order-row,
  .tx-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    padding: 0.85rem 0.1rem;
  }
  .order-row > :first-child,
  .tx-row > .tx-order { grid-column: 1 / -1; }
  .order-row .k,
  .tx-row .k {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 0.15rem;
    overflow: visible;
    clip: auto;
  }
}

@media (max-width: 700px) {
  .list-head { display: none; }
  .order-row,
  .tx-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    padding: 0.85rem 0.1rem;
  }
  .order-row > :first-child,
  .tx-row > .tx-order { grid-column: 1 / -1; }
  .order-row .k,
  .tx-row .k {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 0.15rem;
    overflow: visible;
    clip: auto;
  }
  .order-row .mono,
  .tx-order .mono { white-space: normal; word-break: break-all; }
  .balance-num { font-size: 2.2rem; }
  .copy-line { align-items: flex-start; flex-direction: column; }
}

#signout-dialog,
#exchange-dialog,
#withdraw-dialog,
#confirm-dialog,
#disable-key-dialog {
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  padding: 1.15rem 1.25rem 1.25rem;
  max-width: min(26rem, calc(100vw - 2rem));
}

#signout-dialog::backdrop,
#exchange-dialog::backdrop,
#withdraw-dialog::backdrop,
#confirm-dialog::backdrop,
#disable-key-dialog::backdrop { background: rgba(34, 30, 26, 0.4); }
#signout-dialog h2,
#exchange-dialog h2,
#withdraw-dialog h2,
#confirm-dialog h2,
#disable-key-dialog h2 { margin: 0; font-size: 1.5rem; }
#signout-dialog p,
#withdraw-dialog p,
#confirm-dialog p,
#disable-key-dialog p { margin: 0.65rem 0 0; }
#withdraw-dialog p,
#confirm-dialog p { overflow-wrap: anywhere; }
#exchange-dialog .facts { margin-top: 0.9rem; }
#signout-dialog .actions,
#exchange-dialog .actions,
#withdraw-dialog .actions,
#confirm-dialog .actions,
#disable-key-dialog .actions { margin-top: 1.15rem; }

.ip-add {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.ip-add input { flex: 1 1 auto; min-width: 0; }
.ip-add button { flex: 0 0 auto; margin-top: 0; }

#api-key-list { margin-top: 1rem; }

.ip-row,
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}

.ip-row:last-child,
.key-row:last-child { border-bottom: 1px solid var(--rule); }
.ip-row button,
.key-row button { flex: 0 0 auto; }
.key-row { flex-wrap: wrap; }
.key-row > span { min-width: 0; }
.key-tools {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}
button.key-access {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
button.key-access:hover:not(:disabled) {
  background: transparent;
  border-color: transparent;
  color: var(--red);
  text-decoration-thickness: 2px;
}
#withdraw-address-list .ip-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#withdraw-address-list .muted { display: block; }
.row-actions { display: flex; flex: 0 0 auto; gap: 0.5rem; }
.key-row .muted { display: block; }
.affiliate-link { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.affiliate-link code { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .ip-add { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
