:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #292929;
  background: #f6f6f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.stat-page {
  max-width: 1500px;
  margin: auto;
  padding: 32px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
h1 {
  font-size: 30px;
  margin: 12px 0 8px;
}
h2 {
  font-size: 20px;
  margin: 0 0 16px;
}
h3 {
  font-size: 15px;
  margin-top: 24px;
}
header p,
.note {
  color: #747474;
  font-size: 13px;
  line-height: 1.6;
}
.back {
  color: #865e40;
  text-decoration: none;
  font-size: 14px;
}
form {
  display: flex;
  gap: 12px;
  align-items: end;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #666;
}
input,
button {
  font: inherit;
  border: 1px solid #deddda;
  border-radius: 9px;
  background: white;
  padding: 11px 14px;
}
button {
  cursor: pointer;
  color: #795b42;
  background: #f6eee5;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
section {
  background: white;
  border: 1px solid #e8e8e5;
  border-radius: 14px;
  padding: 22px;
  margin: 24px 0;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.summary small {
  color: #747474;
}
.summary strong {
  display: block;
  font-size: 27px;
  margin-top: 8px;
  font-weight: 600;
}
.weekly-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
}
.weekly-card {
  border: 1px solid #e9e8e4;
  border-radius: 10px;
  padding: 14px;
}
.weekly-card > strong {
  display: block;
  margin-bottom: 10px;
  color: #795b42;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
th {
  color: #777;
  font-weight: 500;
  white-space: nowrap;
}
th:first-child {
  min-width: 180px;
}
td:first-child {
  min-width: 180px;
  max-width: 270px;
  overflow-wrap: anywhere;
}
.metrics {
  min-width: 145px;
  font-variant-numeric: tabular-nums;
  line-height: 1.9;
}
.metrics strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #777;
}
.metric-line span:last-child {
  color: #444;
}
.empty {
  color: #999;
  font-size: 13px;
}
#stat-status {
  color: #76573f;
  font-size: 13px;
  line-height: 1.6;
  min-height: 22px;
}
.limit-table {
  max-width: 950px;
}
.remaining {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}
.bar {
  width: 100px;
  height: 6px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}
.bar span {
  height: 100%;
  display: block;
  background: #ae8764;
}
.delta {
  color: #888;
}
.note {
  margin: 8px 0;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: #d3d0cb;
  border-radius: 5px;
}
@media (max-width: 760px) {
  .stat-page {
    padding: 18px;
  }
  header {
    align-items: start;
    flex-direction: column;
  }
  h1 {
    font-size: 26px;
  }
  form {
    width: 100%;
    justify-content: space-between;
  }
  .summary {
    grid-template-columns: repeat(2, 1fr);
    padding: 18px;
  }
  .summary strong {
    font-size: 23px;
  }
  section {
    padding: 18px;
  }
  .weekly-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .metrics {
    min-width: 140px;
  }
}
