.history-page {
  width: min(760px, calc(100% - 40px));
}

.history-main {
  padding-top: 46px;
}

.history-title {
  margin-bottom: 30px;
}

.history-kicker {
  margin: 0 0 7px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.history-title h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(42px, 8vw, 70px);
  font-weight: 400;
  line-height: 1;
}

.date-picker {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.date-picker button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.date-picker button:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--ink);
}

.date-picker button:disabled {
  cursor: default;
  opacity: 0.35;
}

.date-picker button:focus-visible,
.date-field:focus-within {
  outline: 2px solid var(--active);
  outline-offset: 3px;
}

.date-picker svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-field {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.date-field input {
  width: 190px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
}

.day-overview {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.day-label {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 27px;
  line-height: 1.2;
}

.day-range {
  margin: 6px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.day-stats {
  display: flex;
  align-items: end;
  gap: 28px;
  margin: 0;
}

.day-stats div {
  text-align: right;
}

.day-stats dt {
  color: var(--faint);
  font-size: 10px;
}

.day-stats dd {
  margin: 1px 0 0;
  font-family: var(--mono);
  font-size: 18px;
}

.usage-section,
.day-timeline-section {
  padding-top: 34px;
}

.section-line {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}

.section-line h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 400;
}

.usage-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.75fr) minmax(120px, 1.5fr) 72px;
  align-items: center;
  gap: 18px;
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.usage-name {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.usage-track {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.usage-bar {
  height: 100%;
  background: var(--active);
}

.usage-count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.day-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.record-time {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.record-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.record-apps {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.history-empty {
  padding: 42px 0;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.history-skeleton {
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, var(--line));
  animation: fade 900ms ease-in-out infinite alternate;
}

@media (max-width: 560px) {
  .history-page {
    width: calc(100% - 28px);
  }

  .history-main {
    padding-top: 34px;
  }

  .day-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .day-stats {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
  }

  .day-stats div {
    text-align: left;
  }

  .usage-row {
    grid-template-columns: minmax(90px, 1fr) minmax(70px, 1fr) 62px;
    gap: 10px;
  }

  .record-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }
}
