:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --line: #d9d9d9;
  --accent: #0b57d0;
  --accent-fg: #ffffff;
  --row-alt: #f6f6f6;
  --focus: #ffbf47;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #b42318;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --fg: #e8e8e8;
    --muted: #a0a0a0;
    --line: #33363b;
    --accent: #7cacf8;
    --accent-fg: #0b1020;
    --row-alt: #18191c;
    --ok: #57ab5a;
    --warn: #c69026;
    --bad: #f47067;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--fg);
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  /* File paths and URLs have no spaces to break at. */
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.site-header h1 a {
  color: inherit;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 1rem;
}

.site-header nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

main {
  flex: 1;
  /* A flex item defaults to min-width:auto, which lets a wide table stretch its
     parent instead of scrolling inside .table-wrap. */
  min-width: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.lede {
  color: var(--muted);
  max-width: 70ch;
  overflow-wrap: anywhere;
}

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin: 1rem 0;
  max-width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field.grow {
  flex: 1 1 14rem;
}

.field.check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  color: var(--muted);
}

input,
select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  min-width: 9rem;
  max-width: 100%;
  /* iOS zooms the page when a control's text is under 16px. */
  font-size: max(1rem, 16px);
}

input[type="checkbox"] {
  min-width: 0;
  width: 1.1rem;
  height: 1.1rem;
}

.status {
  font-size: 0.875rem;
  color: var(--muted);
  min-height: 1.4em;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  /* Momentum scrolling on touch, and a hint that there is more to the right. */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th.num,
td.num {
  text-align: right;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-weight: 600;
}

thead button {
  all: unset;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.1rem 0;
}

thead button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

thead th[aria-sort="ascending"] button::after {
  content: " ▲";
  font-size: 0.7em;
}

thead th[aria-sort="descending"] button::after {
  content: " ▼";
  font-size: 0.7em;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

td.model {
  white-space: normal;
  min-width: 14rem;
}

td.model .id {
  display: block;
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8em;
  border: 1px solid currentColor;
}

.badge.available {
  color: var(--ok);
}

.badge.announced {
  color: var(--accent);
}

.badge.deprecated {
  color: var(--warn);
}

.badge.retired {
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  th,
  td {
    padding: 0.4rem 0.5rem;
  }

  .site-header {
    padding: 0.75rem 1rem;
  }

  main {
    padding: 0.75rem 1rem 1.5rem;
  }

  .field.grow {
    flex-basis: 100%;
  }

  /* Fingertip-sized sort targets. */
  thead button {
    padding: 0.35rem 0;
  }
}
