:root {
  --bg: #070b10;
  --surface: #0f151c;
  --raised: #161f29;
  --high: #1e2935;
  --border: #243040;
  --brand: #12e27a;
  --brand-dark: #0a9e55;
  --accent: #ff8a1f;
  --live: #ff3b4e;
  --gold: #ffc53d;
  --text: #eaf1f8;
  --muted: #93a4b8;
  --faint: #5f7186;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --pad: clamp(1rem, 3vw, 1.75rem);
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #143524 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #1a1208 0%, transparent 45%),
    var(--bg);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.45;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.85em;
  color: var(--gold);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  background: linear-gradient(135deg, var(--brand), #0ac2a0);
  color: #04140c;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-text {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.25rem;
}

.top-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  display: none;
}

.back-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (min-width: 560px) {
  .top-note {
    display: block;
  }
}

.shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 1.25rem var(--pad) 2.5rem;
  display: grid;
  gap: 1rem;
}

.hero-card {
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.mode-pill {
  margin: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mode-pill.live {
  color: #04140c;
  background: var(--brand);
  border-color: transparent;
}

.balance {
  margin: 0.45rem 0 0.15rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.balance-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.ops-label {
  display: block;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.id-row strong {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.actions {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .actions {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.optional {
  color: var(--faint);
  font-weight: 500;
}

input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 1px;
  border-color: var(--brand-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #04140c;
}

.btn-accent {
  width: 100%;
  background: var(--accent);
  color: #1b0d00;
}

.btn-ghost {
  background: var(--raised);
  border-color: var(--border);
  color: var(--text);
}

.form-status {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-status.ok {
  color: var(--brand);
}

.form-status.error {
  color: var(--live);
}

.tx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tx-head .muted {
  margin: 0.15rem 0 0;
}

.tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.tx-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 0.65rem;
  background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.tx-type {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.tx-note {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 0.8rem;
}

.tx-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tx-amount.credit {
  color: var(--brand);
}

.tx-amount.debit {
  color: var(--live);
}

.tx-time {
  color: var(--faint);
  font-size: 0.75rem;
  text-align: right;
}

.empty {
  margin: 0.5rem 0 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.connect-actions .btn {
  width: auto;
}

.foot {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 var(--pad) 2rem;
  color: var(--faint);
  font-size: 0.85rem;
}

.foot p {
  margin: 0.25rem 0;
}
