@layer components {
  /* ===================================================
     Reference Disclosure
     Version: 4.0, Batch 4A dead-code clean-up

     • Owns the .support-disclosure* structure used by the live scholarly
       reference system (reference-section.njk).
     • The file's earlier "Source Footer" family (.source-footer,
       .source-list and their descendants) was removed in Batch 4A —
       confirmed dead, no live template, JS or built-output reference.
     • Supports keyboard focus and reduced motion.
     =================================================== */

  /* ===================================================
     Disclosure wrapper
     =================================================== */

  :where(.support-disclosure) {
    width: 100%;
    min-width: 0;
    scroll-margin-top: var(--scroll-offset, 120px);
  }

  /* ===================================================
     Disclosure summary
     =================================================== */

  :where(.support-disclosure-summary) {
    position: relative;
    display: block;

    width: 100%;
    min-width: 0;

    padding-right:
      clamp(
        2.5rem,
        7vw,
        var(--space-lg, 3rem)
      );

    cursor: pointer;
    list-style: none;

    overflow-wrap: anywhere;
  }

  :where(.support-disclosure-summary)::-webkit-details-marker {
    display: none;
  }

  :where(.support-disclosure-summary)::marker {
    content: "";
  }

  /* Expand and collapse control */

  :where(.support-disclosure-summary)::after {
    content: "+";

    position: absolute;
    top: 50%;
    right: 0;

    display: inline-grid;
    place-items: center;

    width: clamp(1.5rem, 3vw, 1.75rem);
    height: clamp(1.5rem, 3vw, 1.75rem);

    border:
      1px solid
      color-mix(
        in srgb,
        var(--text-accent) 45%,
        transparent
      );

    border-radius: 999px;

    background: transparent;
    color: var(--text-accent);

    font-family: var(--font-display);

    font-size:
      clamp(
        0.9rem,
        1.5vw,
        var(--font-size-base, 1rem)
      );

    font-weight: var(--type-weight-semibold, 600);
    line-height: 1;

    transform: translateY(-50%);

    transition:
      border-color 0.2s ease,
      color 0.2s ease,
      background-color 0.2s ease,
      transform 0.2s ease;
  }

  :where(.support-disclosure[open])
  > :where(.support-disclosure-summary)::after {
    content: "−";

    color: var(--highlight);

    border-color:
      color-mix(
        in srgb,
        var(--highlight) 55%,
        transparent
      );

    background:
      color-mix(
        in srgb,
        var(--highlight) 10%,
        transparent
      );
  }

  :where(.support-disclosure-summary:hover)::after,
  :where(.support-disclosure-summary:focus-visible)::after {
    color: var(--highlight);

    border-color:
      color-mix(
        in srgb,
        var(--highlight) 55%,
        transparent
      );
  }

  :where(.support-disclosure-summary:focus-visible) {
    outline:
      2px solid
      var(--highlight);

    outline-offset: 0.35rem;

    border-radius:
      var(
        --border-radius-base,
        0.75rem
      );
  }

  /* ===================================================
     Summary heading
     =================================================== */

  :where(.support-disclosure-summary)
  :where(.section-heading) {
    margin-bottom: 0;
    padding-right: var(--space-sm, 1rem);
  }

  /* ===================================================
     Disclosure body
     =================================================== */

  :where(.support-disclosure-body) {
    min-width: 0;

    margin-top:
      clamp(
        1rem,
        3vw,
        var(--space-md, 1.5rem)
      );
  }

  :where(.support-disclosure-body) > :first-child {
    margin-top: 0;
  }

  :where(.support-disclosure-body) > :last-child {
    margin-bottom: 0;
  }

  /* ===================================================
     Linked source targets
     =================================================== */

  :where(.support-disclosure) :target {
    scroll-margin-top: var(--scroll-offset, 120px);
  }

  :where(.support-disclosure li:target) {
    margin-inline: -0.5rem;
    padding: 0.35rem 0.5rem;

    border-radius:
      var(
        --border-radius-base,
        0.75rem
      );

    background:
      color-mix(
        in srgb,
        var(--highlight) 12%,
        transparent
      );
  }

  /* Batch 4A: removed the confirmed-dead "Source footer" / "Source
     heading" / "Source list" / "Source links" / "Disclaimer" rules that
     used to live here, all scoped under :where(.source-footer). Neither
     .source-footer nor .source-list has any live template, JS or
     built-output reference anywhere in the repository — the site's actual
     scholarly reference system (reference-section.njk) renders through
     .support-disclosure* (above) and .list-emoji/.section-heading
     (elsewhere), not through this file's .source-footer rules. */

  /* ===================================================
     Mobile responsiveness
     =================================================== */

  @media (max-width: 768px) {
    :where(.support-disclosure-summary) {
      padding-right: 2.4rem;
    }

    :where(.support-disclosure-summary)::after {
      width: 1.5rem;
      height: 1.5rem;
      font-size: 0.9rem;
    }

    :where(.support-disclosure-body) {
      margin-top: var(--space-sm, 1rem);
    }
  }

  /* ===================================================
     Narrow mobile responsiveness
     =================================================== */

  @media (max-width: 420px) {
    :where(.support-disclosure-summary) {
      padding-right: 2.1rem;
    }

    :where(.support-disclosure-summary)::after {
      right: 0;
      width: 1.4rem;
      height: 1.4rem;
    }
  }

  /* ===================================================
     Reduced motion
     =================================================== */

  @media (prefers-reduced-motion: reduce) {
    :where(.support-disclosure-summary)::after {
      transition: none;
    }
  }
}
