:root {
  color: #17211b;
  background: #f4f6f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  margin: 0;
  background: #f4f6f5;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.toolbar p,
.label,
.detail,
footer {
  margin: 0;
  color: #68736d;
}

.toolbar p {
  margin-top: 4px;
  font-size: 13px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #d9dfdc;
  border-radius: 6px;
  color: #2f5e46;
  background: #ffffff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #8ba796;
  background: #f8fbf9;
}

.icon-button:focus-visible {
  outline: 3px solid rgba(47, 94, 70, 0.2);
  outline-offset: 2px;
}

.icon-button[disabled] {
  cursor: wait;
  opacity: 0.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 152px;
  padding: 18px;
  border: 1px solid #dde2df;
  border-top: 3px solid #789b88;
  border-radius: 6px;
  background: #ffffff;
}

.metric.reset {
  border-top-color: #4f7fa5;
}

.metric.tokens {
  border-top-color: #7c70a2;
}

.metric.cost {
  border-top-color: #b17a3f;
}

.label {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: #17211b;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 720;
}

.value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #2f5e46;
  background: #eaf2ed;
  font-size: 12px;
  font-weight: 700;
}

.progress {
  width: 100%;
  height: 6px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 3px;
  background: #e6ebe8;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #3f7d5b;
  transition: width 180ms ease;
}

.detail {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.4;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 20px;
  padding-top: 12px;
  font-size: 12px;
}

#status.error {
  color: #a33b32;
}

#status.stale {
  color: #8a5c22;
}

@media (max-width: 860px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 16px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 132px;
  }

  footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress span {
    transition: none;
  }
}
