@layer components {
  .main-content:has(.feature-matrix-page) {
    min-width: 0;
  }
  .feature-matrix .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .matrix-subtitle {
    color: var(--color-text-muted);
    margin: 8px 0 0;
  }
  .matrix-context {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
  }
  .matrix-context p {
    margin: 0;
  }
  .matrix-context p:last-child {
    white-space: nowrap;
  }
  .matrix-scroll {
    overflow: auto;
    max-height: 60vh;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    scrollbar-color: var(--color-gray-400) var(--color-gray-100);
  }
  .feature-matrix {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
    min-width: 1040px;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
  }
  .feature-matrix th,
  .feature-matrix td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
  }
  .feature-matrix tbody th,
  .feature-matrix tbody td {
    padding-block: 8px;
  }
  .feature-matrix thead {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .feature-matrix thead th {
    background: var(--color-gray-50);
    font-size: 0.8125rem;
    font-weight: 500;
  }
  .feature-matrix tr > :first-child {
    position: sticky;
    left: 0;
    text-align: left;
    width: 220px;
    border-right: 1px solid var(--color-border);
    z-index: 1;
  }
  .feature-matrix tbody th {
    background: white;
    font-weight: 500;
    overflow-wrap: anywhere;
  }
  .feature-matrix tbody tr:last-child > * {
    border-bottom: 0;
  }
  .feature-matrix .matrix-totals > * {
    background: var(--color-gray-100);
  }
  .matrix-totals th > span,
  .matrix-account-id {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 5px;
  }
  .matrix-totals a {
    display: block;
    color: var(--color-text);
    border-radius: 4px;
  }
  .matrix-totals strong {
    font-size: 1.125rem;
    font-weight: 600;
  }
  .matrix-denominator {
    color: var(--color-text-muted);
    font-weight: 400;
  }
  .matrix-percentage {
    display: block;
    font-size: 0.75rem;
    margin-top: 5px;
    color: var(--color-text-muted);
  }
  .matrix-status {
    display: inline-block;
    font-style: normal;
    font-size: 1.125rem;
    color: var(--color-text-muted);
  }

  .feature-matrix .matrix-empty {
    position: static;
    text-align: center;
    padding: 48px 24px;
  }
  .matrix-empty p {
    color: var(--color-text-muted);
    margin: 8px 0;
  }
  .feature-matrix-page :focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 3px;
  }
  @media (hover: hover) {
    .feature-matrix tbody tr:hover > * {
      background: var(--color-gray-50);
    }
    .matrix-totals a:hover {
      background: var(--color-gray-200);
    }
  }
  @media (max-width: 768px) {
    .feature-matrix-page
      .multi-select-filter:last-of-type
      .multi-select-filter__panel {
      left: 0;
      right: auto;
    }
    .matrix-context {
      flex-direction: column;
      gap: 8px;
    }
    .feature-matrix tr > :first-child {
      width: 160px;
    }
  }
}
