:root {
  --bg: #0b1020;
  --panel: #121a31;
  --panel-2: #18213d;
  --text: #e8ecf3;
  --muted: #98a2b3;
  --accent: #7dd3fc;
  --good: #34d399;
  --warn: #f59e0b;
  --bad: #f87171;
  --line: #26304d;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0a0f1d 0%, var(--bg) 100%);
  color: var(--text);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.05;
  margin-bottom: 10px;
}

h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.subtitle,
.section-head p,
.kpi-note,
.meta-label,
.risk-list,
.allocation-meta {
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.subtitle {
  max-width: 780px;
  line-height: 1.5;
}

.topmeta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-card,
.card {
  background: rgba(18, 26, 49, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.meta-card {
  min-width: 170px;
  padding: 14px 16px;
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.card {
  padding: 20px;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 10px;
}

.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.layout-two {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  margin: 4px 0 0;
  line-height: 1.45;
}

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

.allocation-row {
  border: 1px solid var(--line);
  background: rgba(24, 33, 61, 0.6);
  border-radius: 14px;
  padding: 14px;
}

.allocation-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.allocation-name {
  font-weight: 700;
}

.bar {
  height: 10px;
  width: 100%;
  background: #0f1630;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #60a5fa 100%);
  border-radius: 999px;
}

.risk-list {
  margin: 0;
  padding-left: 18px;
}

.risk-list li {
  margin: 10px 0;
  line-height: 1.45;
}

.positions-head {
  margin-bottom: 14px;
}

.wallet-section {
  margin-bottom: 18px;
}

.wallet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.wallet-item {
  border: 1px solid var(--line);
  background: rgba(24, 33, 61, 0.6);
  border-radius: 14px;
  padding: 16px;
}

.wallet-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.wallet-chain {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(24, 33, 61, 0.85);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.wallet-address,
.wallet-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.wallet-value {
  margin: 12px 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

td {
  font-size: 14px;
}

.right {
  text-align: right;
}

.asset-name {
  font-weight: 700;
}

.asset-class {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(24, 33, 61, 0.85);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 960px) {
  .topbar,
  .layout-two {
    grid-template-columns: 1fr;
    display: grid;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 24px 14px 56px;
  }

  h1 {
    font-size: 30px;
  }

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

  .meta-card {
    width: 100%;
  }
}
