:root {
  --bg0: #eef3f0;
  --bg1: #d9e6df;
  --ink: #14201b;
  --muted: #5a6b63;
  --line: #c5d4cc;
  --panel: rgba(255, 255, 255, 0.72);
  --good: #0f7a4c;
  --bad: #b42318;
  --accent: #0b6e4f;
  --accent-ink: #f4fbf7;
  --shadow: 0 10px 30px rgba(20, 32, 27, 0.08);
  --radius: 14px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, #cfe4d8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dce8e2 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.view-mode {
  display: flex;
  gap: 6px;
}

.mode-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.snap-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--muted);
}

.snap-hint {
  font-size: 12px;
  opacity: 0.8;
}

.snap-pick .pills {
  justify-content: flex-end;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--font-body);
  padding: 7px 11px;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.brand {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 14px var(--font-body);
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn:hover {
  filter: brightness(1.05);
}

.stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat .v {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .v-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.stat .gap {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stat .gap.good {
  color: var(--good);
}

.stat .gap.bad {
  color: var(--bad);
}

.stat .gap.flat {
  color: var(--muted);
}

.stat .l {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.stat .avg {
  color: var(--muted);
  font-weight: 400;
}

.legend {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.legend-tones {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
}

.tone.good {
  color: var(--good);
}
.tone.bad {
  color: var(--bad);
}
.tone.mid {
  color: var(--ink);
}

.legend p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px 8px;
}

.table-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.table-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.scroll {
  overflow: auto;
  max-height: 70vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8f6;
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--muted);
}

thead th:nth-child(-n + 3) {
  text-align: left;
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #e4ece8;
  text-align: right;
}

tbody td:nth-child(-n + 3) {
  text-align: left;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.35);
}

.m-good {
  color: var(--good);
  font-weight: 700;
}
.m-bad {
  color: var(--bad);
  font-weight: 700;
}
.m-mid {
  color: var(--ink);
}

.foot {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
