.gold-etf {
  --gold-up: #75dab0;
  --gold-down: #ff8a92;
  --gold-chart: var(--yellow);
  min-width: 0;
}

.light-mode .gold-etf {
  --gold-up: #157348;
  --gold-down: #b92a38;
  --gold-chart: #96650c;
}

.gold-etf .gold-heading {
  align-items: flex-start;
}

.gold-etf .gold-heading .heading-actions {
  flex-wrap: wrap;
}

.gold-etf .gold-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-chart);
  border-radius: 9px;
  background: var(--panel2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.gold-etf .gold-status p {
  margin: 0;
}

.gold-etf .gold-status .button {
  margin-left: auto;
}

.gold-etf .gold-status-error {
  border-left-color: var(--gold-down);
}

.gold-etf .gold-status-stale {
  border-left-color: var(--gold-chart);
}

.gold-etf .gold-status-loading {
  color: var(--muted);
  border-left-color: var(--accent2);
}

.gold-etf .gold-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: -7px 0 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.gold-etf .gold-history-panel {
  margin-top: 18px;
}

.gold-etf .gold-range-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.gold-etf .stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.gold-etf .button:disabled {
  cursor: wait;
  opacity: .7;
  transform: none;
}

.gold-etf .gold-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

.gold-etf .gold-stats .stat-card {
  min-width: 0;
  background: var(--panel);
}

.gold-etf .gold-stats .stat-top {
  align-items: flex-start;
  gap: 8px;
}

.gold-etf .gold-stats .stat-value {
  font-size: clamp(19px, 2.2vw, 23px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.gold-etf .gold-stats .stat-foot {
  line-height: 1.6;
}

.gold-etf .gold-positive {
  color: var(--gold-up);
}

.gold-etf .gold-negative {
  color: var(--gold-down);
}

.gold-etf .gold-chart-wrap {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}

.gold-etf .gold-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  overflow: visible;
}

.gold-etf .gold-chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.gold-etf .gold-chart-axis {
  fill: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.gold-etf .gold-chart-line {
  fill: none;
  stroke: var(--gold-chart);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.gold-etf .gold-chart-area {
  fill: var(--gold-chart);
  fill-opacity: 0.12;
  stroke: none;
}

.gold-etf .gold-chart-point {
  fill: var(--gold-chart);
  stroke: var(--panel);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.gold-etf .gold-chart-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.gold-etf .gold-chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.gold-etf .gold-source-note,
.gold-etf .gold-term-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.gold-etf .gold-source-link {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gold-etf .button-outline {
  color: var(--text);
  border-color: var(--line);
}

.gold-etf .button-outline:hover {
  background: var(--panel2);
  border-color: var(--accent2);
}

.gold-etf :is(button, select, a):focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

.gold-etf .gold-table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.gold-etf .gold-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.gold-etf .gold-table th,
.gold-etf .gold-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.gold-etf .gold-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.gold-etf .gold-table .gold-table-date {
  text-align: left;
}

.gold-etf .gold-table tbody tr:hover {
  background: var(--panel2);
}

.gold-etf .gold-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1180px) {
  .gold-etf .gold-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gold-etf .gold-heading .heading-actions {
    gap: 8px;
  }

  .gold-etf .gold-heading .select {
    max-width: 100%;
  }

  .gold-etf .gold-stats {
    gap: 10px;
  }

  .gold-etf .gold-chart-axis {
    font-size: 18px;
  }

  .gold-etf .gold-chart-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .gold-etf .gold-chart-wrap svg {
    min-width: 640px;
    max-height: none;
  }

  .gold-etf .gold-table-wrap {
    overscroll-behavior: contain;
  }

  .gold-etf .gold-table th,
  .gold-etf .gold-table td {
    padding: 10px;
  }
}

@media (max-width: 380px) {
  .gold-etf .gold-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .gold-etf .gold-status .button {
    margin-left: 0;
  }
}
