.reference-page {
  max-width: 1000px;
  margin: 0 auto clamp(35px, 7vw, 72px);
}
.reference-embedded {
  max-width: none;
  margin-top: clamp(24px, 5vw, 48px);
  scroll-margin-top: 16px;
}
.reference-heading { margin-bottom: 25px; }
.reference-heading p { max-width: 58ch; }
.reference-workspace {
  --chart-bg: #102a3a;
  --chart-paper: #18384b;
  --chart-edge: #557789;
  --chart-text: #f3fbfc;
  --chart-secondary: #afd0d9;
  --chart-accent: #65edd1;
  min-width: 0;
  padding: clamp(14px, 4vw, 36px);
  border: 1px solid #33586d;
  border-radius: 22px;
  background: linear-gradient(135deg, #0b2132, var(--chart-bg));
  color: var(--chart-text);
}
.reference-workspace [hidden] { display: none !important; }
.reference-workspace :is(button,input,select,summary,a):focus-visible {
  outline: 2px solid var(--chart-accent);
  outline-offset: 3px;
}
.reference-form { position: relative; z-index: 1; }
.reference-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(6px, 2vw, 16px);
}
.reference-currency:last-child { grid-column: 3; }
.reference-currency { min-width: 0; position: relative; }
.reference-native { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; }
.reference-native select, .reference-picker summary, .reference-swap {
  min-width: 0;
  border: 1px solid var(--chart-edge);
  border-radius: 10px;
  color: var(--chart-text);
  background: var(--chart-paper);
}
.reference-native select { width: 100%; min-height: 46px; padding: 6px; }
.reference-picker > summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
  padding: 8px 26px 8px 12px;
  line-height: 1.15;
  cursor: pointer;
  list-style: none;
}
.reference-picker > summary::-webkit-details-marker { display: none; }
.reference-picker > summary span { color: var(--chart-secondary); font-size: .8rem; overflow-wrap: anywhere; }
.reference-picker > summary svg { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.reference-picker > summary strong { font-size: 1.12rem; }
.reference-swap {
  width: 46px;
  height: 46px;
  align-self: center;
  display: grid;
  place-items: center;
}
.reference-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  width: clamp(220px, 34vw, 320px);
  max-width: calc(100vw - 54px);
  padding: 8px;
  border: 1px solid var(--chart-edge);
  border-radius: 12px;
  background: #142f42;
  box-shadow: 0 16px 30px #080f1859;
}
.reference-currency:last-child .reference-options { left: auto; right: 0; }
.reference-options input {
  width: 100%;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid var(--chart-edge);
  border-radius: 7px;
  background: #102435;
  color: var(--chart-text);
  font-size: 1rem;
}
.reference-options input::placeholder { color: var(--chart-secondary); }
.reference-options ul { margin: 6px 0 0; padding: 0; max-height: 225px; overflow-y: auto; list-style: none; }
.reference-options button {
  width: 100%;
  min-height: 42px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--chart-text);
  text-align: left;
  background: transparent;
}
.reference-options button:is(:hover, :focus-visible) { background: #264657; }
.reference-options button strong { color: var(--chart-accent); min-width: 3ch; }
.reference-options p { padding: 7px; }
.reference-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 24px;
}
.reference-period { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.reference-period label { position: relative; cursor: pointer; }
.reference-period input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.reference-period span {
  display: grid;
  align-items: center;
  min-height: 42px;
  padding: 6px 11px;
  border: 1px solid var(--chart-edge);
  border-radius: 7px;
  font-size: .87rem;
  line-height: 1.2;
}
.reference-period input:checked + span { background: var(--chart-accent); color: #052027; border-color: var(--chart-accent); font-weight: 750; }
.reference-period input:focus-visible + span { outline: 2px solid var(--chart-accent); outline-offset: 3px; }
.reference-submit.button { color: #06222b; background: var(--chart-accent); }
.reference-workspace:has(.reference-picker:not([hidden])) .reference-submit { display: none; }
.reference-quote {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #345363;
}
.reference-label, .reference-quote time, .reference-change span { color: var(--chart-secondary); font-size: .84rem; }
.reference-quote h2 { font-size: clamp(1.46rem, 3.6vw, 2.45rem); letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 2px 0 5px; }
.reference-change { display: flex; flex-direction: column; }
.reference-change strong { font-variant-numeric: tabular-nums; }
.reference-change [data-trend="1"] { color: var(--chart-accent); }
.reference-change [data-trend="-1"] { color: #ffb8a9; }
.reference-stale { padding-top: 9px; color: #ffd499; }
.reference-point { margin: 12px 0 5px; color: var(--chart-text); font-size: .86rem; font-variant-numeric: tabular-nums; }
.reference-plot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(48px, auto); column-gap: 8px; }
.reference-plot svg { width: 100%; height: clamp(145px, 29vw, 270px); touch-action: pan-y; }
.reference-grid, .reference-guide { fill: none; stroke: #7999a750; stroke-width: 1; }
.reference-guide { stroke: #b6dce08c; stroke-dasharray: 4 4; }
.reference-line { fill: none; stroke: var(--chart-accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.reference-marker { fill: none; stroke: var(--chart-accent); stroke-width: 7; stroke-linecap: round; }
.reference-axis { display: flex; justify-content: space-between; flex-direction: column; padding: 4px 0; }
.reference-axis, .reference-dates { color: var(--chart-secondary); font-size: .75rem; font-variant-numeric: tabular-nums; }
.reference-dates { display: flex; justify-content: space-between; gap: 4px; padding: 0 2px; }
.reference-inspect { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 13px; margin: 14px 0 9px; color: var(--chart-secondary); font-size: .83rem; }
.reference-inspect input { flex: 1; min-width: 115px; accent-color: var(--chart-accent); }
.reference-values summary { display: list-item; padding: 7px 0; color: var(--chart-text); font-weight: 650; cursor: pointer; }
.reference-values > div { max-height: 275px; overflow: auto; }
.reference-values table { width: 100%; border-collapse: collapse; text-align: left; }
.reference-values th, .reference-values td { padding: 5px 7px; border-bottom: 1px solid #345363; font-size: .88rem; font-weight: 500; }
.reference-values :is(th,td):last-child { text-align: right; }
.reference-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #345363; font-size: .85rem; color: var(--chart-secondary); }
.reference-foot a { text-decoration: underline; text-underline-offset: 3px; color: var(--chart-accent); }
.reference-empty { padding: clamp(12px, 5vw, 48px) 0; }
.reference-empty h2 { font-size: 1.1rem; }
.reference-empty p { color: var(--chart-secondary); }
@media (max-width: 410px) {
  .reference-pair { column-gap: 6px; }
  .reference-swap { width: 41px; height: 44px; }
  .reference-picker > summary { padding-left: 7px; }
  .reference-dates time:nth-child(2):not(:last-child) { display: none; }
}
