:root {
  --purple: #7132f5;
  --purple-dark: #5741d8;
  --purple-deep: #4d18ba;
  --purple-soft: rgba(113, 50, 245, 0.09);
  --ink: #101114;
  --muted: #565a70;
  --silver: #6f7287;
  --line: #dedee5;
  --surface: #ffffff;
  --canvas: #f7f7fb;
  --green: #149e61;
  --green-dark: #026b3f;
  --green-soft: rgba(20, 158, 97, 0.13);
  --red: #d83a52;
  --red-soft: rgba(216, 58, 82, 0.1);
  --amber: #b25f00;
  --amber-soft: rgba(238, 156, 45, 0.13);
  --shadow: 0 16px 50px rgba(33, 20, 70, 0.07);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -20%, rgba(113, 50, 245, 0.13), transparent 34rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(104, 107, 130, 0.15);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--purple);
  box-shadow: 0 9px 24px rgba(113, 50, 245, 0.25);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.15; letter-spacing: -0.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #484b5e;
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
}

.network-badge span,
.connection-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
}

main {
  width: min(1240px, calc(100% - 48px));
  margin: 42px auto 72px;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 170px;
  padding: 30px 34px;
  border: 1px solid rgba(104, 107, 130, 0.17);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.status-card::after {
  content: "";
  width: 210px;
  height: 210px;
  position: absolute;
  right: -72px;
  top: -118px;
  border-radius: 50%;
  background: var(--purple-soft);
  pointer-events: none;
}

.status-primary { display: flex; align-items: center; gap: 20px; min-width: 0; }
.status-pulse {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--silver);
  box-shadow: 0 0 0 8px rgba(148, 151, 169, 0.12);
}

.status-card.is-active .status-pulse {
  background: var(--green);
  box-shadow: 0 0 0 8px var(--green-soft);
  animation: breathe 2s ease-in-out infinite;
}
.status-card.is-passive .status-pulse { background: var(--red); box-shadow: 0 0 0 8px var(--red-soft); }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 7px var(--green-soft); }
  50% { box-shadow: 0 0 0 12px rgba(20, 158, 97, 0.05); }
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.035em; }
h3 { margin-bottom: 0; font-size: 18px; letter-spacing: -0.02em; }
.status-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.status-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  flex: 0 0 auto;
  margin: 0;
  position: relative;
  z-index: 1;
}

.status-facts div { padding: 4px 20px; border-left: 1px solid var(--line); }
.status-facts dt { margin-bottom: 8px; color: var(--silver); font-size: 11px; white-space: nowrap; }
.status-facts dd { margin: 0; font-size: 14px; font-weight: 700; }

.error-banner {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(216, 58, 82, 0.2);
  border-radius: 12px;
  color: #8e2032;
  background: var(--red-soft);
  font-size: 13px;
}
.error-banner strong { margin-right: 5px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.summary-card {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid rgba(104, 107, 130, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.025);
}
.summary-card p { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.summary-card strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 27px; letter-spacing: -0.04em; white-space: nowrap; }
.summary-card > span { display: block; margin-top: 7px; color: var(--silver); font-size: 12px; }
.summary-live strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 21px; }

.wallets-section { margin-top: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}
.connection-state span { background: var(--green); }
.connection-state.is-error { color: #8e2032; }
.connection-state.is-error span { background: var(--red); }
.connection-state.is-stale { color: var(--amber); }
.connection-state.is-stale span { background: var(--amber); }

.wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.wallet-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(104, 107, 130, 0.17);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 36px rgba(33, 20, 70, 0.045);
}
.wallet-header { padding: 24px 24px 20px; border-bottom: 1px solid var(--line); }
.wallet-title-row { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.wallet-total { text-align: right; }
.wallet-total strong { display: block; font-size: 21px; letter-spacing: -0.035em; }
.wallet-total small { color: var(--silver); font-size: 10px; }
.wallet-address { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.address-link {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: rgba(113, 50, 245, 0.32);
  text-underline-offset: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.address-link:hover { color: var(--purple); text-decoration: underline; }
.copy-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.copy-button:hover { background: rgba(113, 50, 245, 0.15); }
.unpriced-note {
  margin: 14px 24px 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #865019;
  background: var(--amber-soft);
  font-size: 11px;
  line-height: 1.4;
}

.asset-table { width: 100%; }
.asset-head, .asset-row { display: grid; grid-template-columns: minmax(155px, 1.35fr) minmax(86px, 0.8fr) minmax(80px, 0.7fr); gap: 12px; align-items: center; }
.asset-head { padding: 12px 24px; color: var(--silver); background: #fafafd; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.asset-head span:not(:first-child), .asset-number { text-align: right; }
.asset-row { min-height: 78px; padding: 13px 24px; border-top: 1px solid rgba(222, 222, 229, 0.72); }
.asset-row:first-child { border-top: 0; }
.asset-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.asset-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 50, 245, 0.11);
  border-radius: 11px;
  color: var(--purple-deep);
  background: var(--purple-soft);
  font-size: 11px;
  font-weight: 800;
}
.asset-name { min-width: 0; }
.asset-symbol-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.asset-symbol { overflow: hidden; font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.risk-badge { padding: 2px 5px; border-radius: 5px; color: #9f2437; background: var(--red-soft); font-size: 8px; font-weight: 800; letter-spacing: 0.06em; }
.asset-mint { display: block; margin-top: 4px; overflow: hidden; color: var(--silver); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-decoration: underline; text-decoration-color: rgba(113, 50, 245, 0.28); text-underline-offset: 2px; text-overflow: ellipsis; white-space: nowrap; }
.asset-mint:hover { color: var(--purple); }
.asset-number strong, .asset-number span { display: block; }
.asset-number strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.asset-number span { margin-top: 4px; color: var(--silver); font-size: 11px; }
.no-assets { padding: 30px 24px; color: var(--muted); font-size: 13px; text-align: center; }

.skeleton-card { padding: 24px; }
.skeleton { height: 14px; margin-bottom: 15px; border-radius: 6px; background: linear-gradient(90deg, #eeeef3 25%, #f8f8fb 50%, #eeeef3 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton.wide { width: 55%; height: 22px; }
.skeleton.medium { width: 78%; }
.skeleton.row { width: 100%; height: 58px; margin-top: 20px; }
@keyframes shimmer { to { background-position: -200% 0; } }

footer {
  width: min(1240px, calc(100% - 48px));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid rgba(104, 107, 130, 0.18);
  color: var(--silver);
  font-size: 11px;
}
footer p { margin: 0; }

@media (max-width: 900px) {
  .status-card { align-items: flex-start; flex-direction: column; }
  .status-facts { width: 100%; }
  .status-facts div:first-child { padding-left: 0; border-left: 0; }
  .wallet-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .topbar { height: 68px; padding: 0 16px; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .network-badge { padding: 7px 8px; font-size: 10px; }
  main { width: calc(100% - 28px); margin-top: 22px; }
  .status-card { min-height: 0; padding: 24px 20px; border-radius: 17px; }
  .status-primary { align-items: flex-start; gap: 15px; }
  .status-pulse { margin-top: 8px; }
  .status-facts { grid-template-columns: 1fr; }
  .status-facts div, .status-facts div:first-child { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); border-left: 0; }
  .status-facts dt { margin: 0; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-live { grid-column: 1 / -1; }
  .summary-card { padding: 18px; }
  .summary-card strong { font-size: 22px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .wallet-header { padding: 20px 18px 17px; }
  .asset-head { display: none; }
  .asset-row { grid-template-columns: 1fr 1fr; padding: 13px 18px; }
  .asset-row .asset-identity { grid-column: 1 / -1; }
  .asset-row .asset-number:nth-child(2) { display: block; text-align: left; }
  .asset-row .asset-number:nth-child(3) { text-align: right; }
  .unpriced-note { margin-right: 18px; margin-left: 18px; }
  footer { width: calc(100% - 28px); flex-direction: column; }
}

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