.history-document {
  scroll-padding-top: var(--history-clock-clearance, 118px);
}
.history-resources {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid #45634f;
  background: #617963;
}
.history-resources button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: #263e32;
  color: #e3ebd4;
  cursor: pointer;
}
.history-resources button:hover {
  background: #355443;
}
.history-resources button:focus-visible {
  outline: 2px solid #efcc83;
  outline-offset: -3px;
}
.history-resource-meter {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px clamp(4px, 1.2vw, 14px);
  text-align: start;
}
.history-resources svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #efcc83;
}
.history-resource-body {
  flex: 1;
  min-width: 0;
  font: 700 12px/1.2 var(--body);
}
.history-resource-body strong {
  display: block;
  margin-top: 2px;
  color: #fff9e8;
  font: 700 clamp(13px, 1.6vw, 17px)/1.1 var(--mono);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.history-resource-flows {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid #617963;
}
.history-flow-line {
  display: flex;
  justify-content: space-between;
  gap: 0 4px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 400;
}
.history-flow-line small {
  font-size: inherit;
}
.history-flow-line b {
  color: #fff9e8;
  font: 700 11px/1.25 var(--mono);
  overflow-wrap: anywhere;
}
.history-resource-toggle {
  display: none;
}
.history-resource-pace,
.history-resource-funding,
.history-resource-debt {
  grid-column: 1 / -1;
  padding: 3px 8px;
  background: #263e32;
  color: #e3ebd4;
  font: 12px/1.35 var(--body);
}
.history-resource-funding {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
  color: #fff0cc;
}
.history-resource-funding span {
  white-space: nowrap;
}
.history-resource-debt {
  color: #fff0cc;
}

.campus-resource-preview {
  margin: 2px 0;
  padding: 5px 6px;
  border: 1px solid #b3c4a5;
  background: #eaf0dd;
  color: #233e30;
  overflow-wrap: anywhere;
}
.campus-resource-preview summary {
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.campus-resource-preview p {
  margin-top: 5px;
  font-size: 12px;
}
.campus-resource-preview table {
  width: 100%;
  margin-top: 5px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}
.campus-resource-preview th,
.campus-resource-preview td {
  padding: 3px 2px;
  border-top: 1px solid #b3c4a5;
  text-align: end;
}
.campus-resource-preview th:first-child {
  width: 40%;
  text-align: start;
}
.campus-resource-preview td {
  font-variant-numeric: tabular-nums;
}
.campus-resource-preview td:last-child {
  color: #203a2a;
  font-weight: 700;
}
.campus-resource-preview .button {
  margin-top: 6px;
}

@media (max-width: 650px) {
  .history-resources {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 44px;
  }
  .history-resource-meter {
    gap: 4px;
    align-items: center;
    padding: 3px 4px;
  }
  .history-resource-meter svg {
    flex-basis: 13px;
    width: 13px;
    height: 13px;
  }
  .history-resource-body {
    font-size: 11px;
  }
  .history-resource-body strong {
    font-size: 12px;
  }
  .history-resource-toggle {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1px;
    padding: 2px;
    font: 700 11px/1.2 var(--body);
  }
  .history-resource-toggle svg {
    width: 16px;
    height: 16px;
  }
  .history-resource-toggle[aria-expanded='true'] svg {
    transform: rotate(180deg);
  }
  .history-resources[data-expanded='false']
    :is(.history-resource-flows, .history-resource-pace, .history-resource-customers) {
    display: none;
  }
  .history-resources[data-expanded='true'] .history-resource-meter {
    align-items: start;
  }
  .history-resource-customers {
    grid-column: 1 / -1;
    padding: 6px 8px;
    text-align: start;
  }
  .history-resource-customers .history-resource-body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 8px;
  }
  .history-resource-customers strong {
    justify-self: end;
    margin: 0;
  }
  .history-resource-customers .history-resource-flows {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}
@media (max-width: 420px) {
  .history-resource-meter {
    justify-content: center;
    padding-inline: 2px;
    text-align: center;
  }
  .history-resource-meter svg {
    display: none;
  }
  .history-resource-body strong {
    font-size: 11px;
  }
  .history-flow-line {
    display: grid;
    justify-content: center;
  }
  .history-resource-customers {
    padding-inline: 8px;
  }
}
