:root {
  --ink: #1c1915;
  --muted: #5e564c;
  --paper: #f4efe6;
  --card: #fffdf8;
  --line: #e4d8c4;
  --gold: #8a5a12;
  --gold-deep: #3a2a14;
  --up: #1d6b45;
  --down: #9d2c2c;
  --ticker: #241c12;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 "Avenir Next", "Segoe UI", sans-serif;
}
a { color: var(--gold); }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: white; padding: 8px; z-index: 5; }
.site-header { background: var(--gold-deep); color: #f6efe4; }
.header-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; }
.brand { color: #f3d48a; font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.nav { display: flex; flex-wrap: wrap; gap: 14px; }
.nav a { color: #f6efe4; text-decoration: none; }
.ticker { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 0 14px; border-top: 1px solid rgba(243, 212, 138, 0.25); }
.ticker-prices, .ticker-tools, .flags { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tick-label { color: #d9c4a2; margin-right: 4px; }
.ticker select, .calculator input, .calculator select, .admin input, .admin select, .admin textarea { font: inherit; padding: 6px 8px; }
.flags a { color: #f3d48a; text-decoration: none; font-size: 13px; }
.up { color: #8ddea8; }
.down { color: #ffb4b4; }
main .up { color: var(--up); }
main .down { color: var(--down); }
main { padding: 24px 0 48px; }
h1, h2 { font-family: Palatino, "Iowan Old Style", Georgia, serif; line-height: 1.2; }
.lede { font-size: 18px; max-width: 68ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 16px 0; }
.spot-price, .calc-result strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.ohlc, .perf, .specs, .melt-list { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 0; list-style: none; }
.ohlc div, .specs div { min-width: 120px; }
.ohlc dt, .specs dt { color: var(--muted); font-size: 13px; }
.ohlc dd, .specs dd { margin: 0; font-variant-numeric: tabular-nums; }
.perf { padding: 0; }
.perf li { background: #f7f1e6; border-radius: 999px; padding: 4px 10px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; color: var(--muted); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.calc-grid label, .spread { display: flex; flex-direction: column; gap: 6px; }
.directory { list-style: none; padding: 0; }
.directory li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.note { background: #fff6df; border-left: 4px solid var(--gold); padding: 10px 12px; }
.outbound { display: flex; flex-wrap: wrap; gap: 12px; }
.crumbs { color: var(--muted); font-size: 14px; }
.site-footer { color: var(--muted); padding: 24px 0 40px; }
#primary-chart { min-height: 320px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chart-controls button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.chart-controls button[aria-pressed="true"] { background: var(--gold-deep); color: white; }
.admin-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.light { border-radius: 12px; padding: 14px; background: white; border: 1px solid var(--line); }
.light.green { border-color: var(--up); }
.light.yellow { border-color: #c89616; }
.light.red { border-color: var(--down); }
.dict-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.muted { color: var(--muted); }
@media (max-width: 800px) {
  .ticker, .header-row, .dict-row { display: block; }
  .spot-price { font-size: 26px; }
}
