.lt-wrap { overflow-x: auto; }
.lt-table {
  --bg: 4px solid transparent;
  --bd: 1.5px solid #888;

  th, td{ padding: 5px; }
  border-collapse: separate;
  caption-side: top;
  margin: 1em auto;
  border-spacing: 0;
  border-top: var(--bd);
  border-bottom: var(--bd);

  caption {
    padding: .5em; text-align: center; border-top: var(--bd);
    .lt-title    { font-size: 1.2em; }
    .lt-subtitle { font-size: 0.9em; }
  }

  th { font-weight: normal; }
  tbody {
    :not(:last-child) :is(td, th) { border-bottom: 1px   solid #ddd; }
    .lt-row-group :is(td, th)     { border-bottom: 1.5px solid #ddd; }
    .lt-row-group {
      text-align: left;
      &.lt-row-open { border-bottom-color: transparent; }
    }
    /* the last group's cell ends the body: no separator above the footer */
    tr:not(:has(~ tr th.lt-row-group)) th.lt-row-group { border-bottom: none; }
  }
  thead th {
    border-bottom: 1px solid #888;
    &:not(:first-child) { border-left: var(--bg); }
    &:not(:last-child) { border-right: var(--bg); }
  }
  /* the whole header (spanners, labels, controls) stays in view when .lt-wrap
   * scrolls; opaque background hides scrolled content */
  thead { position: sticky; top: 0; z-index: 2; background: Canvas; }
  .lt-type {
    font-size: 0.8em;
    opacity: 0.6;
  }
  .lt-indent { padding-left: 1em; }
  .lt-spanner-row {
    .lt-spanner       { border-bottom: 1px solid #bbb; text-align: center; }
    .lt-spanner-empty { border-bottom: none; }
  }

  .lt-summary { font-weight: bold; }
  .lt-footer {
    .lt-summary :is(td, th) { border-top: 1px solid #888; }
    .lt-footnote:not(.lt-footnote + *) td { border-top: 1px solid #aaa; }
    .lt-source-note:first-child td { border-top: 1px dashed #aaa; }
    .lt-source-note { font-style: italic; }
  }
  .lt-footnote, .lt-source-note, .lti-pager-row { font-size: 0.85em; }

  .al-r { text-align: right; }
  .al-c { text-align: center; }

  .lt-fnref {
    color: #06c;
    &::before { content: "\00a0["; }
    &::after  { content: "]"; }
  }
}
.lt-raw [title]::after {
  content: " (" attr(title) ")";
  background: lightyellow;
  font-size: 0.85em;
}
