/* The client screens: the console (clients/show — the platforms' status
   badges, the Overview's lens section cards, a platform's account card, the
   lens sections' headings) and the new-client wizard
   (client_provisions/new). Every piece is the kit's — Cards, Items, status
   badges, Tabs, Fields, Progress; this only lays them out. */
@layer components {
  /* A platform in the console's section nav: its name, then its status badge
     at the end of the link. */
  .client-nav-platform {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
  }

  /* The Connections table's last column: the one way to fix or add, at the
     end of the row. */
  .client-table__actions {
    text-align: end;
    white-space: nowrap;
  }

  /* A broken connection's alert title: its label and the state's badge on
     one line. */
  .client-alert__title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* A platform card's footer: the ways into the account, wrapping, with
     Retire and Remove pushed to the end. */
  .client-account__actions {
    flex-wrap: wrap;
  }

  /* A platform not set up (ui-empty): how it connects, the icon beside the
     line. */
  .client-setup__how {
    --icon-size: 1rem;

    align-items: center;
    display: flex;
    gap: 0.5rem;
  }

  /* A list of items edge to edge in a flush card lines up with its header. */
  .ui-card--flush > .ui-item-group > .ui-item {
    padding-inline: 1.5rem;
  }

  /* A lens section's heading (clients/lenses/_*): the lens's name and what it
     reads, its actions across from them. */
  .lens-heading {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    justify-content: space-between;
  }

  .lens-heading__text {
    display: grid;
    gap: 0.25rem;
    min-inline-size: 0;
  }

  .lens-heading__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* A lens's card on the Overview: its figures take the slack, so the three
     cards' worst items and footers line up. */
  .lens-card__body {
    flex: 1;
  }

  /* The new-client wizard: the steps (Tabs) across the top, the step showing
     under them. */
  .client-wizard {
    display: grid;
    gap: 1.5rem;
  }

  .client-wizard__rail {
    min-inline-size: 0;
  }

  /* A step's number, or a tick once the step is done. */
  .client-wizard__check,
  [data-state="done"] > .client-wizard__number {
    display: none;
  }

  [data-state="done"] > .client-wizard__check {
    display: inline-block;
  }

  /* A step is a fieldset drawn as a card: without the fieldset's own margin
     and inline padding. */
  .client-wizard__step {
    margin: 0;
    min-inline-size: 0;
    padding-inline: 0;
  }

  /* A platform on the wizard's second step: its choice card, and under it
     the fields it needs typed — shown only while it is switched on. Fields of
     a platform left off still post, empty, and are ignored. */
  .client-wizard__platform {
    display: grid;
    gap: 1rem;
  }

  .client-wizard__platform-head {
    cursor: pointer;
  }

  .client-wizard__platform-fields {
    display: none;

    .client-wizard__platform:has(.ui-switch:checked) & {
      display: grid;
      gap: 1rem;
      grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    }
  }

  .client-wizard__wide {
    grid-column: 1 / -1;
  }

  .client-wizard__lock {
    --icon-size: 0.875rem;
  }

  /* An agent to switch on: a choice card (ui-field--card), its name and
     badge on one line. */
  .client-wizard__agents {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .client-wizard__agent {
    block-size: 100%;
    cursor: pointer;
  }

  .client-wizard__agent-name {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .client-wizard__every {
    inline-size: 5rem;
  }

  .client-wizard__unit {
    inline-size: auto;
  }

  /* The review's facts: outline Items, the way back to its step at the end. */
  .client-wizard__summary dd {
    margin: 0;
  }

  /* Back, Next or Create, Cancel, and why Next is held, under the step. */
  .client-wizard__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
