:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --danger: #ef4444;
  --ok: #22c55e;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top, #1e3a8a 0, var(--bg) 42%);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

h1,
h2,
p {
  margin-top: 0;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(127, 29, 29, 0.35);
}

label {
  display: block;
  margin: 10px 0;
  color: var(--muted);
}

input,
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #082f49;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button.ghost {
  background: var(--panel-2);
  color: var(--text);
}

.actionLink {
  color: var(--primary);
}

.broadcastSlider {
  display: block;
  height: 42px;
  margin: 8px 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--primary);
  cursor: ew-resize;
  touch-action: pan-y;
}

button.dangerBtn {
  background: var(--danger);
  color: #fff;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sectionTitle {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-2);
  color: var(--muted);
}

.walletList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.walletGroups {
  display: grid;
  gap: 18px;
}

.walletGroupCard {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.55);
}

.walletCard {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #020617;
}

.walletAddress {
  overflow-wrap: anywhere;
  color: var(--primary);
  font-family: Consolas, monospace;
}

.muted {
  color: var(--muted);
}

.result {
  white-space: pre-wrap;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 42px;
  padding: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 20px;
  z-index: 20;
}

.modalCard {
  width: min(900px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 520px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0ea5e9;
  color: #00111f;
  font-weight: 700;
  z-index: 30;
}

.txItem {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.txTitle {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.txTitle.in {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
}

.txTitle.out {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
}

.txAmount {
  display: inline-flex;
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 900;
  font-family: Consolas, monospace;
}

.txAmount.in {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.txAmount.out {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.txAddressRow {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.addressBadge {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
}

.addressBadge.from {
  border-color: rgba(56, 189, 248, 0.65);
}

.addressBadge.to {
  border-color: rgba(34, 197, 94, 0.65);
}

.addressLabel {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.addressValue {
  color: var(--text);
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}

.addressName {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  font-weight: 700;
}

.qrBox {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.qrImage {
  width: min(280px, 100%);
  height: auto;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .sectionTitle {
    align-items: stretch;
    flex-direction: column;
  }
}
