:root {
  --bg: #f2efe8;
  --paper: rgba(255, 252, 245, 0.92);
  --ink: #1f2a24;
  --muted: #607067;
  --line: rgba(31, 42, 36, 0.12);
  --accent: #145c47;
  --accent-soft: #d8ebe3;
  --positive: #0b7a4b;
  --negative: #b43f35;
  --shadow: 0 24px 70px rgba(23, 38, 30, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(20, 92, 71, 0.18), transparent 30%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 100%);
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.hero {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 0.95;
  max-width: 12ch;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
  font-size: 18px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 92, 71, 0.14);
  background: rgba(20, 92, 71, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card,
.panel,
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-label,
.stat-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value,
.stat-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
}

#generatedAt {
  font-size: 20px;
  line-height: 1.2;
}

.metric-note,
.stat-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 22px;
  backdrop-filter: blur(8px);
}

.panel-head h2 {
  margin: 0;
  font-size: 26px;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-card {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.chart-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 92, 71, 0.05), rgba(255, 255, 255, 0.55));
  padding: 10px;
}

#portfolioTrendChart {
  width: 100%;
  height: 240px;
  display: block;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--accent);
}

.chart-label {
  fill: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.chart-subtitle,
.chart-empty {
  fill: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

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

.row-updated {
  animation: rowFlash 1.6s ease-out;
  background: rgba(20, 92, 71, 0.10);
}

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

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

.event-list,
.history-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.event-row,
.history-row {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.event-title,
.history-time {
  font-size: 14px;
}

.history-symbols {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.about-panel {
  background:
    linear-gradient(180deg, rgba(20, 92, 71, 0.08), rgba(255, 252, 245, 0.92));
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.about-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.about-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.about-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.about-card a:hover {
  text-decoration: underline;
}

.symbol-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  cursor: pointer;
}

.symbol-link:hover {
  opacity: 0.8;
}

@keyframes rowFlash {
  0% {
    background: rgba(20, 92, 71, 0.24);
  }
  100% {
    background: rgba(20, 92, 71, 0.00);
  }
}

@media (max-width: 960px) {
  .hero,
  .grid,
  .stats-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 100%;
  }
}
