:root {
  color-scheme: dark;
  --bg: #090c11;
  --panel: rgba(17, 22, 30, 0.88);
  --panel-solid: #11161e;
  --card: #171d27;
  --card-hover: #1d2531;
  --line: #283242;
  --line-soft: rgba(112, 129, 153, 0.17);
  --text: #eef2f7;
  --muted: #8b98aa;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --blue: #58a6ff;
  --green: #42c977;
  --red: #ff625e;
  --purple: #bc8cff;
  --radius: 18px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(35, 73, 130, 0.18), transparent 32rem),
    linear-gradient(180deg, #090c11 0%, #0b0f15 52%, #080b0f 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .09;
  pointer-events: none;
  z-index: -1;
}
.ambient-one { top: 8rem; left: -16rem; background: var(--blue); }
.ambient-two { right: -18rem; bottom: 5rem; background: var(--accent); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(117, 135, 159, .13);
  background: rgba(9, 12, 17, .78);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  letter-spacing: .05em;
}
.brand-mark, .dialog-mark {
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 11px;
  color: #090c11;
  background: linear-gradient(145deg, var(--accent-light), #d97706);
  box-shadow: 0 0 30px rgba(245, 158, 11, .18);
  font-weight: 900;
}
.brand strong { display: block; font-size: .82rem; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .58rem; letter-spacing: .16em; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.node-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(19, 25, 34, .8);
  font: 600 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(139, 152, 170, .08); }
.node-status.online { color: #a5f3c2; border-color: rgba(66, 201, 119, .32); }
.node-status.online .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(66, 201, 119, .1), 0 0 14px var(--green); }
.node-status.offline { color: #ffaaa7; border-color: rgba(255, 98, 94, .32); }
.node-status.offline .status-dot { background: var(--red); }

.language-control select {
  min-height: 34px;
  max-width: 144px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #121822;
}

.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  min-height: 410px;
  padding: 64px 24px 48px;
}
.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font: 700 .68rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .19em;
}
.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: .91;
  letter-spacing: -.07em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1::first-line { color: var(--text); }
.hero-lede { max-width: 620px; margin: 24px 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.65; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.trust-row span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: #a9b4c3; font: 650 .59rem/1 ui-monospace, monospace; letter-spacing: .1em; }

.atom-stage { position: relative; width: 310px; height: 310px; margin: auto; transform-style: preserve-3d; }
.atom-glow { position: absolute; inset: 25%; border-radius: 50%; background: rgba(37, 99, 235, .28); filter: blur(45px); }
.atom-core {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  border: 1px solid #5c8ef8;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7db1ff, #2455b5 45%, #10264f 72%);
  box-shadow: 0 0 34px rgba(88, 166, 255, .5), inset 0 0 15px rgba(255, 255, 255, .18);
  z-index: 4;
}
.atom-core span { color: white; font: 800 .78rem/1 ui-monospace, monospace; }
.orbit { position: absolute; inset: 50% auto auto 50%; width: 275px; height: 94px; margin: -47px 0 0 -137.5px; border: 1px solid rgba(88, 166, 255, .26); border-radius: 50%; }
.orbit i { position: absolute; top: 50%; left: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 13px var(--blue); }
.orbit-1 { transform: rotate(0deg); animation: pulse-orbit 7s ease-in-out infinite; }
.orbit-2 { transform: rotate(30deg); }
.orbit-3 { transform: rotate(60deg); }
.orbit-4 { transform: rotate(90deg); }
.orbit-5 { transform: rotate(120deg); }
.orbit-6 { transform: rotate(150deg); }
.orbit-1 i { animation: electron 4.1s linear infinite; }
.orbit-2 i { animation: electron 5.2s linear infinite -.8s; }
.orbit-3 i { animation: electron 3.7s linear infinite -1.5s; }
.orbit-4 i { animation: electron 5.8s linear infinite -2.2s; }
.orbit-5 i { animation: electron 4.5s linear infinite -3s; }
.orbit-6 i { animation: electron 3.3s linear infinite -1.1s; }
@keyframes electron { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.orbit i { offset-path: ellipse(137px 46px at 142px 46px); }
@keyframes pulse-orbit { 50% { opacity: .62; } }

.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.query-panel { padding: clamp(20px, 4vw, 34px); }
.panel-heading, .results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.panel-heading h2, .results-heading h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.035em; }
.counter { color: var(--muted); font: 600 .72rem/1 ui-monospace, monospace; }
.address-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 22px; }
.address-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--text);
  background: #0d1219;
  font: .88rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: border-color .2s, box-shadow .2s;
}
.address-field input:focus { border-color: rgba(245, 158, 11, .68); box-shadow: 0 0 0 4px rgba(245, 158, 11, .08); }
.field-help { margin: 8px 2px 0; color: #697789; font: .67rem/1 ui-monospace, monospace; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: transform .16s, background .16s, border-color .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 18px; color: #130d02; background: linear-gradient(135deg, var(--accent-light), var(--accent)); box-shadow: 0 10px 26px rgba(245, 158, 11, .13); }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #ffd45b, #f4a914); }
.button-secondary { color: var(--text); border-color: var(--line); background: var(--card); }
.button-secondary:hover { background: var(--card-hover); border-color: #3a485d; }
.button-danger { color: #ff9995; border-color: rgba(255, 98, 94, .23); background: transparent; }
.button-danger:hover { background: rgba(255, 98, 94, .07); }

.address-list { display: grid; gap: 7px; margin-top: 18px; }
.address-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: .82rem; }
.address-chip { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 48px; padding: 6px 8px; border: 1px solid rgba(104, 122, 147, .17); border-radius: 10px; background: rgba(18, 24, 33, .7); }
.address-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--accent); background: rgba(245, 158, 11, .08); font: 700 .68rem/1 ui-monospace, monospace; }
.address-chip code { overflow: hidden; color: #cbd5e1; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.remove-address { width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.remove-address:hover { color: var(--red); background: rgba(255, 98, 94, .08); }
.query-actions { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 10px; margin-top: 20px; }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px; border: 1px solid rgba(88, 166, 255, .13); border-radius: 10px; color: #8594a8; background: rgba(35, 72, 124, .06); }
.privacy-note span { color: var(--blue); }
.privacy-note p { margin: 0; font-size: .74rem; line-height: 1.5; }

.results-section { padding: 68px 0 90px; }
.results-heading { margin: 0 4px 20px; }
.query-meta { color: var(--muted); font: .68rem/1.4 ui-monospace, monospace; text-align: right; }
.empty-state, .loading-state { display: grid; place-items: center; min-height: 300px; padding: 40px; text-align: center; }
.empty-state h3 { margin: 22px 0 5px; }
.empty-state p { margin: 0; color: var(--muted); }
.mini-atom { position: relative; width: 84px; height: 84px; border: 1px solid rgba(88, 166, 255, .3); border-radius: 50%; transform: rotate(35deg); }
.mini-atom::before { content: ""; position: absolute; inset: 21px -16px; border: 1px solid rgba(88, 166, 255, .3); border-radius: 50%; transform: rotate(90deg); }
.mini-atom span { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--blue); box-shadow: 0 0 25px rgba(88, 166, 255, .7); }
.loading-state { gap: 12px; color: var(--muted); }
.loader { width: 44px; height: 44px; border: 2px solid rgba(245, 158, 11, .13); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { display: flex; align-items: center; gap: 16px; padding: 22px; border-color: rgba(255, 98, 94, .3); }
.error-state p { margin: 5px 0 0; color: #ffaaa7; }
.error-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; color: white; background: rgba(255, 98, 94, .18); font-weight: 900; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-card { padding: 22px; border: 1px solid var(--line-soft); border-radius: 14px; background: linear-gradient(145deg, rgba(24, 31, 42, .92), rgba(15, 20, 28, .92)); }
.summary-card strong { display: block; color: var(--accent); font-size: clamp(1.7rem, 4vw, 2.35rem); letter-spacing: -.045em; }
.summary-card span { display: block; margin-top: 5px; color: var(--muted); font: 700 .62rem/1.3 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.result-block { margin-top: 38px; }
.block-title { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 11px; }
.block-title h3 { margin: 0; font-size: .74rem; letter-spacing: .14em; }
.block-title span { color: var(--muted); font: .68rem/1 ui-monospace, monospace; }
.block-title.realms h3 { color: var(--accent); }
.block-title.tokens h3 { color: var(--blue); }
.block-title.bitcoin h3 { color: var(--green); }

.realms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.realm-card { padding: 18px; border: 1px solid rgba(245, 158, 11, .2); border-radius: 13px; background: linear-gradient(145deg, rgba(65, 40, 12, .55), rgba(24, 22, 19, .8)); }
.realm-card strong { color: var(--accent-light); font-size: 1.2rem; }
.realm-card .realm-number { float: right; color: var(--muted); font: .72rem ui-monospace, monospace; }
.realm-card code { display: block; overflow: hidden; margin-top: 10px; color: var(--muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }

.data-table { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(15, 20, 28, .83); }
.table-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(110px, 1fr) 80px 90px; align-items: center; min-height: 46px; padding: 0 17px; border-top: 1px solid rgba(113, 129, 151, .1); }
.table-row:first-child { border-top: 0; }
.table-head { min-height: 38px; color: var(--muted); background: rgba(35, 44, 57, .55); font: 700 .61rem/1 ui-monospace, monospace; letter-spacing: .08em; }
.table-row > :nth-child(2), .table-row > :nth-child(3) { text-align: right; }
.token-name { color: var(--accent-light); font-weight: 800; }
.token-balance { font: .78rem ui-monospace, monospace; }
.token-type { justify-self: end; padding: 4px 7px; border-radius: 5px; color: var(--blue); background: rgba(88, 166, 255, .08); font: 700 .58rem/1 ui-monospace, monospace; }

.bitcoin-card { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 24px; border: 1px solid rgba(66, 201, 119, .2); border-radius: 14px; background: linear-gradient(145deg, rgba(11, 51, 30, .58), rgba(13, 27, 20, .8)); }
.bitcoin-card strong { color: #74e6a0; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -.04em; }
.bitcoin-card span { color: var(--muted); font: .78rem ui-monospace, monospace; }

.wallet-stack { display: grid; gap: 10px; }
.wallet-card { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(15, 20, 28, .86); }
.wallet-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 12px; min-height: 58px; padding: 0 17px; list-style: none; cursor: pointer; background: rgba(26, 34, 45, .75); }
.wallet-card > summary::-webkit-details-marker { display: none; }
.wallet-card > summary code { overflow: hidden; color: #d2dae5; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.wallet-counts { color: var(--muted); font: .63rem/1 ui-monospace, monospace; }
.chevron { color: var(--muted); transition: transform .18s; }
.wallet-card[open] .chevron { transform: rotate(90deg); }
.utxo-list { padding: 7px 14px 13px; }
.utxo-row { display: grid; grid-template-columns: minmax(140px, 1fr) 100px minmax(130px, 1.2fr); gap: 10px; align-items: center; min-height: 41px; border-top: 1px solid rgba(113, 129, 151, .09); font-size: .72rem; }
.utxo-id { overflow: hidden; color: var(--muted); font-family: ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.utxo-id b { margin-right: 6px; }
.utxo-id .REALM { color: var(--accent); }
.utxo-id .NFT { color: var(--red); }
.utxo-id .FT { color: var(--blue); }
.utxo-id .BITCOIN { color: var(--green); }
.utxo-sats { color: #b5c0cf; text-align: right; font-family: ui-monospace, monospace; }
.utxo-content { overflow: hidden; color: #d5dde8; text-overflow: ellipsis; white-space: nowrap; }
.report-error { margin-top: 8px; padding: 12px 14px; border: 1px solid rgba(255, 98, 94, .19); border-radius: 10px; color: #ffaaa7; background: rgba(255, 98, 94, .05); font-size: .75rem; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; min-height: 80px; padding: 16px clamp(18px, 5vw, 72px); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .69rem; }
.site-footer strong { color: #b7c1cf; }
.footer-brand { white-space: nowrap; }
.footer-donation { display: grid; grid-template-columns: auto minmax(300px, 1fr) auto; align-items: center; gap: 8px; min-width: min(100%, 650px); padding: 6px 7px 6px 10px; border: 1px solid rgba(112, 129, 153, .14); border-radius: 9px; background: rgba(13, 18, 25, .72); }
.footer-donation-title { color: #b7c1cf; font-weight: 700; white-space: nowrap; }
.footer-donation code { outline: 0; color: #aeb9c8; font: .64rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; user-select: all; }
.footer-donation code:focus { color: #f7d488; }
.footer-copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 9px; border: 1px solid rgba(245, 158, 11, .2); border-radius: 7px; color: #d7b66d; background: rgba(245, 158, 11, .045); font: 700 .63rem/1 ui-sans-serif, system-ui, sans-serif; white-space: nowrap; }
.footer-copy-button:hover { color: var(--accent-light); border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .08); }
.footer-copy-button.copied { color: #91e9b2; border-color: rgba(66, 201, 119, .35); background: rgba(66, 201, 119, .08); }

.language-dialog { width: min(540px, calc(100% - 28px)); padding: 30px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: #0f141c; box-shadow: 0 40px 120px rgba(0, 0, 0, .7); text-align: center; }
.language-dialog::backdrop { background: rgba(4, 6, 9, .82); backdrop-filter: blur(10px); }
.language-dialog .dialog-mark { margin: 0 auto 14px; }
.language-dialog h2 { margin: 0; }
.language-dialog p { margin: 7px 0; color: var(--muted); }
.language-dialog small { color: #697789; }
.language-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 24px; }
.language-grid button { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--card); }
.language-grid button:hover { border-color: rgba(245, 158, 11, .4); background: var(--card-hover); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: 11px 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #161d27; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; font-size: .76rem; }
.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .node-status { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 60px 6px 38px; }
  .atom-stage { grid-row: 1; width: 230px; height: 230px; }
  .orbit { width: 210px; height: 72px; margin: -36px 0 0 -105px; }
  .orbit i { offset-path: ellipse(104px 35px at 109px 35px); }
  .hero-copy { text-align: center; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .trust-row { justify-content: center; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-header { min-height: 64px; }
  .brand small { display: none; }
  .brand-mark { width: 35px; border-radius: 9px; }
  .language-control select { max-width: 116px; }
  .page-shell { width: min(100% - 22px, 1180px); }
  .hero h1 { font-size: clamp(2.7rem, 16vw, 4.2rem); }
  .address-form, .query-actions { grid-template-columns: 1fr; }
  .query-actions .button-primary { grid-row: 1; }
  .summary-card { padding: 17px; }
  .table-row { grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) 58px; padding: 0 12px; }
  .table-row > :last-child { display: none; }
  .utxo-row { grid-template-columns: minmax(120px, 1fr) 80px; }
  .utxo-content { grid-column: 1 / -1; padding-bottom: 9px; }
  .bitcoin-card, .site-footer { align-items: flex-start; flex-direction: column; }
  .footer-donation { grid-template-columns: 1fr auto; width: 100%; min-width: 0; }
  .footer-donation-title { grid-column: 1 / -1; }
  .footer-donation code { font-size: .61rem; }
  .language-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
