.hc-card-library-settings,
.hc-technical-heading {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px solid currentColor;
}

.hc-card-library-settings h3,
.hc-technical-heading h3 {
  margin: 0 0 12px;
}

.hc-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.hc-count-box {
  border: 2px solid currentColor;
  padding: 12px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hc-count-box strong {
  font-size: 28px;
  line-height: 1;
}

.hc-count-box span {
  font-weight: 800;
  margin-top: 7px;
}

.hc-count-box small {
  margin-top: 5px;
  opacity: .72;
}

.hc-browse-cards {
  width: 100%;
  margin-top: 4px;
}

.hc-readonly-note {
  margin-bottom: 0;
}

body.hc-catalog-open {
  overflow: hidden;
}

.hc-catalog-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, .76);
  display: grid;
  place-items: center;
  padding: 16px;
}

.hc-catalog-dialog {
  width: min(900px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: #f6f6f6;
  color: #111;
  border: 3px solid #111;
  box-shadow: 8px 8px 0 #111;
  padding: 18px;
}

.hc-catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: -18px;
  z-index: 2;
  background: #f6f6f6;
  padding: 18px 0 12px;
  border-bottom: 2px solid #111;
}

.hc-catalog-header h2 {
  margin: 0;
  font-size: 34px;
}

.hc-catalog-header p {
  margin: 4px 0 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}

.hc-close-catalog {
  min-width: 48px;
  min-height: 48px;
  padding: 4px 12px;
  font-size: 32px;
  line-height: 1;
}

.hc-catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.hc-catalog-controls label {
  margin: 8px 0;
}

.hc-catalog-summary {
  font-weight: 800;
  margin: 8px 0 14px;
}

.hc-catalog-list {
  display: grid;
  gap: 10px;
}

.hc-catalog-card {
  border: 2px solid #111;
  padding: 14px;
  background: #fff;
  color: #111;
}

.hc-catalog-card.hc-black {
  background: #111;
  color: #fff;
}

.hc-catalog-card p {
  margin: 10px 0 0;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-wrap;
}

.hc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hc-card-meta span {
  border: 1px solid currentColor;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
}

.hc-card-tech {
  font-style: italic;
}

.hc-card-source {
  opacity: .72;
}

.hc-catalog-empty {
  padding: 24px 4px;
  font-weight: 800;
}

.hc-catalog-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #111;
}

.hc-catalog-pager button:last-child {
  justify-self: stretch;
}

.hc-page-label {
  font-weight: 900;
  text-align: center;
  min-width: 110px;
}

@media (max-width: 640px) {
  .hc-count-grid {
    grid-template-columns: 1fr;
  }

  .hc-count-box {
    min-height: 74px;
  }

  .hc-catalog-overlay {
    padding: 0;
  }

  .hc-catalog-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    box-shadow: none;
    padding: 14px;
  }

  .hc-catalog-header {
    top: -14px;
    padding-top: 14px;
  }

  .hc-catalog-controls {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hc-catalog-pager {
    grid-template-columns: 1fr 1fr;
  }

  .hc-page-label {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}
