main {
  max-width: 96rem;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2rem;
}

.back { margin-bottom: .65rem; }
.count, .resources { margin: .3rem 0 .65rem; font-size: .875rem; }
.muted { color: var(--muted); }

#filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .65rem .85rem;
  margin: 1.15rem 0 .65rem;
}

#filters label {
  display: grid;
  gap: .2rem;
  font-size: .875rem;
  font-weight: 700;
}

.query-field { flex: 0 1 29rem; }
input, select, button {
  min-height: 2.35rem;
  padding: .35rem .65rem;
  border: 1px solid #909e91;
  border-radius: .35rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

#filters select { min-width: 8.5rem; }
button { cursor: pointer; }
button:hover { background: #edf3eb; }
input:focus-visible, select:focus-visible, button:focus-visible, .table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: .16rem;
}

.table-wrap {
  max-height: 69vh;
  min-height: 10rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
  scroll-padding-top: 3rem;
}

table {
  width: 100%;
  min-width: 50rem;
  border-spacing: 0;
  table-layout: fixed;
  font-size: .91rem;
  line-height: 1.45;
}

.rank-col { width: 7rem; }
.status-col { width: 8.5rem; }
.vernacular-col { width: 9rem; }
.details-col { width: 5rem; }

th, td {
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
  background: #e5ece2;
  color: #193728;
  box-shadow: 0 1px var(--line);
}

tbody tr:nth-child(even) { background: #f5f7f1; }
tbody tr:hover, tbody tr:focus-within { background: #edf3eb; }
tbody tr:target { background: #e0eee0; }
tbody tr:target th { box-shadow: inset .24rem 0 var(--accent); }
.scientific { font: 1.03rem/1.35 Georgia, "Times New Roman", serif; }
.details-button { min-height: 1.8rem; padding: .12rem .55rem; color: var(--accent); }
.resources { margin-top: .7rem; }

dialog {
  width: min(38rem, calc(100% - 2rem));
  max-height: 85vh;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
  color: var(--ink);
}

dialog::backdrop { background: rgb(32 40 32 / 50%); }
.dialog-header { display: flex; gap: .85rem; justify-content: space-between; align-items: start; }
.dialog-header h2 { margin: 0; font: 1.45rem/1.35 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
dialog h3 { margin: 1rem 0 .15rem; font-size: .95rem; }
dialog p, dialog ul { margin: 0; overflow-wrap: anywhere; }
dialog ul { padding-inline-start: 1.3rem; }

@media (max-width: 36rem) {
  main { padding-top: 1rem; }
  #filters { margin-top: .7rem; }
  .query-field { flex-basis: 100%; }
  #filters select { min-width: 6.3rem; max-width: 9rem; }
  .table-wrap { max-height: 60vh; }
}

@media print {
  #filters, .details-button { display: none; }
  .table-wrap { max-height: none; overflow: visible; }
  table { min-width: 0; }
  thead th { position: static; white-space: normal; }
}
