:root {
  --bg: #f4f7f9; --panel: #ffffff; --line: #d6e0e7; --fg: #0c161d; --muted: #566874;
  --ice: #0a6797; --ice-bg: #e3f2fa; --ice-line: #b7dcef;
  --clean: #16683b; --clean-bg: #e2f4e9; --clean-line: #b9e2c8;
  --focus: #0a6797;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1015; --panel: #0f1920; --line: #1e2c36; --fg: #e6eff4; --muted: #8798a5;
    --ice: #84d8ff; --ice-bg: #0f2a38; --ice-line: #1d4a61;
    --clean: #80e0a9; --clean-bg: #102a1d; --clean-line: #1f4a33;
    --focus: #84d8ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--mono); overflow-x: hidden; }
a { color: var(--ice); text-underline-offset: 2px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { max-width: 860px; margin: 0 auto; padding: 0 12px 40px; }

/* header and footer */
.top { max-width: 860px; margin: 0 auto; padding: 14px 12px 8px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 800; font-size: 16px; }
.foot { max-width: 860px; margin: 0 auto; padding: 18px 12px 36px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; border-top: 1px solid var(--line); }

/* the boxes */
.ask { margin: 6px 0 18px; }
.ask h1 { font-size: 20px; line-height: 1.25; margin: 10px 0 12px; letter-spacing: -0.01em; }
.row { display: flex; gap: 8px; margin: 0 0 8px; }
.row input { flex: 1; min-width: 0; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 15px; }
.row.small input { padding: 8px 10px; font-size: 13px; }
.row button, .btn { padding: 10px 16px; border: 1px solid var(--ice); background: var(--ice); color: var(--bg); border-radius: 10px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.row.small button { padding: 7px 12px; background: transparent; color: var(--ice); }
.btn.ghost { background: transparent; color: var(--ice); }
.hint { color: var(--muted); margin: 2px 0 0; font-size: 12px; }
.again { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 0; }
.chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 6px; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--ice-line); background: var(--ice-bg); color: var(--ice); font-size: 12px; line-height: 1.6; max-width: 100%; }
.chip.ok { border-color: var(--clean-line); background: var(--clean-bg); color: var(--clean); }
.chip .h { color: var(--muted); border: 0; background: none; padding: 0; cursor: pointer; font-size: 12px; }
.chip .h:hover { text-decoration: underline; }
.chip.acct { border-style: dashed; }

/* token rows */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tok { display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.tok .l1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tok .sym { font-weight: 800; color: var(--fg); text-decoration: none; font-size: 15px; }
.tok .sym:hover { text-decoration: underline; }
.tok .amt { color: var(--fg); }
.tok .nm, .tok .iss { color: var(--muted); overflow-wrap: anywhere; }
.tok .x { color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.ico { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--line); align-items: center; justify-content: center; flex: none; }
.ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ico.mono { color: var(--muted); font-weight: 800; font-size: 13px; }

/* the board */
.board { margin-top: 26px; }
.board h2, .res h2 { font-size: 16px; margin: 0 0 2px; }
.board .sub, .res .sub { color: var(--muted); margin: 0 0 10px; font-size: 12px; }

/* a wallet's result */
.res { margin: 8px 0 8px; }
.sum { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.sum .head { font-size: 22px; line-height: 1.2; font-weight: 800; margin: 0 0 6px; }
.sum .head b { color: var(--ice); }
.sum .parts { margin: 0 0 12px; font-size: 15px; }
.sum .parts span + span::before { content: " · "; color: var(--muted); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.share label { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
.meta { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.grant { list-style: none; margin: 0 0 18px; padding: 0; }
.grant li { padding: 7px 0 7px 22px; border-bottom: 1px solid var(--line); position: relative; overflow-wrap: anywhere; }
.grant li::before, .lines li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--ice); }
.grant li.ok::before, .lines li.off::before { background: none; border: solid var(--clean); border-width: 0 2px 2px 0; width: 5px; height: 9px; border-radius: 0; transform: rotate(45deg); top: 9px; left: 6px; }
details { border-bottom: 1px solid var(--line); }
details > summary { cursor: pointer; padding: 10px 2px; color: var(--muted); }
details[open] > summary { color: var(--fg); }
.err { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); }
.loading { color: var(--muted); padding: 12px 0; }

/* result pages */
.tcard, .xcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 10px; }
.thead { display: flex; gap: 12px; align-items: center; }
.tcard h1 { font-size: 26px; margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
.tcard h1 .nm { font-size: 14px; color: var(--muted); font-weight: 400; }
.verdict { margin: 4px 0 0; font-size: 20px; font-weight: 800; }
.tcard.has .verdict { color: var(--ice); }
.tcard.clean .verdict { color: var(--clean); }
.tcard .sub { color: var(--muted); margin: 12px 0 6px; }
.xcard h1 { font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
.xcard h2 { font-size: 15px; margin: 16px 0 6px; }
.lines { list-style: none; padding: 0; margin: 6px 0 0; }
.lines li { position: relative; padding: 7px 0 7px 22px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.lines li.off { color: var(--muted); }
.lines.more li { color: var(--fg); }
.names { list-style: none; padding: 0; margin: 0; }
.names li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.who { white-space: normal; }
.addr { border: 0; background: none; padding: 0; color: var(--fg); text-decoration: underline dotted; cursor: pointer; font-size: inherit; }
.kind { color: var(--muted); }
.note { color: var(--muted); }
.other { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 12px; }

/* the token section */
#token { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
#token h2 { font-size: 15px; margin: 0 0 8px; }
#token h3 { margin: 16px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
#token .addr-row { display: flex; gap: 8px; align-items: flex-start; }
#token .addr-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
#token .addr-row button { padding: 2px 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; }
#token .links a { margin-right: 14px; }

/* the how page */
.prose { max-width: 720px; }
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 16px; margin-top: 28px; }
.prose p, .prose li { line-height: 1.55; }
.prose table { border-collapse: collapse; width: 100%; font-size: 12px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); text-align: left; padding: 6px 8px 6px 0; vertical-align: top; }

@media (min-width: 720px) {
  body { font-size: 15px; }
  main, .top, .foot { padding-left: 20px; padding-right: 20px; }
  .ask h1 { font-size: 26px; }
  .sum .head { font-size: 28px; }
  .tok { grid-template-columns: 32px 1fr; padding: 11px 4px; }
  .ico { width: 32px; height: 32px; }
}
