:root {
  --bg: #0f1324;
  --panel: #141b34;
  --panel-2: #10172d;
  --border: #273156;
  --text: #f5f7fb;
  --muted: #aab4d0;
  --positive: #39d98a;
  --negative: #ff6b6b;
  --neutral: #d6def5;
  --link: #8ab4ff;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0f1324 0%, #12182e 100%);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 42px 0 22px;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  line-height: 1.1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  background: rgba(20, 27, 52, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.compact-hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8ea5ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
}

.hero-card p {
  margin: 6px 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-self: stretch;
}

.stat-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
}

.stat-box span {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.stat-box strong {
  font-size: 1.35rem;
  line-height: 1.15;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.section-header {
  margin: 0 0 14px;
}

.section-header h2,
.panel h2 {
  margin: 0;
  font-size: 1.25rem;
}

.panel {
  background: rgba(20, 27, 52, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.panel p {
  margin: 10px 0;
}

.positions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.position-card,
.history-card {
  background: rgba(20, 27, 52, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.position-card h3,
.history-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.position-card p,
.history-card p {
  margin: 8px 0;
}

.position-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.metric {
  margin-top: 10px;
}

.benchmark-section {
  margin-bottom: 22px;
}

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

.chart-panel {
  margin-bottom: 24px;
}

.chart-wrap {
  background: rgba(20, 27, 52, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.chart-wrap canvas {
  width: 100%;
  max-height: 420px;
}

.chart-note {
  margin-top: 10px;
}

.update-section {
  margin-bottom: 24px;
}

.links-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 40px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1b2544;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  text-decoration: none;
  background: #223057;
}

.history-list {
  display: grid;
  gap: 16px;
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.history-links {
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1b2544;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: lowercase;
}

.badge-active {
  background: rgba(57, 217, 138, 0.12);
  color: var(--positive);
  border-color: rgba(57, 217, 138, 0.35);
}

.badge-completed {
  background: rgba(138, 180, 255, 0.12);
  color: #a9c7ff;
  border-color: rgba(138, 180, 255, 0.35);
}

.badge-tracking {
  background: rgba(255, 200, 87, 0.12);
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.35);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
}

.sub-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

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

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

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

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

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

  .hero-stats {
    grid-template-columns: 1fr;
  }

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

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

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

  .history-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .site-header {
    padding-top: 28px;
  }

  .hero-card,
  .panel,
  .position-card,
  .history-card {
    padding: 16px;
  }

  .links-section {
    flex-direction: column;
  }

  .nav-link {
    width: 100%;
  }
}