.hexagrams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .75rem;
  padding: 0;
  list-style: none;
}
.hexagrams > li {
  border: 1px solid var(--border, #cbd3c8);
  border-radius: .65rem;
  padding: .7rem .9rem;
  background: var(--card, #fffdf7);
  scroll-margin-block-start: 1.25rem;
}
.hexagrams > li[hidden] { display: none; }
.hexagrams :is(h3, p) { margin: .35rem 0; }
.hex-summary { display: grid; grid-template-columns: 2.75rem 1fr; gap: .8rem; align-items: center; }
.hex-shape { display: grid; gap: .22rem; }
.hex-line { display: block; height: .27rem; background: currentColor; }
.hex-broken { background: linear-gradient(to right, currentColor 41%, transparent 41% 59%, currentColor 59%); }
.hex-code { display: inline-block; margin-inline-start: .4rem; font-size: .82em; white-space: nowrap; }
#hexagram-filters { margin-block: .7rem 1rem; }
#hexagram-filters[hidden] { display: none; }
.hex-side-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .55rem; }
.hex-side-fields label { display: grid; gap: .25rem; min-width: 0; }
.hex-side-fields select { min-width: 0; max-width: 100%; }
.hex-actions { align-items: center; gap: .7rem; }
.hex-actions p { margin: 0; }
.hex-matrix { width: 100%; table-layout: fixed; border-collapse: collapse; }
.hex-matrix :is(th, td) { text-align: center; padding: .15rem 0; border: 1px solid var(--border, #cbd3c8); }
.hex-matrix th span { display: block; }
.hex-matrix th span[aria-hidden] { font-size: 1.1rem; }
.hex-matrix td a { display: inline-grid; min-height: 2rem; width: 100%; place-content: center; }
.hex-matrix-label { font-size: .8rem; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .hex-matrix-label { font-size: .68rem; }
}
