@layer sketches {
  .page--wide {
    --page-width: 1440px;
  }

  .triage {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: var(--space-xl);
    align-items: start;
  }

  .triage .projects__milestone {
    max-width: 12rem;
  }

  .filter-rail {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    display: grid;
    align-items: start;
    gap: var(--space-lg);
    max-height: calc(100vh - var(--header-height) - var(--space-xl));
    overflow-y: auto;
    font-size: var(--text-sm);
  }

  .filter-rail__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
    font-weight: var(--weight-emphasis);
    color: var(--ink);
    border-bottom: 1px solid var(--border);
  }

  .filter-rail__clear {
    font-weight: var(--weight-emphasis);
    color: var(--blue);

    &:hover {
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }

  .filter-rail__field {
    display: grid;
    gap: var(--space-xs);
  }

  .filter-rail__label {
    font-size: var(--text-label);
    font-weight: var(--weight-emphasis);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--ink-muted);
  }

  .filter-rail__field .dropdown {
    display: flex;
  }

  .filter-rail__field .dropdown__select {
    width: 100%;
  }

  .filter-rail__facets {
    display: grid;
  }

  .filter-rail__facet {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    color: var(--ink-body);
    border-radius: var(--radius-sm);

    &:hover {
      color: var(--ink);
      background: var(--sheet-head);
    }

    &[aria-current="true"] {
      font-weight: var(--weight-emphasis);
      color: var(--ink);
      background: var(--sheet-head);
    }
  }

  .filter-rail__count {
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
  }

  @media (max-width: 1280px) {
    .triage {
      grid-template-columns: minmax(0, 1fr);
    }

    .filter-rail {
      position: static;
      grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
      gap: var(--space-md) var(--space-lg);
      max-height: none;
      overflow: visible;
    }

    .filter-rail__head {
      grid-column: 1 / -1;
    }
  }
}
