/* Shared by the software catalogue, product pages and MyBB announcements. */
.sx-download-count {
  --sx-count-ink: #33281f;
  --sx-count-label: #635244;
  --sx-count-accent: #934a12;
  --sx-count-line: #d8c4b0;
  --sx-count-wash: #f9eee1;
  --sx-count-surface: #fbf9f5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .16rem .5rem;
  inline-size: fit-content;
  max-inline-size: 100%;
  min-block-size: 2rem;
  box-sizing: border-box;
  margin-block: .65rem;
  padding: .24rem .65rem;
  border: 1px solid var(--sx-count-line);
  border-radius: .5rem;
  background: linear-gradient(128deg, var(--sx-count-wash), var(--sx-count-surface) 70%);
  box-shadow: inset 0 1px 0 #ffffff28, 0 1px 2px #17120b14;
  color: var(--sx-count-ink);
  font: 500 .8125rem/1.35 var(--body, system-ui, sans-serif);
}

:is(html[data-theme="dark"], html[data-sx-theme="dark"], html.sx-community-dark:not([data-sx-theme])) .sx-download-count,
.sr-hero .sx-download-count {
  --sx-count-ink: #fff1df;
  --sx-count-label: #ddcabe;
  --sx-count-accent: #f2b57a;
  --sx-count-line: #695042;
  --sx-count-wash: #392a23;
  --sx-count-surface: #272221;
}

.sx-download-count::before {
  content: "";
  inline-size: .63rem;
  block-size: .7rem;
  flex: 0 0 auto;
  background: var(--sx-count-accent);
  clip-path: polygon(43% 0, 57% 0, 57% 43%, 75% 25%, 85% 35%, 50% 70%, 15% 35%, 25% 25%, 43% 43%, 43% 0, 0 0, 0 85%, 100% 85%, 100% 100%, 0 100%, 0 0);
}

.sx-download-count__label {
  color: var(--sx-count-label);
  font-size: .75rem;
  font-weight: 550;
}

.sx-download-count__value,
.sx-download-count__status {
  padding-inline-start: .52rem;
  border-inline-start: 1px solid var(--sx-count-line);
  color: var(--sx-count-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sx-download-count__value {
  min-inline-size: 2.3ch;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.sx-download-count__since {
  color: var(--sx-count-label);
  font-size: .6875rem;
  white-space: nowrap;
}

.sx-download-count[data-sx-download-state="stale"] .sx-download-count__value,
.sx-download-count[data-sx-download-state="unavailable"] .sx-download-count__value {
  color: var(--sx-count-label);
}

@media (forced-colors: active) {
  .sx-download-count,
  .sx-download-count__value,
  .sx-download-count__status,
  .sx-download-count__since {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .sx-download-count::before {
    background: CanvasText;
    forced-color-adjust: none;
  }
}
