:root {
  --bg: #f3f1ec;
  --paper: #fcfbf8;
  --ink: #1c1b18;
  --muted: #6b675e;
  --line: #d8d4cc;
  --line-strong: #c3beb4;
  --down: #3d5348;
  --up: #7a3e32;
  --low: #ece8df;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --max: 40rem;
}

body.home {
  --max: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.site-header,
main,
.site-footer {
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: 1rem;
}

.site-header {
  padding-top: 1.35rem;
  padding-bottom: 0.85rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.back {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.back:hover {
  border-bottom-color: var(--line-strong);
}

.tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
  margin: 0 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-top: 0.35rem;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  text-decoration: none;
  padding: 0.4rem 0.65rem 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.cat {
  scroll-margin-top: 2.75rem;
}

.cat + .cat {
  margin-top: 1.35rem;
}

.cat-label {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.75rem, 1fr));
  gap: 0.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.7rem 0.55rem;
  text-decoration: none;
}

.card:hover {
  border-color: var(--line-strong);
}

.card-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.spark {
  color: #3f4742;
  margin: 0.05rem 0;
  width: 100%;
  height: 28px;
}

.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.02rem;
}

.card-empty .price {
  font-weight: 600;
}

.delta {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
}

.delta .vs {
  font-weight: 400;
  color: var(--muted);
}

.delta.down {
  color: var(--down);
}

.delta.up {
  color: var(--up);
}

.delta.flat,
.muted {
  color: var(--muted);
}

.shop {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.product h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 0.35rem;
}

.spec {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.unit {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chart {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1.1rem 0 1.4rem;
  padding: 0.35rem 0.2rem 0.05rem;
  min-height: 240px;
  overflow: hidden;
}

.uplot,
.uplot * {
  font-family: var(--sans);
}

.u-over {
  cursor: crosshair;
}

.table-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

td.num,
th:nth-child(2) {
  font-variant-numeric: tabular-nums;
}

tr.is-low {
  background: var(--low);
}

td a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty {
  color: var(--muted);
}

.chart-empty {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1.1rem 0 1.4rem;
  padding: 1.1rem 1rem;
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1rem 1.4rem;
  color: var(--muted);
  font-size: 0.8rem;
}
