* { box-sizing: border-box; }
body {
  background: #121212;
  color: #eaeaea;
  font-family: -apple-system, system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
  margin: 0;
}
.card {
  background: #1e1e1e;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 1900px;
}
h1 {
  font-size: 22px;
  margin: 0 0 6px;
  text-align: center;
  color: #f5f5f5;
}
.nav {
  text-align: center;
  margin-bottom: 14px;
}
.nav a {
  color: #7db8ff;
  text-decoration: none;
  font-size: 13px;
  margin: 0 8px;
}
.nav a:hover { text-decoration: underline; }
.meta {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}
.meta .vanha { color: #ff8a8a; font-weight: 600; }

.nyt-hinta {
  text-align: center;
  margin-bottom: 28px;
}
.nyt-hinta .arvo {
  font-size: 42px;
  font-weight: 700;
}
.nyt-hinta .arvo.halpa { color: #7de89a; }
.nyt-hinta .arvo.keski { color: #ffd27d; }
.nyt-hinta .arvo.kallis { color: #ff8a6a; }
.nyt-hinta .yksikko { font-size: 16px; color: #999; margin-left: 6px; }
.nyt-hinta .kello { font-size: 13px; color: #888; margin-top: 4px; }

.paivat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.paiva-kortti {
  background: #232323;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.paiva-kortti h3 { margin: 0 0 8px; font-size: 13px; color: #bbb; font-weight: 600; }
.paiva-kortti .tilastot { display: flex; justify-content: space-around; font-size: 13px; }
.paiva-kortti .tilastot div { color: #999; }
.paiva-kortti .tilastot span { display: block; font-size: 16px; font-weight: 700; color: #eaeaea; margin-top: 2px; }
.paiva-kaavio { margin-top: 12px; }

svg rect.palkki { transition: filter 0.08s ease-out; cursor: pointer; }
svg rect.palkki:hover { filter: brightness(1.5); stroke: #fff; stroke-width: 1.5; }
svg .palkki-arvo { opacity: 0; pointer-events: none; transition: opacity 0.08s ease-out; }
svg g.palkki-ryhma:hover .palkki-arvo { opacity: 1; }

.kaavio-paneeli {
  background: #232323;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.kaavio-paneeli h3 { margin: 0 0 10px; font-size: 14px; color: #ccc; font-weight: 600; }
.selite { display: flex; justify-content: center; gap: 18px; font-size: 12px; color: #999; margin: 4px 0 24px; }
.selite span { display: inline-flex; align-items: center; gap: 5px; }
.selite i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.selite .halpa i { background: #7de89a; }
.selite .keski i { background: #ffd27d; }
.selite .kallis i { background: #ff8a6a; }

.suodatin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
}
.suodatin label { color: #bbb; }
.suodatin input[type="date"] {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #eaeaea;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}
.suodatin button {
  background: #3a5a8a;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.suodatin button:hover { background: #4a6a9a; }
.pikavalinnat {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pikavalinnat a {
  color: #bbb;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #3a3a3a;
}
.pikavalinnat a:hover { background: #2a2a2a; }
.pikavalinnat a.aktiivinen {
  background: #3a5a8a;
  border-color: #3a5a8a;
  color: #fff;
}

.taulukko-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #3a3a3a;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}
th, td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid #2a2a2a;
}
th {
  background: #2a2a2a;
  color: #bbb;
  font-weight: 600;
  position: sticky;
  top: 0;
  text-align: right;
}
th:first-child, td:first-child { text-align: left; }
td:first-child { color: #ddd; font-weight: 500; }
tr:nth-child(even) td { background: #232323; }
tr.uusi-paiva td { border-top: 2px solid #3a3a3a; }
td.hinta.halpa  { color: #7de89a; font-weight: 700; }
td.hinta.keski  { color: #ffd27d; font-weight: 700; }
td.hinta.kallis { color: #ff8a6a; font-weight: 700; }

.tyhja {
  text-align: center;
  color: #888;
  padding: 24px;
}
.lahde {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 22px;
}
.lahde-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1c4d34;
  color: #eaffef;
  text-decoration: none;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  margin-top: 6px;
}
.lahde-badge:hover { background: #235f40; }

.tekijanoikeus {
  text-align: center;
  font-size: 11px;
  color: #555;
  margin-top: 14px;
}
.tekijanoikeus sup { font-size: 9px; }

.keskihinnat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.keskihinta-kortti {
  background: #232323;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.keskihinta-kortti .otsikko { font-size: 12px; color: #999; margin-bottom: 6px; }
.keskihinta-kortti .arvo { font-size: 20px; font-weight: 700; }
.keskihinta-kortti .arvo.halpa { color: #7de89a; }
.keskihinta-kortti .arvo.keski { color: #ffd27d; }
.keskihinta-kortti .arvo.kallis { color: #ff8a6a; }
.keskihinta-kortti .arvo .yksikko { font-size: 11px; color: #999; font-weight: 400; margin-left: 3px; }
