@layer components {
  /* Base
  /* -------------------------------------------------------------------------- */

  /* A title's ISRCs below the similarity threshold, collapsed under the main
     table */
  .truffle-pig-below {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
  }

  /* Elements
  /* -------------------------------------------------------------------------- */

  /* The ISRCs heading with the All / Canonical / Potential switch at its end */
  .truffle-pig-isrcs__header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--block-space-half);
    justify-content: space-between;
  }

  .truffle-pig-below__summary {
    color: var(--color-ink-muted);
    cursor: pointer;
    font-size: var(--text-small);
    font-weight: 500;
    inline-size: fit-content;
  }

  /* Whether a source found an ISRC: a tick stands out, a cross recedes */
  .source-tick--found {
    color: var(--color-positive);
    font-weight: 600;
  }

  .source-tick--missing {
    color: var(--color-ink-muted);
  }

  /* An ISRC's kind beside it: C canonical, P potential, the word on hover */
  .isrc-kind {
    border-radius: var(--border-radius);
    cursor: help;
    display: inline-block;
    font-size: var(--text-x-small);
    font-weight: 600;
    line-height: 1;
    margin-inline-start: 0.4em;
    padding: 0.2em 0.35em;
    vertical-align: 0.1em;
  }

  .isrc-kind--canonical {
    background-color: var(--color-selected-light);
    color: var(--color-link-dark);
  }

  /* The key above the table: the badges start their phrases */
  .isrc-kind-key .isrc-kind {
    cursor: auto;
    margin-inline-start: 0;
  }

  .isrc-kind--potential {
    background-color: var(--color-surface-subtle);
    color: var(--color-ink-muted);
  }

  /* Title over artist in the one truncating column, and on an ISRC's page
     release over label: each line cuts off on its own */
  .isrc-title,
  .isrc-title__artist,
  .isrc-release,
  .isrc-release__label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* An ISRC's page has two truncating columns, recording and release: each
     asking for all the spare width, the first would take it, so they split it */
  .table:has(.isrc-release, .isrc-release__label) .table__cell--truncate {
    inline-size: 50%;
  }

  .isrc-title__artist,
  .isrc-release__label {
    color: var(--color-ink-muted);
    font-size: var(--text-small);
  }
}
