:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --paper: #fffdf8;
  --ink: #182024;
  --muted: #667277;
  --line: #d9d3c8;
  --teal: #1f6f78;
  --gold: #c77d1a;
  --violet: #6a4c93;
  --green: #2c7a4b;
  --red: #a43f3f;
  --shadow: 0 18px 50px rgba(24, 32, 36, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
  padding: 36px;
  min-height: 280px;
  color: #fff;
  background:
    linear-gradient(rgba(18, 32, 36, 0.72), rgba(18, 32, 36, 0.68)),
    url("https://images.unsplash.com/photo-1642543492481-44e81e3914a7?auto=format&fit=crop&w=1600&q=80") center / cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.76;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-stat {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-stat span,
.hero-stat small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.hero-stat strong {
  display: block;
  margin: 12px 0;
  font-size: 2.4rem;
}

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

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.metrics strong {
  display: block;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.panel {
  margin: 16px 0;
  padding: 22px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(260px, 0.35fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head.compact {
  display: block;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.allocation-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
}

.bar {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5dc;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

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

.holding,
.watch-item,
.update-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.holding-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ticker {
  font-size: 1.1rem;
  font-weight: 850;
}

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

.badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 750;
}

.badge.etf {
  border-color: #b9dfe4;
  background: #e8f7f8;
  color: #17636d;
}

.badge.stock {
  border-color: #dec6ee;
  background: #f5ecfb;
  color: #6a3d8f;
}

.holding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.mini strong {
  display: block;
  margin-top: 2px;
  font-size: 0.94rem;
}

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

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

.grid-two .panel {
  margin: 0;
}

.watchlist,
.updates,
.history {
  display: grid;
  gap: 12px;
}

.history {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.watch-item h3,
.update-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.watch-item p,
.update-item p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.watch-item small,
.update-item small {
  color: var(--muted);
  font-weight: 700;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-money {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

@media (max-width: 820px) {
  .hero,
  .section-head,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  .metrics,
  .holdings {
    grid-template-columns: 1fr;
  }

  .allocation-row {
    grid-template-columns: 96px minmax(0, 1fr) 48px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-money {
    justify-items: start;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .panel,
  .metrics article {
    padding: 14px;
  }

  .hero-stat strong {
    font-size: 2rem;
  }

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