#game-market-people-view {
  width: 100%;
  max-width: 44rem;
  height: min(64rem, var(--app-sheet-height));
  cursor: default;

  @media (width >= 680px) and (height >= 620px) {
    &:not([hidden]) {
      border-radius: var(--sheet-border-radius);
      --viewkit-sheet-offset-y: var(--viewkit-sheet-centered-offset-y);
    }
  }

  &, & * {
    -webkit-user-select: none;
    user-select: none;
  }

  :not(input, textarea) {
    cursor: default;
  }

  input {
    -webkit-user-select: text;
    user-select: text;
  }

  button:focus-visible:not([data-menu-hide-focus-ring]) {
    outline: 2px solid var(--color-blue);
    outline-offset: -2px;
  }

  &:has(> [purpose="tablist"] > .transactions[selected]) > header > :is(.people-options, [action="compose-mail"]) {
    visibility: hidden;
  }

  .people-filter-select {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0.4rem 0.8rem;
    min-height: 3.6rem;
    border-bottom: var(--toolbar-border);
    font-size: 1.3rem;

    select {
      width: 10.4rem;
      height: 2.6rem;
      min-height: 0;
      padding-inline: 0.8rem 2.4rem;
      font-size: inherit;
      background: var(--viewkit-light-background);
    }

    &::after {
      content: "";
      position: absolute;
      inset-inline-end: 1.4rem;
      top: 50%;
      translate: 0 -70%;
      rotate: 45deg;
      width: 0.6rem;
      height: 0.6rem;
      border-right: 1.5px solid var(--color-gray);
      border-bottom: 1.5px solid var(--color-gray);
      pointer-events: none;
    }
  }

  #people-list-options {
    [data-filter-all]:disabled { color: var(--color-gray); }

    [data-filter-options] > [data-group] + [data-group] {
      border-top: var(--toolbar-border);
    }
  }

  > #people-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .people-list {
    overflow-y: auto;
    /* WebKit scrollbar paint-order workaround: https://bugs.webkit.org/show_bug.cgi?id=273638 */
    will-change: z-index;
  }

  .groups {
    --ruled-row-height: calc(5.2rem + 1px);
    min-height: 100%;

    &:has(> .empty) {
      display: grid;
      place-items: center;
    }

    &:has(> .people-empty) {
      display: grid;
      grid-template-rows: auto 1fr;
    }

    &:has(> .empty, > .people-empty)::after { display: none; }

    ul {
      list-style: none;
      overflow: hidden;
    }

    .pinned {
      position: sticky;
      top: 0;
      z-index: 1;
      background: var(--viewkit-light-background);

      &:has(+ ul, + .people-empty) {
        border-bottom: 0.8rem solid oklch(from var(--toolbar-background-color) 0.92 c h);
      }
    }

    li {
      display: flex;
      align-items: center;
      min-width: 0;

      &:has(.person[aria-pressed="true"]) {
        background: var(--toolbar-background-color);
      }

      + li {
        border-top: 1px solid var(--toolbar-border-color);
      }
    }
  }

  .person {
    flex: 1;
    min-width: 0;
    height: auto;
    min-height: 5.2rem;
    border-radius: 0;
    padding: 0.4rem 1.2rem;
    gap: 0.8rem;
    background: transparent;
    text-align: left;
    font-weight: 400;

    .check {
      width: 2.4rem;
      color: var(--color-blue);
      visibility: hidden;
    }

    &[aria-pressed="true"] .check {
      visibility: visible;
    }

    .details {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 0.2rem;
      flex: 1;
      min-width: 0;

      &:not(:has(.fee-exemptions)) {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.8rem;
        .primary-row { display: contents; }
        .count { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
        .secondary-row { grid-column: 1; }
      }
    }

    > span {
      text-box: normal;
      font-weight: 400;
    }

    .name, .email {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.3;
    }

    .primary-row, .secondary-row {
      display: flex;
      align-items: center;
      gap: 0.8rem;
      min-width: 0;
    }

    .name-row {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      flex: 1;
      min-width: 0;
    }

    .name { flex: 0 1 auto; min-width: 0; }

    .role-badge {
      flex: none;
      padding: 0.1rem 0.5rem;
      border: 1px solid var(--toolbar-border-color);
      border-radius: 100vmax;
      font-size: 1rem;
      line-height: 1.3;
      color: var(--color-gray);
      white-space: nowrap;
    }

    .email {
      flex: 1;
      min-width: 0;
      font-size: 1.2rem;
      color: var(--color-gray);

      &:empty {
        display: none;
      }
    }

    .count {
      line-height: 1.3;
      text-align: right;
      font-size: 1.6rem;
      color: var(--color-gray);
      font-weight: 400;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
      .excluded { text-decoration: underline; }
    }

    .fee-exemptions {
      display: flex;
      gap: 0.6rem;
      font-size: 1.2rem;
      line-height: 1.3;
      color: var(--color-gray);
      white-space: nowrap;
    }
  }

  .info {
    margin-right: 0.8rem;

    svg {
      fill: none;
      stroke: currentColor;
      stroke-width: 1.5;
    }
  }

  .empty {
    padding: 2.4rem 0;
    text-align: center;
    color: var(--color-gray);
  }

  menu p {
    padding: 1.2rem;
    font-size: 1.4rem;
    color: var(--color-gray);
  }
}

#game-market-people-view {
  > [purpose="slide"] { max-width: none; height: 100%; }
  .info.statistics-icon svg { fill: currentColor; stroke: none; }
  #transactions-panel { overflow-y: auto; }
  .transaction-message { text-align: center; padding: 2.4rem 1.2rem; }
  .transaction-message:empty { display: none; }
  .transaction-empty { height: 100%; }
  .transaction-days h2 { font-size: 1.3rem; position: sticky; top: 0; z-index: 1; margin: 0; line-height: 1.4; padding: 0.4rem 1.2rem; background: oklch(from var(--toolbar-background-color) 0.9 c h); font-weight: 500; }
}

#game-market-people-view > [data-slide-underlay] { visibility: visible; }

#game-market-people-view .transaction-days {
  --ruled-row-height: calc(5.2rem + 1px);
  min-height: 100%;
  &:empty { display: none; }
  h2 { text-box: normal; display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
  .transaction-count { white-space: nowrap; }
  li { justify-content: start; }
  .transaction-number { align-self: center; display: grid; white-space: normal; overflow-wrap: anywhere; max-width: 35%; }
  .transaction-number small { font-size: 1.2rem; }
  .transaction-amount[data-status="success"] .price { color: var(--color-green); }
  .transaction-amount[data-status="pending"] .price { color: var(--color-blue); }
  .transaction-amount[data-status="failure"] .price { color: var(--color-red); }
  .transaction-amount[data-status="aborted"] .price { text-decoration: line-through; }
  .transaction-amount { display: grid; margin-left: auto; text-align: right; }
}

#game-market-people-view .transaction-days {
  li {
    padding: 0;
    border-bottom: 0;
    + li { border-top: 1px solid var(--toolbar-border-color); }
  }
  .transaction {
    display: flex;
    width: 100%;
    min-height: 5.2rem;
    height: auto;
    padding: 0.4rem 1.2rem;
    gap: 0.8rem;
    justify-content: start;
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-weight: 400;
    text-align: left;
    > span { font-weight: inherit; text-box: normal; }
    > :is(span, div) { line-height: 1.3; gap: 0.2rem; }
    &[aria-pressed="true"] { background: var(--toolbar-background-color); }
    > div {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      flex: 1;
      min-width: 0;
      > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    }
    .transaction-amount { white-space: nowrap; }
    small { font-size: 1.2rem; color: var(--color-gray); }
    .check { width: 2.4rem; color: var(--color-blue); }
    &[aria-pressed="false"] .check { visibility: hidden; }
  }
}
