.guide-section,
.guide-topic {
  min-width: 0;
  overflow-wrap: anywhere;
  scroll-margin-top: 1rem;
}

.guide-section > :last-child {
  margin-bottom: 0;
}

.guide-section h3 {
  margin-top: 1.4rem;
}

.guide-topic + .guide-topic {
  margin-top: 1.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line, #d1d7dd);
}

.guide-topic > :first-child {
  margin-top: 0;
}

.guide-section li + li {
  margin-top: 0.45rem;
}

.guide-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.875rem;
  margin-block: 0.75rem 1.1rem;
}

.guide-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.guide-chapters li > p {
  margin-block: 0.25rem 0.85rem;
}

.guide-definitions {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr);
  gap: 0.55rem 1rem;
  margin-block: 0.875rem;
}

.guide-definitions dt {
  font-weight: 700;
}

.guide-definitions dd {
  margin: 0;
}

.guide-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.55rem 0.9rem;
  margin-block: 0.75rem;
}

.guide-filters[hidden],
.guide-table-scroll[hidden],
.guide-table tr[hidden] {
  display: none;
}

.guide-filters label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.22rem;
}

.guide-filters input,
.guide-filters select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.45rem 0.7rem;
  color: inherit;
  background: var(--surface, Canvas);
  border: 1px solid var(--line, #838a92);
  border-radius: 0.35rem;
  font: inherit;
}

.guide-count {
  grid-column: 1 / -1;
  margin: 0;
}

.guide-table-scroll {
  overflow: auto;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
}

.guide-table :is(th, td) {
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line, #d1d7dd);
  word-break: normal;
  overflow-wrap: anywhere;
}

.guide-table thead th {
  color: var(--accent);
}

.guide-table tbody th {
  width: 24%;
}

.guide-cell-label {
  display: none;
}

.guide-secondary-name {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
}

.guide-condition-note {
  display: inline-block;
}

@media (min-width: 601px) {
  #editions .guide-definitions {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  }

  #editions .guide-edition-format {
    white-space: nowrap;
  }

  #miracle .guide-table tbody th {
    width: 17%;
  }

  #miracle .guide-table thead th:nth-child(2) {
    width: 26%;
  }

  #missions .guide-table tbody th {
    width: 29%;
  }

  #missions .guide-table thead th:nth-child(2) {
    width: 8em;
  }
}

@media (max-width: 600px) {
  .guide-definitions {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .guide-definitions dd + dt {
    margin-top: 0.6rem;
  }

  .guide-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .guide-table tbody {
    display: grid;
    gap: 0.65rem;
  }

  .guide-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.45rem 0.65rem;
    padding: 0.7rem;
    border: 1px solid var(--line, #d1d7dd);
    border-radius: 0.4rem;
  }

  .guide-table tbody :is(th, td) {
    width: auto;
    padding: 0;
    border: 0;
  }

  .guide-table tbody th,
  .guide-table tbody td:last-child {
    grid-column: 1 / -1;
  }

  .guide-table [data-label="選手一覧"] {
    grid-column: auto;
  }

  #miracle .guide-table [data-label="ムーブ名"] {
    line-break: strict;
  }

  .guide-cell-label {
    display: block;
    color: var(--accent);
    font-size: 0.8em;
    font-weight: 700;
  }

  .guide-table [data-label="選手一覧"] .guide-cell-label {
    display: none;
  }

  .guide-table-scroll {
    margin: 0;
  }
}
