:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #eee7dc;
  background: #0c0c0e;
  --muted: #b5a9a6;
  --edge: #352b30;
  --accent: #941728;
  --positive: #a3d1b7;
  --negative: #f0a4a9;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: 2px solid #e9a9b2; outline-offset: 4px; }
.shell { width: min(100% - 64px, 1080px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 2; top: 12px; left: 12px; padding: 12px; background: #241b20; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.site-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--edge);
}
.wordmark { font-size: 15px; font-weight: 400; letter-spacing: .28em; text-decoration: none; }
.current { padding-block: 8px; color: #e9a9b2; font-size: 14px; text-decoration: none; }

.hero {
  padding-block: 48px 32px;
  background: linear-gradient(90deg, #0c0c0e 20%, #0c0c0e00 81%),
    linear-gradient(0deg, #0c0c0e, #0c0c0e20 60%),
    url('/assets/shrine-night-v1.png') right 32% / min(78%, 760px) auto no-repeat;
}
h1 { margin: 0; font-weight: 300; font-size: clamp(48px, 8vw, 72px); line-height: 1; letter-spacing: -.045em; }
.hero p { margin: 16px 0 0; max-width: 37ch; font-size: 16px; line-height: 1.5; color: #d5c9c5; }

.board { border: 1px solid var(--edge); border-top-color: var(--accent); background: #121114; }
.board-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 14px 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.board-meta p { margin: 0; }
.board-meta[data-state="stale"], .board-meta[data-state="unavailable"] { color: #f0b6a7; }
.board-meta-right { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 14px; }
#save-snapshot {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #67414a;
  background: #1d1519;
  color: #eee7dc;
  font: inherit;
  cursor: pointer;
}
#save-snapshot svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#save-snapshot:hover { border-color: #ad5967; background: #29171f; }
#save-snapshot:focus-visible { outline: 2px solid #e9a9b2; outline-offset: 3px; }
#save-snapshot:disabled { opacity: .45; cursor: default; }
.snapshot-control { position: relative; }
.snapshot-actions { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; min-width: 180px; padding: 4px; border: 1px solid #67414a; background: #1d1519; box-shadow: 0 8px 24px #0006; }
.snapshot-actions[hidden] { display: none; }
.snapshot-actions button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; background: transparent; color: #eee7dc; font: inherit; text-align: left; cursor: pointer; }
.snapshot-actions button:hover { background: #29171f; }
.snapshot-actions button:focus-visible { outline: 2px solid #e9a9b2; outline-offset: -2px; }
.snapshot-actions button:disabled { opacity: .45; cursor: default; }
#snapshot-status { min-width: 1px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.metric-col { width: 40%; }
th, td { border-top: 1px solid var(--edge); padding: 12px 24px; }
thead th { color: var(--muted); font-size: 13px; font-weight: 500; text-align: right; }
th:first-child { text-align: left; }
tbody th { font-size: 16px; line-height: 1.3; font-weight: 500; }
tbody th small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
td { color: var(--muted); text-align: right; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
td .unit { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
td[data-sign="positive"] { color: var(--positive); }
td[data-sign="negative"] { color: var(--negative); }
td[data-sign="zero"] { color: #eee7dc; }
.notes { padding-block: 14px 40px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.notes p { margin: 0 0 8px; }
.chart-section { margin-bottom: 40px; }
.chart-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.chart-section h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); font-weight: 400; letter-spacing: -.025em; }
.chart-note { margin: 10px 0 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.chart-windows { display: flex; flex-wrap: wrap; gap: 4px; }
.chart-windows button, .history-dates button, .history-dates input {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--edge);
  background: #121114;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chart-windows button[aria-pressed="true"] { border-color: #ad5967; background: #29171f; color: #fff5e9; }
.chart-windows button:disabled { opacity: .45; cursor: default; }
.chart-windows button:enabled:hover, .history-dates button:hover { color: #fff5e9; }
.chart-windows button:focus-visible, .history-dates :is(button, input):focus-visible, canvas:focus-visible { outline: 2px solid #e9a9b2; outline-offset: 3px; }
.history-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.history-dates { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.history-dates label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.history-dates input { color: #eee7dc; min-width: 124px; }
.history-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.history-status:empty { display: none; }
.history-status[data-error] { color: #f0b6a7; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.chart-card { margin: 0; padding: 16px; border: 1px solid var(--edge); background: #121114; }
.chart-card h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; font-weight: 500; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 6px; font-size: 12px; color: #e99da8; }
.chart-legend button { min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.chart-legend button + button { color: #edc5a3; }
.chart-legend button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.chart-legend button:hover { opacity: 1; }
.chart-legend button:focus-visible { outline: 2px solid #e9a9b2; outline-offset: 3px; }
.chart-correction { margin: 0 0 6px; color: #fff0bd; font-size: 12px; }
.chart-point { margin: 0 0 4px; min-height: 20px; font-size: 13px; line-height: 1.45; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-card canvas { display: block; width: 100%; height: 220px; touch-action: pan-y; }

@media (max-width: 620px) {
  .shell { width: min(100% - 32px, 1080px); }
  .site-header { min-height: 60px; }
  .hero { padding-block: 48px 36px; background-size: auto, auto, auto 100%; }
  .hero p { max-width: 30ch; font-size: 14px; }
  .board-meta { position: relative; padding: 12px; }
  .board-meta-right { width: 100%; justify-content: space-between; }
  .snapshot-control { position: static; }
  .snapshot-actions { right: 12px; top: calc(100% - 4px); }
  th, td { padding: 12px 6px; }
  th:first-child { padding-left: 10px; }
  tbody th, td { font-size: 13px; }
  tbody th small { font-size: 11px; }
  .chart-card { padding: 12px; }
  .chart-card canvas { height: 175px; }
  .history-dates { width: 100%; }
  .history-dates label { flex: 1; }
}
