:root {
  --bg: #F6F7F3; --surface: #FFFFFF; --surface-2: #F1F3EE; --line: #E0E4DA;
  --text: #12161D; --text-2: #39404B; --muted: #646D79;
  --accent: #00A88E; --accent-text: #00775F; --on-accent: #FFFFFF; --accent-line: rgba(0,168,142,.35);
  --ok: #00775F; --bad: #C62828; --warn: #9A6400;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0E13; --surface: #141920; --surface-2: #1A2029; --line: #252C38;
    --text: #EEF0F3; --text-2: #BAC1CB; --muted: #8C95A3;
    --accent: #1CC29F; --accent-text: #34D8B0; --on-accent: #04201A; --accent-line: rgba(0,179,150,.4);
    --ok: #34D8B0; --bad: #FF6B6B; --warn: #F5B841;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
html.ext body { width: 375px; min-height: 600px; }
.app { max-width: 480px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; font-family: var(--display); }
h1 { font-size: 26px; } h2 { font-size: 22px; } h3 { font-size: 15px; }
p { color: var(--text-2); margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.small { font-size: 13px; }
a { color: var(--accent-text); text-decoration: none; }

.top { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 1.5px; color: var(--accent-text); margin-right: auto; }
.net { font-size: 12px; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 999px; padding: 1px 9px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text-2); border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }

.view { padding-top: 8px; animation: in .15s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.hero { text-align: center; padding: 28px 0 18px; }
.hero img { border-radius: 16px; margin-bottom: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 15px var(--font); cursor: pointer; text-align: center; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { display: flex; width: 100%; margin-bottom: 10px; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; flex: none; }
.btn.file input { display: none; }
.link { background: none; border: 0; color: var(--accent-text); font: 500 14px var(--font); cursor: pointer; padding: 10px 0; display: block; }
.link.center { text-align: center; margin: 8px auto 0; }
.back { background: none; border: 0; color: var(--text-2); font: 500 15px var(--font); padding: 4px 0 12px; cursor: pointer; }
.row { display: flex; gap: 10px; } .row .btn { flex: 1; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 14px; }
input, select { width: 100%; min-height: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: 16px var(--font); padding: 0 12px; }
input:focus, select:focus { outline: none; border-color: var(--accent-line); }
.input-row { display: flex; gap: 8px; } .input-row input { min-width: 0; }
.hint { font-size: 13px; color: var(--muted); }
.fine { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); margin: 6px 0 14px; }
.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.steps { color: var(--text-2); padding-left: 20px; margin: 0 0 18px; } .steps li { margin-bottom: 6px; }
.msg { font-size: 14px; min-height: 20px; margin-top: 8px; color: var(--text-2); word-break: break-word; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.notice .btn { margin: 10px 0 0; }
.progress { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .1s; }

.balance-card { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 20px; text-align: center; }
.balance-card .label { font-size: 13px; color: var(--muted); }
.balance { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0 10px; word-break: break-all; }
.balance small { font-size: 16px; color: var(--muted); font-weight: 600; }
.addr-chip { font: 13px var(--mono); color: var(--text-2); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.addr-chip:hover { border-color: var(--muted); }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; min-height: 18px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.act { display: grid; justify-items: center; gap: 6px; background: none; border: 0; color: var(--text); font: 600 13px var(--font); cursor: pointer; padding: 6px 0; }
.act svg { width: 46px; height: 46px; padding: 12px; border: 1px solid var(--accent-line); border-radius: 50%; color: var(--accent-text); }
.act:hover svg { border-color: var(--accent); }
.act:disabled { opacity: .5; }
.list-title { color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
.activity { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.activity li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.activity li.empty { color: var(--muted); font-size: 14px; justify-content: center; }
.activity .what { flex: 1; min-width: 0; }
.activity .what b { display: block; font-size: 14.5px; }
.activity .what span { display: block; font: 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.activity .amt.in { color: var(--ok); }
.activity a { color: inherit; display: contents; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px; margin: 0 0 14px; font-size: 14.5px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; word-break: break-all; text-align: right; }
.qr { background: #fff; border-radius: 16px; padding: 14px; width: min(260px, 100%); margin: 6px auto 14px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.addr-full { text-align: center; word-break: break-all; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.menu { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.menu > * { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); font: 500 15px var(--font); text-align: left; cursor: pointer; }
.menu > *:first-child { border-top: 0; }
.menu span { color: var(--muted); }
.menu select { width: auto; min-height: 36px; }
.menu .danger { color: var(--bad); }
.scanner { margin-top: 12px; } .scanner video { width: 100%; border-radius: 14px; background: #000; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }

.brand .wordmark { height: 19px; width: auto; display: block; }
.brand .wm-on-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .wm-on-dark { display: block; } .brand .wm-on-light { display: none; } }
