/* History, about, API docs, privacy and the 404/410 pages. Loaded after app.css, which owns the tokens. */

.doc {
  max-width: 48rem;
  margin: 3rem auto 0;
}

.doc--wide {
  max-width: 62rem;
}

.doc__title {
  margin: 0 0 1rem;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--heading);
}

.doc__accent {
  color: var(--link);
}

.doc__lead {
  margin: 0 auto 2rem;
  max-width: 40rem;
  text-align: center;
  color: var(--text-muted);
}

.doc__section {
  margin-top: 2.5rem;
}

.doc__section h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.375rem;
  color: var(--heading);
}

.doc__subtitle {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
  color: var(--heading);
}

.doc__note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.doc ul {
  padding-inline-start: 1.25rem;
}

.doc li {
  margin-block: 0.5rem;
}

.doc code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  overflow-wrap: anywhere;
}

/* History */
.history {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history__item {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.history__short {
  font-size: 1.125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.history__meta {
  margin: 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
  color: var(--text-muted);
}

.history__meta-label {
  font-weight: 600;
}

.history__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.history__readonly {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.history__empty {
  margin: 2rem 0;
  text-align: center;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.button--small {
  padding: 0.3125rem 1rem;
  font-size: 0.8125rem;
}

.button--danger {
  border-color: var(--danger-text);
  color: var(--danger-text);
  background: var(--danger-bg);
}

.button--danger:hover {
  color: var(--danger-bg);
  background: var(--danger-text);
}

.button:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* About */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features__item {
  margin: 0;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.features__title {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  color: var(--heading);
}

.features__item p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

.totals__item {
  flex: 1 1 10rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.totals dt {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.totals dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--link);
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scoreboard__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scoreboard__visits {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--link);
}

.sponsor {
  display: block;
  width: 114px;
  height: 32px;
  margin-top: 0.75rem;
  border: 0;
  border-radius: 6px;
}

/* API docs */
.toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.toc li {
  margin: 0;
}

.endpoint {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.endpoint__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.method {
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--on-accent);
  background: var(--accent);
}

.method--delete {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.method--get {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
}

.table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.table th {
  font-weight: 600;
  color: var(--heading);
}

.code {
  margin: 0.5rem 0 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.doc .code code {
  padding: 0;
  background: none;
  overflow-wrap: normal;
}

/* 404 and 410 */
.result--center {
  text-align: center;
}

.result--center .result__actions {
  justify-content: center;
}

@media (max-width: 30rem) {
  .doc__title {
    font-size: 1.75rem;
  }

  .endpoint {
    padding: 1rem;
  }
}
