.fund-perf-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.fund-perf-page h1 {
  color: var(--color-primary);
  margin-bottom: 8px;
  text-align: center;
}

.fund-perf-page .subtitle {
  color: var(--color-text-light);
  font-size: 0.9em;
  text-align: center;
  margin-bottom: 20px;
}

.fund-perf-page .intro {
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--color-bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
}

.filter-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.filter-bar .filter-search input {
  padding: 6px 12px;
  border: 1px solid var(--color-border-medium);
  border-radius: 4px;
  font-size: 0.85em;
  min-width: 200px;
}

.filter-bar label {
  font-size: 0.85em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar select {
  padding: 6px 12px;
  border: 1px solid var(--color-border-medium);
  border-radius: 4px;
  font-size: 0.85em;
  background: white;
  cursor: pointer;
}

/* Table Styles */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
  border-radius: 8px;
  border: 1px solid var(--color-border-light);
}

table.fund-perf {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  background: white;
}

table.fund-perf thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

table.fund-perf th {
  background: var(--color-primary);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

table.fund-perf th.sortable {
  cursor: pointer;
  transition: background 0.2s;
}

table.fund-perf th.sortable:hover {
  background: var(--color-primary-hover);
}

table.fund-perf th.sorted-asc,
table.fund-perf th.sorted-desc {
  background: var(--color-primary-hover);
}

.sort-arrow {
  display: inline-block;
  width: 12px;
  margin-left: 4px;
  font-weight: bold;
}

table.fund-perf td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
}

table.fund-perf tbody tr:hover {
  background: var(--color-bg-light);
}

table.fund-perf td.text-right,
table.fund-perf th.text-right {
  text-align: right;
}

/* Multi-year cumulative columns: set the 3y/5y group visually apart from the
   single calendar-year columns with a slightly stronger vertical rule.  The
   cell backgrounds carry the red→white→green heat shading (applied inline by
   script.js at the same ±30% per-year scale as the year columns, using each
   cell's annualised figure). */
table.fund-perf th.col-cum3,
table.fund-perf td.col-cum3 {
  border-left: 2px solid var(--color-border-medium);
}

.win-label {
  display: block;
  font-weight: 400;
  font-size: 0.82em;
  opacity: 0.85;
  line-height: 1.2;
  margin-top: 2px;
}

table.fund-perf td.col-name {
  font-weight: 600;
  color: var(--color-text);
}



/* Index column on the ETF guide page benchmark table */
table.fund-perf td.col-index {
  color: var(--color-text-light);
  font-size: 0.85em;
  white-space: nowrap;
}

table.fund-perf td.col-category {
  color: var(--color-text-light);
  font-size: 0.8em;
}

.footnote {
  font-size: 0.8em;
  color: var(--color-text-light);
  margin-top: 12px;
  line-height: 1.5;
}

/* Annualise toggle + heat legend (filter bar on /fund-performance/,
   .perf-controls on provider pages). The swatch + caption are painted by
   script.js so they always match the actual shading scale. */
.annualise-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.annualise-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.perf-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

