/* Keep keyboard focus and fragment navigation in sync. */
html { scroll-behavior: auto; }

.therapy-intro {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.therapy-intro section {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
}

.therapy-intro h2 { font-size: 1.25rem; margin: 0; }
.therapy-intro :is(ul, ol) { margin: .75rem 0 0; padding-inline-start: 1.5rem; }
.therapy-intro li + li { margin-block-start: .5rem; }
.therapy-detail .article-table caption { text-align: start; font-weight: 700; padding-block: .5rem; }
.therapy-detail .article-table tbody th { text-align: start; }
.therapy-detail [id] { scroll-margin-top: var(--anchor-offset); }
.therapy-sources li { overflow-wrap: anywhere; margin-block-end: .5rem; }

@media (max-width: 820px) {
  .therapy-intro { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

@media screen and (max-width: 900px) {
  .therapy-intro {
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .therapy-detail .article-table :is(th, td, caption) {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .therapy-detail .table-scroll { container-type: inline-size; }
  .therapy-detail .article-table caption {
    inline-size: 100cqi;
    position: sticky;
    inset-inline-start: 0;
  }

  /* Two-column tables fit the article width without squeezing the row labels. */
  .therapy-detail .article-table:has(> thead > tr > th:nth-child(2):last-child) {
    min-width: 0;
    table-layout: fixed;
  }

  .therapy-detail .article-table:has(> thead > tr > th:nth-child(2):last-child) thead th:first-child {
    width: 34%;
  }

  .therapy-detail .article-table:has(> thead > tr > th:nth-child(2):last-child) :is(th, td) {
    padding: .65rem .55rem;
  }
}
