:root {
  font: 15px "Segoe UI", system-ui, sans-serif;
  color: #162d42;
  background: #ecf2f6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: min(100%, 540px); margin: auto; padding: 18px 20px;
  background: #ecf2f6;
}
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand b { display: grid; place-items: center; color: #f6dfaa; background: #153148; border-radius: 9px; width: 32px; height: 32px; }
header > span { color: #674b24; background: #f2e6d2; padding: 5px 8px; border-radius: 7px; white-space: nowrap; font-size: .79rem; }
main { max-width: 540px; padding: 4px 16px calc(103px + env(safe-area-inset-bottom)); margin: auto; }
section { background: white; padding: 20px; border: 1px solid #d6e1e9; border-radius: 18px; }
.wallet-picker { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.wallet-picker strong { overflow-wrap: anywhere; }
.balance { background: linear-gradient(130deg, #15364f, #234f68); color: #fff; padding: 24px 19px; border-radius: 13px; }
.balance p { color: #c6d9e4; margin-bottom: 9px; }
.balance h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.7rem, 6vw, 2.2rem); font-variant-numeric: tabular-nums; }
.balance small { color: #d5e4ed; font-size: .9rem; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 1.55rem; margin-bottom: 13px; }
h2 { font-size: 1.3rem; }
label { display: block; margin: 13px 0 6px; }
input, textarea, select { width: 100%; border: 1px solid #a5b7c7; border-radius: 9px; padding: 10px; color: inherit; font: inherit; background: #f8fafb; }
textarea { resize: vertical; }
input[type="file"] { font-size: .85rem; }
button { cursor: pointer; color: white; background: #193e5a; border: 0; border-radius: 9px; min-height: 42px; padding: 8px 12px; margin: 9px 3px 0 0; font: inherit; }
button:focus-visible { outline: 2px solid #126da6; outline-offset: 2px; }
button:disabled { cursor: default; opacity: .55; }
button.quiet { color: #24465c; background: #edf3f6; }
.wallet-picker button { margin: 0; min-height: 36px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 13px 0 8px; }
.quick-actions button { color: #173d57; background: #eef5f8; margin: 0; font-size: .82rem; padding: 8px 3px; }
.quick-actions span, nav span { display: block; font-size: 1.35rem; line-height: 1.15; }
.wallet-choices { display: flex; gap: 6px; }
#wallet-nav { display: flex; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 540px); padding: 7px 10px calc(10px + env(safe-area-inset-bottom)); gap: 4px; background: #fff; border-top: 1px solid #d6e1e9; box-shadow: 0 -4px 16px #21374b0d; }
#wallet-nav button { flex: 1; margin: 0; padding: 5px 2px; min-height: 50px; background: transparent; color: #526a7a; font-size: .78rem; }
#wallet-nav button[aria-current="page"] { color: #143c57; background: #e5f0f5; font-weight: 650; }
canvas { display: block; max-width: 100%; height: auto; margin: 6px auto 14px; }
#address, #hash { font: .84rem Consolas, monospace; }
#quote, #seed-words, .sensitive, #status { overflow-wrap: anywhere; line-height: 1.6; }
#quote, #status, .sensitive { margin-top: 14px; }
#status { color: #2a4e6b; }
.sensitive, #seed-words { padding: 10px; background: #f6eee1; border-radius: 8px; user-select: text; }
#history { list-style: none; margin: 12px 0 0; padding: 0; }
#history li { border-top: 1px solid #dce6ed; }
.history-summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) fit-content(38%) 14px; gap: 8px; align-items: center; padding: 13px 0; cursor: pointer; list-style: none; }
.history-summary::-webkit-details-marker { display: none; }
.history-summary:focus-visible { outline: 2px solid #126da6; outline-offset: 3px; border-radius: 6px; }
.history-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #24465c; background: #edf3f6; font-size: 1.2rem; }
.history-icon.received { color: #17634e; background: #e5f4ee; }
.history-copy { display: grid; min-width: 0; gap: 3px; }
.history-copy strong { white-space: nowrap; }
.history-copy span, .history-copy time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: #526a7a; }
.history-amount { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.history-amount.received { color: #17634e; }
.history-chevron { width: 14px; height: 14px; color: #526a7a; font-size: 1.2rem; line-height: 14px; text-align: center; }
.history-chevron::before { content: '›'; }
.history-entry[open] .history-chevron::before { content: '⌄'; }
.history-details { margin: 0 0 12px; padding: 12px; border-radius: 10px; background: #f3f7fa; }
.history-details dl { margin: 0; }
.history-details dt { color: #526a7a; font-size: .78rem; }
.history-details dd { margin: 3px 0 10px; overflow-wrap: anywhere; font: .82rem/1.45 Consolas, monospace; }
.history-details dd:last-child { margin-bottom: 0; }
.history-link { color: #145f89; text-underline-offset: 3px; }
#history-status { margin: 12px 0 0; }
#history-status:empty { display: none; }
.activity-local { margin-top: 16px; }
@media (max-width: 540px) {
  input, textarea, select { font-size: 16px; }
}
