:root {
  --bg: #07090d;
  --panel: #10141c;
  --panel-2: #161c27;
  --text: #eef2f6;
  --muted: #8b93a1;
  --line: #1c2330;
  --accent: #4ade80;
  --accent-2: #67e8f9;
  --down: #fb7185;
  --warn: #fbbf24;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(74, 222, 128, 0.12), transparent 50%),
    radial-gradient(700px 360px at 110% 0%, rgba(103, 232, 249, 0.08), transparent 46%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-body { min-height: 100vh; }
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-box {
  width: min(420px, 100%);
  background: rgba(16, 20, 28, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.7rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.brand-mark {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.auth-box h1 { margin: 0 0 0.4rem; font-size: 1.6rem; }
.auth-box p { color: var(--muted); margin: 0 0 1.2rem; line-height: 1.45; }
.auth-input {
  width: 100%;
  padding: 0.8rem 0.85rem;
  background: #0b0e14;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  margin-bottom: 0.8rem;
}
.auth-btn {
  width: 100%;
  padding: 0.82rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #062113;
  font-weight: 700;
  cursor: pointer;
}
.error { color: var(--down); min-height: 1.2em; font-size: 0.88rem; margin-bottom: 0.6rem; }

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem calc(88px + var(--safe-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topbar h1 { margin: 0.15rem 0 0; font-size: 1.15rem; font-weight: 650; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
}
.top-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.45rem; }
.fx-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}
.fx-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.32rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.fx-toggle button.active {
  background: var(--accent);
  color: #062113;
}

.hero {
  background: linear-gradient(180deg, rgba(22, 28, 39, 0.96), rgba(16, 20, 28, 0.96));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.2rem 1.15rem 1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
}
.kicker {
  color: var(--accent-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
}
.worth {
  margin: 0.35rem 0 0.15rem;
  font-size: clamp(2.1rem, 8vw, 3rem);
  letter-spacing: -0.04em;
  font-weight: 720;
  line-height: 1.05;
}
.subworth { color: var(--muted); margin: 0 0 0.8rem; font-size: 0.95rem; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }

.chart-wrap {
  height: 132px;
  margin: 0.2rem 0 0.3rem;
}
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-empty {
  height: 132px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
}
.stat .label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { margin-top: 0.3rem; font-size: 1.15rem; font-weight: 650; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 0.95rem 0.7rem;
  margin-bottom: 0.85rem;
}
.card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line);
}
.row:first-of-type { border-top: 0; }
.row .left { min-width: 0; }
.row .name { font-weight: 650; }
.row .meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.row .right { text-align: right; white-space: nowrap; }
.row .amt { font-weight: 650; }
.muted { color: var(--muted); }
.empty {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.4rem 0 0.7rem;
}

.bar {
  height: 8px;
  background: #0b0e14;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  margin: 0.2rem 0 0.9rem;
}
.bar span { display: block; height: 100%; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.4rem;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 0.35rem;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 9, 13, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.35rem 0.4rem calc(0.45rem + var(--safe-bottom));
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  padding: 0.35rem 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--text); }
.tab.active svg { stroke: var(--accent); }

.page { display: none; }
.page.active { display: block; }

.note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 0.8rem;
}

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