/* Currency converter. Tokens, header and footer come from the site stylesheet; --c is the finance colour. */
.intro h1 { font-size: 22px; margin: 0 0 12px; }

.fx-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto minmax(0, 1.4fr); align-items: end; gap: 12px; margin: 20px 0 8px; }
.fx-fields label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 600; }
.fx-fields input, .fx-fields select {
  width: 100%; min-width: 0; font: inherit; font-size: 15px; min-height: 45px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
}
.fx-fields input { font-size: 18px; font-variant-numeric: tabular-nums; }
.fx-fields input:focus, .fx-fields select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.fx-fields input[aria-invalid="true"] { border-color: var(--err); }
.fx-swap {
  display: grid; place-items: center; width: 45px; height: 45px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text);
}
.fx-swap:hover { border-color: var(--c); color: var(--c); }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin: 12px 0; }

.out { margin: 0 0 16px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.out .hint { margin: 0; }
.out .err { color: var(--err); }
.fx-answer { display: flex; flex-direction: column; gap: 2px; }
.fx-answer strong { font-size: 34px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-answer .code { font-size: 20px; font-weight: 600; color: var(--muted); }
.fx-rates { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.fx-when { margin: 8px 0 0; font-size: 13px; }
.fx-stale { margin: 8px 0 0; font-size: 13px; color: var(--err); }

.fx-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.fx-history-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.fx-history h2 { margin: 0; font-size: 16px; }
.fx-ranges { display: inline-flex; gap: 4px; }
.fx-ranges button {
  padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted);
}
.fx-ranges button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 14%, var(--panel)); border-color: var(--c); color: var(--text); }
.fx-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 6px; padding: 0; list-style: none; font-size: 13px; }
.fx-stats li { display: flex; flex-direction: column; }
.fx-stats strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.fx-stats .up { color: var(--ok); }
.fx-stats .down { color: var(--err); }

/* The chart: one series, so no legend; 2px line in the category colour, a 10% wash, hairline grid. */
.fx-chart { position: relative; margin: 6px 0 4px; min-height: 240px; }
.fx-chart svg { display: block; overflow: visible; touch-action: pan-y; }
.fx-chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.fx-chart .grid { stroke: var(--line); stroke-width: 1; }
.fx-chart .ylab, .fx-chart .xlab { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fx-chart .area { fill: var(--c); opacity: .1; }
.fx-chart .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fx-chart .dot { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.fx-chart .hair { stroke: var(--muted); stroke-width: 1; }
.fx-tip {
  position: absolute; z-index: 2; pointer-events: none; padding: 5px 9px; border-radius: 8px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--edge, var(--line)); box-shadow: 2px 2px 0 var(--c); font-size: 12px;
  display: flex; flex-direction: column;
}
.fx-tip[hidden] { display: none; }
.fx-tip strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.fx-tip span { color: var(--muted); }
.fx-table { margin-top: 10px; }
.fx-table summary { cursor: pointer; width: fit-content; font-size: 13px; color: var(--muted); }
.fx-table summary:hover { color: var(--text); }
.fx-table summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Up to ~260 rows (1Y daily, 5Y weekly): a scroll box with the header pinned. */
.fx-table .table-wrap {
  max-width: 420px; max-height: 360px; overflow: auto; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 8px;
}
.fx-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.fx-table th, .fx-table td { padding: 6px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fx-table th + th, .fx-table td + td { text-align: right; }
.fx-table th {
  position: sticky; top: 0; background: var(--panel); box-shadow: 0 1px 0 var(--line);
  font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 0;
}
.fx-table tbody tr:last-child td { border-bottom: 0; }
.fx-table tbody tr:hover td { background: color-mix(in srgb, var(--c) 7%, var(--panel)); }
.fx-export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; }
.fx-export .muted { margin-right: 4px; }
.out .note { margin: 10px 0 0; font-size: 13px; }

.fx-pairs { font-size: 13px; line-height: 1.8; }

@media (max-width: 640px) {
  .fx-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .fx-fields .fx-amount { grid-column: 1 / -1; }
  .fx-answer strong { font-size: 28px; }
  .fx-export .muted { flex-basis: 100%; }
}
