.notation-comparison {
  margin: 1.4em -4% 1.8em;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0.85em;
  row-gap: 0;
}

.notation-comparison__head {
  display: none;
}

.notation-comparison__cell {
  padding: 0.4em 0.95em;
  border: 1px solid #decebc;
  border-radius: 10px;
  background: #fffaf5cc;
  box-shadow: 0 0.1em 0.2em #00000010;

  &::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.7em;
  }

  .katex-display {
    margin: 0;
    padding: 0.5em 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }
}

.notation-comparison__head,
.notation-comparison__cell::before {
  font-family: "Vermiglione", serif;
  font-size: 1rem;
  font-weight: 500;
  color: #88593a;
}

.notation-comparison__bridge {
  grid-column: 1 / -1;
  margin-top: 0.55em;
  padding: 0.5em 0;
  text-align: center;
  font-family: "Vermiglione", serif;
  font-size: 1rem;
  color: #6e4d34;

  /* First one or two equations following a bridge line. */
  & + .notation-comparison__cell,
  & + .notation-comparison__cell + .notation-comparison__cell {
    margin-top: 0.55em;
  }
}

/* Mobile: single column, per-cell label shown via ::before. */
@media (max-width: 819.98px) {
  .notation-comparison__cell + .notation-comparison__cell {
    margin-top: 0.55em;
  }
}

/* Desktop: two columns with a shared header row. */
@media (min-width: 820px) {
  .notation-comparison {
    margin-inline: -6%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notation-comparison__head {
    display: block;
    text-align: center;
    margin-bottom: 0.15em;
  }

  .notation-comparison__cell {
    &::before {
      display: none;
    }

    .katex-display {
      font-size: 0.88em;
    }
  }

  .notation-comparison__bridge {
    max-width: 34em;
    margin-inline: auto;
  }
}
