.bestiary-category-index {
  display: grid;
  grid-template-columns: repeat(var(--bestiary-index-columns, 2), minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 2rem;
}

.bestiary-index-column ul {
  padding-left: 1.5rem;
}

.bestiary-index-title {
  margin: 0 0 0.6rem;
  font-size: 1.08em;
  font-weight: bold;
}

.bestiary-index-column li {
  break-inside: avoid;
  margin-bottom: 0.4rem;
}

.bestiary-index-group > a {
  font-weight: bold;
}

.bestiary-index-group > ul {
  margin-top: 0.45rem;
}

.guard-bestiary-index {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guard-bestiary-index > .bestiary-index-column:first-child {
  grid-column: 1 / 3;
  grid-row: 1;
}

.guard-bestiary-index > .bestiary-index-column:first-child > ul {
  column-count: 2;
  column-gap: 1.5rem;
}

.guard-bestiary-index > .bestiary-index-column:last-child {
  grid-column: 3;
  grid-row: 1;
}

.guard-bestiary-index > .bestiary-index-technique {
  grid-column: 1 / -1;
  grid-row: 2;
}

.guard-bestiary-index > .bestiary-index-technique > ul {
  column-count: 3;
  column-gap: 1.5rem;
  padding-left: 0;
  list-style: none;
}

.guard-bestiary-index .bestiary-index-group {
  break-inside: avoid;
  margin-bottom: 1.2rem;
}

.guard-bestiary-index .bestiary-index-group > ul {
  padding-left: 1.25rem;
}

.vehicle-category-heading {
  margin: 2.5rem 0 0.75rem;
  color: var(--heading-color);
  font-size: 1.5em;
  font-weight: bold;
}

.vehicle-profile-table {
  margin-bottom: 1rem;
}

.vehicle-profile .vehicle-rule-table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

.vehicle-profile .vehicle-rule-table th,
.vehicle-profile .vehicle-rule-table td {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.vehicle-profile .vehicle-rule-table th {
  background: var(--table-header-bg);
  color: var(--table-header-color);
}

.vehicle-weapon-note,
.weapon-note td {
  color: var(--text-color);
}

.bestiary-profile {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.bestiary-weapon-grid,
.vehicle-weapons.bestiary-weapon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: start;
}

.bestiary-weapon-grid > table,
.vehicle-weapons.bestiary-weapon-grid > table {
  width: 100%;
  margin: 0;
}

.bestiary-weapon-grid > p,
.vehicle-weapons.bestiary-weapon-grid > p {
  grid-column: 1 / -1;
}

.bestiary-profile .profile-skills td {
  vertical-align: top;
  font-weight: normal;
  overflow-wrap: anywhere;
}

.bestiary-profile .profile-skills p {
  margin: 0.3rem 0;
}

.bestiary-profile .hit-scheme {
  margin: 20px 0;
  overflow-x: auto;
  color: var(--text-color);
  font-family: "Courier New", monospace;
  line-height: 1.2;
  white-space: pre;
}

@media (max-width: 760px) {
  .bestiary-category-index,
  .bestiary-weapon-grid,
  .vehicle-weapons.bestiary-weapon-grid {
    grid-template-columns: 1fr;
  }

  .guard-bestiary-index > .bestiary-index-column:first-child,
  .guard-bestiary-index > .bestiary-index-column:last-child,
  .guard-bestiary-index > .bestiary-index-technique {
    grid-column: auto;
    grid-row: auto;
  }

  .guard-bestiary-index > .bestiary-index-column:first-child > ul {
    column-count: 1;
  }

  .guard-bestiary-index > .bestiary-index-technique > ul {
    column-count: 1;
  }
}
