:root {
  --ink: #111111;
  --paper: #ffffff;
  --gray: #5c5c5c;
  --gray-2: #8a8a8a;
  --line: #e6e6e6;
  --gold: #c89b3c;
  --soft: #f6f6f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--ink); }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

header.site {
  padding: 28px 0 0;
}

.gold-hairline {
  height: 2px;
  margin: 16px 0 0;
  background: var(--gold);
  border: 0;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lede {
  margin: 8px 0 0;
  color: var(--gray);
  max-width: 46rem;
}

.panel {
  margin-top: 28px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--gray);
}

select, button {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
}

.note {
  margin: 12px 0 0;
  color: var(--gray);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.metric span {
  display: block;
  color: var(--gray);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 600;
}

.section-title {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.plot-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 8px;
}

canvas {
  width: 100%;
  height: auto;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: var(--gray);
  font-size: 13px;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: right;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

th:first-child, td:first-child { text-align: left; }

th { color: var(--gray); font-weight: 500; }

.scroll { overflow-x: auto; }

details { margin-top: 12px; }

.compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.compare label { font-size: 14px; color: var(--ink); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 48px 0 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--gray);
  font-size: 13px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--paper);
}

.footer-brand p { margin: 0; }

.site-footer nav {
  display: flex;
  gap: 20px;
}

.prose { max-width: 42rem; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 20px; margin-top: 28px; }

@media (max-width: 800px) {
  h1 { font-size: 26px; }
  .controls, .metrics { grid-template-columns: 1fr 1fr; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
