body[data-guide] [hidden] { display: none !important; }

body[data-guide] .site-intro-copy { margin: 8px 0 12px; text-align: left; }

.guide-section { scroll-margin-top: 1rem; }
.guide-section > h2 { margin: 0 0 .75rem; color: var(--accent); font-size: 1.2rem; }
.guide-section h3 { font-size: 1rem; }
.guide-section p { margin: .6rem 0; }
.guide-section li + li { margin-top: .45em; }
.guide-section ol, .guide-section ul { padding-inline-start: 1.45em; }

.guide-toc ul, .guide-related ul {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-toc a, .guide-related a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--accent);
  text-underline-offset: .17em;
}

.guide-catalog { container-type: inline-size; }

.guide-catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: end;
  gap: .5rem .75rem;
  margin-bottom: .5rem;
}

.guide-catalog-controls > * { min-width: 0; }
.guide-catalog-controls > :only-child { grid-column: 1 / -1; }
.guide-catalog-controls input, .guide-catalog-controls select { width: 100%; }
.guide-search-field { display: grid; gap: 4px; }
.guide-search-field label { color: var(--brand); font-size: .78rem; font-weight: 900; line-height: 1.2; }
.guide-table-wrap { border-color: var(--brand-light); }
.guide-table { min-width: 0; table-layout: auto; }
.guide-table :is(th, td):nth-child(n) { width: auto; }
.guide-table thead th { background: var(--bg-color); border-color: var(--brand-light); white-space: nowrap; }
.guide-table thead th > span { display: block; padding: .65rem; }
.guide-table tbody th, .guide-table tbody td {
  padding: .63rem;
  border-bottom: 1px solid var(--brand-light);
  text-align: left;
  vertical-align: top;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.guide-table tbody th { min-width: 8.25em; color: var(--accent); font-weight: 800; }
.guide-table tbody tr:last-child > * { border-bottom: 0; }
.guide-table .character-sort-button { min-height: 2.75rem; }
.guide-table .character-sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.guide-cell-label { display: none; }
.guide-empty { color: var(--text-muted); }

@container (max-width: 640px) {
  .guide-catalog-controls { grid-template-columns: minmax(0, 1fr); }
  .guide-table-wrap { overflow: visible; border: 0; background: transparent; }
  .guide-table, .guide-table thead, .guide-table tbody { display: block; }
  .guide-table thead tr { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .5rem; }
  .guide-table thead th { flex: 1 1 auto; background: white; border: 1px solid var(--brand-light); border-radius: .5rem; white-space: normal; }
  .guide-table tbody tr {
    display: grid;
    gap: .2rem;
    margin-bottom: .5rem;
    padding: .65rem;
    border: 1px solid var(--brand-light);
    border-radius: .7rem;
    background: white;
  }
  .guide-table tbody th, .guide-table tbody td { padding: 0; border: 0; min-width: 0; }
  .guide-table tbody td { display: grid; grid-template-columns: minmax(4em, auto) minmax(0, 1fr); gap: .5rem; }
  .guide-table tbody .guide-cell-blank { display: none; }
  .guide-cell-label { display: inline; color: var(--text-muted); font-size: .82rem; font-weight: 700; }
}
