:root {
  --bg: #0f1014;
  --panel: #151821;
  --panel-2: #1a1f2b;
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f4f5f7;
  --muted: #9aa4b5;
  --accent: #ff7a18;
  --accent-2: #00c2ff;
  --accent-3: #f2c14e;
  --success: #2ef7a2;
  --danger: #ff5470;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --mono: "IBM Plex Mono", monospace;
  --body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orbit {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 122, 24, 0.25), transparent 40%),
    radial-gradient(circle at 80% 15%, rgba(0, 194, 255, 0.2), transparent 35%),
    radial-gradient(circle at 40% 80%, rgba(242, 193, 78, 0.18), transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(255, 84, 112, 0.15), transparent 50%);
  z-index: -2;
}

.bg-noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.09'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: -1;
  opacity: 0.6;
}

.app {
  width: min(1200px, 92vw);
  margin: 48px auto 80px;
  display: grid;
  gap: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.08), rgba(0, 194, 255, 0.08));
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: floatIn 0.7s ease;
}

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 8px;
}

.subhead {
  color: var(--muted);
  max-width: 540px;
}

.hero-actions {
  display: grid;
  gap: 16px;
  justify-items: end;
}

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.meta strong {
  display: block;
  color: var(--text);
  margin-top: 4px;
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

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

.card {
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  animation: rise 0.6s ease;
}

.total-card h2 {
  font-size: 2.2rem;
}

.total-card p {
  font-family: var(--mono);
  color: var(--accent-3);
}

.price-card h3,
.status-card h3 {
  font-size: 1.4rem;
}

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

.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0c10;
  box-shadow: 0 8px 20px rgba(255, 122, 24, 0.35);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn.danger {
  border-color: rgba(255, 84, 112, 0.4);
  color: var(--danger);
}

.btn:hover {
  transform: translateY(-1px);
}

.pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.holdings-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  cursor: pointer;
  border: none;
  color: var(--text);
  transition: background 0.15s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pill-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.28), rgba(0, 194, 255, 0.28));
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 4px;
  opacity: 0.4;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.block-btn:hover {
  opacity: 1;
  color: var(--danger);
}

.blocklist-add {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 8px;
}

.blocklist-entries {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.blocklist-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.blocklist-entry button {
  padding: 4px 12px;
  flex-shrink: 0;
}

.wallet-list {
  display: grid;
  gap: 12px;
}

.portfolio-controls {
  display: grid;
  gap: 8px;
}

.portfolio-controls label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.portfolio-row select {
  min-width: 180px;
  flex: 1;
}

.wallet-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wallet-item span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.wallet-item strong {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.wallet-item button {
  justify-self: end;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-row.header {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--stroke);
}

.table-row.unpriced {
  opacity: 0.45;
}

.table-separator {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
  padding: 14px 0 6px;
  margin-top: 8px;
  border-top: 1px solid var(--stroke);
}

.table-row span:last-child {
  font-family: var(--mono);
  color: var(--accent-3);
}

.connector {
  display: grid;
  gap: 8px;
}

input,
select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--mono);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

select option {
  background: var(--panel);
  color: var(--text);
}

.dialog input,
.dialog select {
  background: var(--panel-2);
  color: var(--text);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row:last-child {
  border-bottom: none;
}

.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-title {
  font-weight: 600;
}

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.toggle input:checked + .slider::before {
  transform: translateX(20px);
}

.dialog {
  border: none;
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.dialog-content {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.footer {
  text-align: center;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    justify-items: start;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .table-row span:nth-child(3),
  .table-row span:nth-child(4),
  .table-row span:nth-child(5) {
    justify-self: end;
  }
}

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

  .table-row span {
    justify-self: start;
  }
}
