/* The full admin usage form has eleven fields. Other tabs, identity-only
   filters and observer forms intentionally keep their existing layout.
   This standalone sheet also supports a CSS-only release on the current UI. */
div:has(> #usage-platform-hint):has(> div > .flex-1 > div:nth-child(11)) {
  container-type: inline-size;
  container-name: nerv-admin-usage-filters;
}

@container nerv-admin-usage-filters (min-width: 1360px) {
  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) {
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    align-items: end;
    reading-flow: grid-rows;
  }

  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex-1 {
    display: contents;
  }

  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex-1 > div {
    width: auto;
    min-width: 0;
  }

  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex-1 > div:nth-child(-n + 5) {
    grid-row: 1;
    grid-column: span 5;
  }

  /* Group joins user, API key, platform, model and account on the first row. */
  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex-1 > div:nth-child(11) {
    grid-row: 1;
    grid-column: 26 / -1;
  }

  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex-1 > div:nth-child(n + 6):nth-child(-n + 10) {
    grid-row: 2;
    grid-column: span 4;
  }

  .flex.flex-wrap.items-end.justify-between:has(> .flex-1 > div:nth-child(11)):has(#usage-platform) > .flex:not(.flex-1) {
    grid-row: 2;
    grid-column: 21 / -1;
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
  }
}
