thead th {
  text-align: left;
  background: grey;
  color: white;
}

tr td:first-child {
  background: lightgrey;
}

th,
td {
  border: 1px solid var(--md-typeset-table-color);
  border-spacing: 0;
  border-bottom: none;
  border-left: none;
  border-top: none;
}

.md-typeset__table {
  line-height: 1;
}

.md-typeset__table table:not([class]) th {
  padding: 9px;
}

/* light mode alternating table bg colors */
.md-typeset__table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

/* dark mode alternating table bg colors */
[data-md-color-scheme="slate"] .md-typeset__table tr:nth-child(2n) {
  background-color: hsla(var(--md-hue), 25%, 25%, 1);
}

/* dark mode alternating table bg colors */
[data-md-color-scheme="slate"] .md-typeset__table tr td:first-child {
  background-color: hsla(var(--md-hue), 25%, 25%, 1);
}

/* dark mode table header bg colors */
[data-md-color-scheme="slate"] .md-typeset__table thead th {
  text-align: left;
  background-color: hsla(var(--md-hue), 50%, 50%, 2);
  color: white;
}

img[alt$=">"] {
  float: right;
}

img[alt$="<"] {
  float: left;
}

img[alt$="><"] {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
  float: none !important;
}

/* Base style for all chips (span or link) */
.md-typeset .md-tag {
  border-radius: 9999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.8em;
  font-weight: 500;
  border: none;
}

/* Remove the leading “#” icon Material adds on md-tag-icon */
.md-typeset .md-tag.md-tag-icon::before {
  content: none !important;
}

/* Color rules – work for both <span data-tag="…"> and <a href="#…"> */
.md-typeset .md-tag[data-tag="beginner"],
.md-typeset .md-tag[href*="#beginner"] {
  background-color: #c8e6c9 !important;
  color: #1b5e20 !important;
}

.md-typeset .md-tag[data-tag="advanced"],
.md-typeset .md-tag[href*="#advanced"] {
  background-color: #fff9c4 !important;
  color: #665c00 !important;
}

.md-typeset .md-tag[data-tag="expert"],
.md-typeset .md-tag[href*="#expert"] {
  background-color: #ffcdd2 !important;
  color: #b71c1c !important;
}

/* (Optional) Slightly larger chips on the /tags/ index */
.md-content .md-typeset .md-tag {
  padding: 0.2rem 0.6rem;
  font-size: 0.85em;
}

/* Subject index ----------------------------------------------------------- */

.subject-index-letters {
  margin: 1.5rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 2;
  word-spacing: 0.35rem;
}

.subject-index > h2 {
  margin-top: 1.8rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.subject-index > ul {
  margin-bottom: 1.25rem;
}

.subject-index > ul > li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.subject-index > ul > li > ul {
  margin-top: 0.1rem;
}

.subject-index .index-range-end {
  display: none;
}

@media print {
  .subject-index-letters {
    display: none;
  }

  .subject-index {
    column-count: 2;
    column-gap: 0.35in;
    font-size: 10pt;
    line-height: 1.25;
  }

  .subject-index > h2 {
    break-after: avoid;
    margin: 0.8rem 0 0.25rem;
    border: 0;
    font-size: 18pt;
  }

  .subject-index > ul {
    break-before: avoid;
    margin-top: 0;
  }

  .subject-index a.index-target::after {
    content: " " target-counter(attr(href url), page);
    color: var(--md-default-fg-color);
    text-decoration: none;
  }

  .subject-index a.index-range-end {
    display: inline;
    font-size: 0;
    text-decoration: none;
  }

  .subject-index a.index-range-end::before {
    content: "-";
    font-size: 10pt;
  }

  .subject-index a.index-range-end::after {
    content: target-counter(attr(href url), page);
    font-size: 10pt;
    color: var(--md-default-fg-color);
  }
}
