/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Host Grotesk', 'Segoe UI', system-ui, sans-serif;
  background: #F7F5F2;
  color: #1a1a2e;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
.page-title {
  font-family: 'Faktum', 'Host Grotesk', system-ui, sans-serif;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 400;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.page-subtitle {
  text-align: center;
  color: #5a5a6e;
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.65;
  max-width: 680px;
  margin: 0 auto 32px;
}

.section-title {
  font-family: 'Faktum', 'Host Grotesk', system-ui, sans-serif;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 400;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}

/* ==========================================================================
   FUND SELECTOR PANEL
   ========================================================================== */
.fund-panel {
  background: #EEEAE4;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
}

.fund-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.fund-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fund-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 2px solid #e0ddd8;
  transition: border-color 0.2s, opacity 0.2s;
}

.fund-card--active { border-color: var(--fund-color); }
.fund-card--inactive { opacity: 0.65; border-color: #e8e6e2; }

.fund-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.fund-card__name { font-size: 14px; font-weight: 700; color: #1a1a2e; }

.fund-card__dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 6px; vertical-align: middle;
}

.fund-card__year { font-size: 11px; color: #8a8a9a; margin-top: 2px; }

.fund-card__toggle {
  border: none; padding: 6px 12px; border-radius: 20px;
  font-family: 'Host Grotesk', sans-serif; font-size: 11px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.3px; white-space: nowrap; flex-shrink: 0;
}

.fund-card__toggle--on { color: #fff; }
.fund-card__toggle--off { background: #e8e6e2; color: #8a8a9a; }
.fund-card__toggle--off:hover { background: #ddd9d3; }

.fund-card__amount { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.fund-card__currency { font-size: 14px; font-weight: 600; color: #8a8a9a; }

.fund-card__input {
  font-family: 'Host Grotesk', sans-serif;
  font-size: 16px; font-weight: 700; color: #1a1a2e;
  background: transparent; border: none;
  border-bottom: 2px solid #e0ddd8;
  padding: 4px 0; width: 100%; outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}

.fund-card__input:focus { border-color: var(--fund-color); }

/* ==========================================================================
   KPI CARDS
   ========================================================================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #e0ddd8;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

.kpi {
  background: #EEEAE4;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi__label {
  font-size: 10px;
  font-weight: 500;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi__value {
  font-family: 'Host Grotesk', sans-serif;
  font-size: clamp(18px, 3.5vw, 24px);
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.kpi__sub {
  font-size: 11px;
  font-weight: 600;
  color: #525ae1;
  margin-top: 2px;
}

/* ==========================================================================
   CHART
   ========================================================================== */
.chart-container {
  background: #525ae1;
  border-radius: 16px;
  padding: 20px 8px 10px;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

.chart-svg { display: block; width: 100%; height: auto; }

.chart-legend {
  display: flex; gap: 16px; justify-content: center; padding: 6px 0; flex-wrap: wrap;
}

.chart-legend__item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.8);
}

.chart-legend__dot { width: 8px; height: 8px; border-radius: 50%; }

.chart-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(10, 14, 36, 0.95); color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 11px;
  font-family: 'Host Grotesk', sans-serif; line-height: 1.5;
  display: none; z-index: 10; white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   DATA TABLE
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid #e0ddd8;
  background: #fff;
  margin-bottom: 16px;
}

.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  background: #F7F5F2; padding: 7px 6px; font-weight: 600; color: #5a5a6e;
  text-align: center; border-bottom: 2px solid #e0ddd8;
  white-space: nowrap; position: sticky; top: 0;
}

.data-table th:first-child {
  text-align: left; padding-left: 10px; min-width: 90px;
  position: sticky; left: 0; z-index: 2; background: #F7F5F2;
}

.data-table th:last-child { background: #EEEAE4; font-weight: 700; color: #1a1a2e; }

.data-table td {
  padding: 6px 6px; text-align: center; border-bottom: 1px solid #f0ede8;
  color: #5a5a6e; white-space: nowrap;
}

.data-table td:first-child {
  text-align: left; padding-left: 10px; font-weight: 600; color: #1a1a2e;
  position: sticky; left: 0; background: #fff; z-index: 1; min-width: 90px;
}

.data-table td:last-child { background: #FAFAF8; font-weight: 700; color: #1a1a2e; }
.data-table tr:last-child td { border-bottom: none; font-weight: 600; color: #1a1a2e; }

.row-toggle { cursor: pointer; user-select: none; }
.row-toggle:hover { background: #f5f3ef; }
.row-toggle td:first-child::before { content: '\25B8 '; color: #8a8a9a; font-size: 10px; }
.row-toggle.open td:first-child::before { content: '\25BE '; }

.sub-row { display: none; }
.sub-row.show { display: table-row; }
.sub-row td { font-size: 10px; color: #8a8a9a; font-weight: 400; }
.sub-row td:first-child { padding-left: 22px; font-weight: 500; }

/* ==========================================================================
   TABLE TOOLTIP
   ========================================================================== */
.table-tooltip {
  position: fixed; pointer-events: none;
  background: rgba(10, 14, 36, 0.95); color: #fff;
  padding: 10px 14px; border-radius: 8px; font-size: 12px;
  font-family: 'Host Grotesk', sans-serif; line-height: 1.6;
  display: none; z-index: 100; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   VIDEO SECTION
   ========================================================================== */
.video-section { margin-bottom: 32px; }

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #1a1a2e;
}

.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ==========================================================================
   DISCLAIMER & EXPLAINER
   ========================================================================== */
.disclaimer {
  font-style: italic; font-size: 12px; color: #8a8a9a; line-height: 1.6; margin-top: 16px;
}

.explainer {
  margin-top: 32px;
  background: #EEEAE4;
  border-radius: 12px;
  padding: 28px 20px;
}

.explainer p { color: #5a5a6e; font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
.explainer p:last-child { margin-bottom: 0; }

/* ==========================================================================
   RESPONSIVE -- TABLET (>=600px)
   ========================================================================== */
@media (min-width: 600px) {
  .layout { padding: 40px 24px 56px; }
  .fund-panel { padding: 24px 28px; }
  .fund-card { padding: 16px; }
  .fund-card__input { font-size: 18px; }
  .kpi { padding: 22px 20px; }
  .kpi__label { font-size: 11px; }
  .chart-container { padding: 24px 12px 10px; border-radius: 20px; }
  .explainer { padding: 36px 32px; }
  .explainer p { font-size: 15px; }
}

/* ==========================================================================
   RESPONSIVE -- DESKTOP (>=900px)
   ========================================================================== */
@media (min-width: 900px) {
  .layout { padding: 48px 32px 64px; }
  .fund-panel__grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .chart-container { padding: 28px 16px 12px; }
  .data-table { table-layout: fixed; width: 100%; }
  .data-table td, .data-table th { white-space: normal; overflow: hidden; text-overflow: ellipsis; }
  .data-table td:first-child, .data-table th:first-child { position: static; min-width: auto; width: 110px; }
}