.stats {
  --card: #fff;
  --card-line: #e2e2da;
  --grid: #ecece6;
  --ink-2: #4b4b47;
  --track: #ecece6;
  --rest: #d9d9d0;
  --good-bg: #eaf7c4;
  --bad-bg: #f6e4dd;
  --heat-0: var(--track);
  --heat-1: #a6c33d;
  --heat-2: #84a326;
  --heat-3: #66841e;
  --heat-4: #4a6514;
  --heat-5: #324815;
  padding-top: 40px;
}
.stats-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.stats-toolbar h2 { font-size: 23px; letter-spacing: -0.8px; margin: 0 0 8px; }
.stats-toolbar p { margin: 0; font-size: 13px; color: var(--muted); }
.stats-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 22px 18px;
  background:
    linear-gradient(var(--lime), var(--lime)) no-repeat 50% 100% / 100% 0%,
    var(--card);
  border: 1px solid var(--card-line);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.3s ease,
    border-color 0.25s ease,
    background-size 0.45s cubic-bezier(0.3, 0.7, 0.2, 1),
    scale 0.15s ease;
}
.kpi:active { scale: 0.97; }
.kpi:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08); }
.kpi:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.kpi[aria-selected="true"] {
  background-size:
    100% 100%,
    auto;
  border-color: var(--lime-deep);
  box-shadow: 0 14px 30px rgba(140, 170, 20, 0.22);
}
.kpi[aria-selected="true"]:hover { transform: none; }
.kpi::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: var(--lime);
  border-right: 1px solid var(--lime-deep);
  border-bottom: 1px solid var(--lime-deep);
  transform: translateX(-50%) rotate(45deg) scale(0);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.kpi[aria-selected="true"]::after { transform: translateX(-50%) rotate(45deg) scale(1); }
.kpi-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.kpi-label::after {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--track)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 9.5L5 6l2 2 3-4' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  transition: background-color 0.2s ease;
}
.kpi:hover .kpi-label::after,
.kpi[aria-selected="true"] .kpi-label::after { background-color: #fff; }
.kpi[aria-selected="true"] .kpi-label { color: var(--ink); }
.kpi[aria-selected="true"] .kpi-value { animation: value-pop 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes value-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.kpi-value {
  transform-origin: left center;
  margin: 14px 0 10px;
  font:
    750 38px/1 Inter,
    system-ui,
    sans-serif;
  letter-spacing: -1.6px;
  color: var(--ink);
}
.kpi-value small { font-size: 0.5em; font-weight: 650; letter-spacing: -0.3px; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.kpi-note { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi[aria-selected="true"] .kpi-note { color: #3d4a12; }
.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink);
  background: var(--good-bg);
  white-space: nowrap;
}
.delta.bad { background: var(--bad-bg); }
.kpi[aria-selected="true"] .delta { background: #fff; }
.spark { display: block; width: 100%; height: 34px; margin: 4px 0 12px; overflow: visible; }
.spark path { stroke-dasharray: 600; stroke-dashoffset: 0; transition: stroke 0.3s ease; }
.spark.redraw path { animation: spark-draw 0.7s cubic-bezier(0.3, 0.6, 0.2, 1); }
@keyframes spark-draw {
  from { stroke-dashoffset: 600; }
}
.stats .period-switch { position: relative; isolation: isolate; }
.stats .period-switch button,
.stats .period-switch button[aria-pressed="true"] { position: relative; z-index: 1; background: transparent; box-shadow: none; }
.stats .period-switch button[aria-pressed="true"] { font-weight: 650; }
.period-pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0);
  transform: translateX(var(--x, 0));
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(35, 50, 24, 0.12);
  transition:
    transform 0.4s cubic-bezier(0.3, 1.3, 0.5, 1),
    width 0.4s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.period-pill.jump { transition: none; }
.daily-card .card-head.swap > * { animation: head-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.daily-card .card-head.swap > :last-child { animation-delay: 0.06s; }
@keyframes head-in {
  from { opacity: 0; transform: translateY(8px); }
}
.daily .axis.fresh { animation: fade-in 0.5s ease both; }
@keyframes fade-in {
  from { opacity: 0; }
}
.stats-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.stats-row.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card { position: relative; min-width: 0; padding: 24px; background: var(--card); border: 1px solid var(--card-line); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head .eyebrow { display: block; font-size: 9px; letter-spacing: 1.5px; color: #7d876e; }
.card-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.3px; margin: 9px 0 0; }
.card-head .figure { text-align: right; flex-shrink: 0; }
.card-head .figure strong {
  display: block;
  font:
    750 24px/1 Inter,
    system-ui,
    sans-serif;
  letter-spacing: -0.8px;
}
.card-head .figure span { font-size: 11px; color: var(--muted); }
.caption { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.daily-card { margin-bottom: 16px; border-color: var(--lime-deep); }
.daily-card .card-head h3 { font-size: 20px; letter-spacing: -0.5px; }
.daily-card .card-head .figure strong { font-size: 30px; letter-spacing: -1px; }
.facts-card { margin-bottom: 0; }
.daily { position: relative; height: 280px; touch-action: pan-y; }
.daily .draw { transition: stroke-dashoffset 0.9s cubic-bezier(0.3, 0.6, 0.2, 1); }
.daily .wash { transition: opacity 0.6s ease 0.3s; }
.daily svg { display: block; width: 100%; height: 100%; overflow: visible; }
.daily svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.axis text { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 120px;
  padding: 8px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.18);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.12s ease;
  white-space: nowrap;
}
.tip.on { opacity: 1; }
.tip b { display: block; font-size: 13px; font-weight: 650; }
.tip span { color: #c9c9c0; }
.voices { list-style: none; margin: 0; padding: 0; }
.voice {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-areas: "pic name play" "pic bar bar";
  column-gap: 14px;
  row-gap: 10px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--grid);
}
.voice:first-child { border-top: 0; padding-top: 4px; }
.voice img { grid-area: pic; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--track); }
.voice-name { grid-area: name; min-width: 0; }
.voice-name strong { font-size: 14px; font-weight: 650; }
.voice-name span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.voice-share { font-weight: 650; font-variant-numeric: tabular-nums; }
.voice .meter { grid-area: bar; }
.play {
  grid-area: play;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--card-line);
  border-radius: 99px;
  background: #fff;
  color: var(--ink);
  font:
    600 11px Inter,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.play:hover { border-color: var(--ink); }
.play:active { scale: 0.94; }
.play[aria-pressed="true"] svg { animation: value-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1); }
.play[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.play svg { width: 10px; height: 10px; fill: currentColor; }
.meter { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.meter.lead i { background: var(--lime-deep); }
.heat { display: grid; grid-template-columns: 30px repeat(12, minmax(0, 1fr)); gap: 3px; }
.heat .day,
.heat .hour { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat .day { align-self: center; }
.heat .hour { text-align: left; padding-top: 4px; }
.heat .cell {
  aspect-ratio: 1.6;
  border-radius: 3px;
  background: var(--heat-0);
  cursor: default;
  transition:
    background 0.3s ease,
    transform 0.15s ease;
  animation: cell-in 0.45s cubic-bezier(0.3, 1.3, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 7ms);
}
.heat .cell:hover { transform: scale(1.12); }
@keyframes cell-in {
  from { opacity: 0; transform: scale(0.4); }
}
.heat .cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; align-items: center; gap: 4px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.legend i { width: 14px; height: 10px; border-radius: 2px; }
.legend span:first-child { margin-right: 4px; }
.legend span:last-child { margin-left: 4px; }
.ranks { list-style: none; margin: 0; padding: 0; }
.rank { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 11px 0; font-size: 13px; }
.rank b { font-weight: 550; }
.rank .num { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.rank-bar { height: 14px; }
.rank-bar i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--rest);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rank:first-child .rank-bar i { background: var(--ink); }
.hist {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding-top: 30px;
  border-bottom: 1px solid var(--rest);
}
.hist .col {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.hist .col i {
  display: block;
  width: min(24px, 100%);
  border-radius: 4px 4px 0 0;
  background: var(--rest);
  transition: height 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hist .col.peak i { background: var(--lime-deep); }
.hist .col em { position: absolute; font-style: normal; font-size: 11px; font-weight: 650; transform: translateY(-20px); }
.hist .col:hover i,
.hist .col:focus-visible i { background: var(--ink); }
.hist .col i { transform-origin: bottom; }
.hist .col em { animation: fade-in 0.4s ease 0.4s both; }
.hist .col:focus-visible { outline: none; }
.hist-labels { display: flex; gap: 10px; margin-top: 8px; }
.hist-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.facts > div { padding: 4px 22px 4px; border-left: 1px solid var(--grid); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts dt { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.facts dd { margin: 0; }
.facts strong {
  display: block;
  margin: 10px 0 8px;
  font:
    750 32px/1 Inter,
    system-ui,
    sans-serif;
  letter-spacing: -1.2px;
}
.facts strong small { font-size: 15px; font-weight: 650; letter-spacing: -0.2px; margin-left: 3px; }
.facts span { display: block; font-size: 12px; line-height: 1.5; color: var(--muted); }
.facts > div:first-child strong { display: inline-block; padding: 2px 6px 4px; margin-left: -6px; background: var(--lime); }
.table-view { margin-top: 14px; font-size: 12px; }
.table-view summary { cursor: pointer; color: var(--muted); width: max-content; }
.table-view summary:hover { color: var(--ink); }
.table-view .scroll { max-height: 260px; overflow: auto; margin-top: 10px; border: 1px solid var(--grid); }
.table-view table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th,
.table-view td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.table-view th:first-child,
.table-view td:first-child { text-align: left; }
.table-view thead th { position: sticky; top: 0; background: #fafaf7; font-weight: 600; }
.stats .stats-footnote { margin-top: 24px; }
@media (max-width: 1100px) {
  .stats-kpis { grid-template-columns: 1fr 1fr; }
  .kpi::after { display: none; }
  .facts { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats-row,
  .stats-row.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .stats-toolbar { flex-direction: column; align-items: stretch; }
  .stats-toolbar .period-switch button { flex: 1; }
  .stats-kpis { gap: 10px; }
  .kpi { padding: 16px 14px 14px; }
  .kpi-value { font-size: 26px; letter-spacing: -1px; margin: 12px 0 6px; }
  .kpi-label::after { width: 18px; height: 18px; background-size: 10px; }
  .kpi:hover { transform: none; }
  .daily-card .card-head h3 { font-size: 17px; }
  .daily-card .card-head .figure strong { font-size: 24px; }
  .facts > div { padding: 0 0 0 14px; }
  .facts > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .kpi-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .card { padding: 18px 16px; }
  .card-head { flex-direction: column; gap: 10px; }
  .card-head .figure { text-align: left; }
  .daily { height: 200px; }
  .heat { grid-template-columns: 26px repeat(12, minmax(0, 1fr)); gap: 2px; }
  .heat .hour.minor { visibility: hidden; }
  .rank { grid-template-columns: 92px minmax(0, 1fr) 38px; gap: 10px; font-size: 12px; }
  .hist { gap: 6px; }
  .hist-labels { gap: 6px; }
  .hist-labels span { font-size: 9px; }
  .facts strong { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .meter i,
  .rank-bar i,
  .hist .col i,
  .heat .cell,
  .kpi,
  .kpi::after,
  .daily .draw,
  .daily .wash,
  .period-pill { transition: none; }
  .heat .cell,
  .kpi-value,
  .spark.redraw path,
  .card-head.swap > *,
  .daily .axis.fresh,
  .hist .col em,
  .play svg { animation: none !important; }
}
