:root {
  color-scheme: dark;
  --bg: #060b09;
  --surface: #0c1511;
  --surface-2: #101d17;
  --line: #23362d;
  --line-bright: #365244;
  --text: #f2f7f4;
  --muted: #8fa49a;
  --accent: #7bf0a8;
  --accent-deep: #163c29;
  --danger: #ff8e8e;
  --shadow: 0 24px 80px rgb(0 0 0 / 35%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgb(36 92 60 / 18%), transparent 34rem),
    linear-gradient(180deg, #08100c 0%, var(--bg) 42%);
}

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

.shell {
  width: min(100% - 32px, 620px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.topbar h1,
.notification-card h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 20px rgb(123 240 168 / 8%);
}

.brand-core {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}

.brand-ring {
  position: absolute;
  width: 25px;
  height: 25px;
  border: 1px solid rgb(123 240 168 / 50%);
  border-radius: 50%;
  animation: breathe 2.6s ease-in-out infinite;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgb(12 21 17 / 86%);
  font-size: 0.75rem;
  font-weight: 700;
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6a258;
  box-shadow: 0 0 8px currentColor;
}

.live-pill.is-live {
  color: var(--accent);
}

.live-pill.is-live span {
  background: var(--accent);
}

.live-pill.is-error {
  color: var(--danger);
}

.live-pill.is-error span {
  background: var(--danger);
}

.balance-card,
.notification-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgb(16 29 23 / 96%), rgb(9 17 13 / 96%));
  box-shadow: var(--shadow);
}

.balance-card {
  min-height: 290px;
  padding: 24px;
}

.card-grid {
  position: absolute;
  right: -65px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  opacity: 0.3;
  background:
    repeating-radial-gradient(circle, transparent 0 26px, rgb(123 240 168 / 18%) 27px 28px),
    linear-gradient(90deg, transparent 49.5%, rgb(123 240 168 / 13%) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgb(123 240 168 / 13%) 50%, transparent 50.5%);
  pointer-events: none;
}

.balance-head,
.wallet-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-head p,
.change-line,
.wallet-row,
.section-copy > p:last-child,
.status-grid p,
.action-message {
  color: var(--muted);
}

.balance-head p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.explorer-link {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  background: rgb(255 255 255 / 3%);
}

.explorer-link:hover,
.explorer-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.balance {
  position: relative;
  z-index: 1;
  margin: 48px 0 8px;
  font-size: clamp(2.7rem, 11vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.unit {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
}

.change-line {
  position: relative;
  z-index: 1;
  min-height: 1.5em;
  margin: 14px 0 34px;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.change-line.is-up {
  color: var(--accent);
}

.change-line.is-down {
  color: var(--danger);
}

.wallet-row {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.wallet-name {
  color: var(--text);
  font-weight: 700;
}

.wallet-row code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-top: 16px;
  padding: 22px;
}

.section-copy > p:last-child {
  max-width: 34rem;
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 170px;
}

.button,
.install-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 13px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

.button:disabled,
.install-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  border: 1px solid var(--accent);
  color: #06120b;
  background: var(--accent);
  box-shadow: 0 8px 26px rgb(123 240 168 / 15%);
}

.button-secondary {
  border: 1px solid var(--line-bright);
  color: var(--text);
  background: var(--surface-2);
}

.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.button:hover:not(:disabled),
.button:focus-visible,
.install-button:hover,
.install-button:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid transparent;
}

.action-message {
  grid-column: 1 / -1;
  min-height: 0;
  margin: -10px 0 0;
  font-size: 0.85rem;
}

.action-message:empty {
  display: none;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.status-grid article {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(12 21 17 / 72%);
}

.status-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-deep);
}

.status-grid p,
.status-grid strong {
  margin: 0;
}

.status-grid p {
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.status-grid strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.install-button {
  width: 100%;
  margin-top: 16px;
  border: 1px dashed var(--line-bright);
  color: var(--accent);
  background: transparent;
}

.secure-warning {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid rgb(255 142 142 / 35%);
  border-radius: 14px;
  color: #ffc0c0;
  background: rgb(86 24 24 / 25%);
  font-size: 0.88rem;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 22px, 620px);
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .topbar {
    margin-bottom: 16px;
  }

  .balance-card {
    min-height: 275px;
    padding: 20px;
    border-radius: 19px;
  }

  .notification-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .actions {
    min-width: 0;
  }

  .action-message {
    margin-top: -8px;
  }
}

@media (max-width: 390px) {
  .live-pill {
    padding: 7px 8px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-ring {
    animation: none;
  }
}
