@layer components {
  /* The rows the settings pages list companies and members in, and the
     dashboard its memberships and invitations. */
  .settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .settings-list__row {
    align-items: center;
    border: 1.5px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 0.875rem 1.125rem;
  }

  .settings-list__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.125rem;
    min-inline-size: 0;
  }

  /* A row the page stands on rather than lists among others — the password,
     the inbox's address — sits on the tinted surface without a border; the
     row of the user's own browser, the company in use, on the brand's. */
  .settings-list__row--tinted {
    background: var(--color-surface-tint);
    border-color: transparent;
  }

  .settings-list__row--current {
    background: var(--color-brand-tint);
    border-color: transparent;
  }

  /* The square at the head of a row: the device, the company, the lock.
     Filled in the brand where the row is the one in hand. */
  .settings-list__icon {
    align-items: center;
    background: var(--color-surface);
    block-size: 2.5rem;
    border: 1.5px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-brand);
    display: flex;
    flex-shrink: 0;
    inline-size: 2.5rem;
    justify-content: center;
  }

  .settings-list__icon--filled {
    background: var(--color-brand-fill);
    border-color: transparent;
    color: var(--color-ink-inverted);
  }

  .settings-list__meta {
    color: var(--color-ink-muted);
    font-size: 0.8125rem;
  }

  .settings-list__mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
  }

  .settings-list__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* A word on a row's state beside its title: the company in use, the share
     that runs, the invitation still out, the seat's role. */
  .settings-tag {
    background: var(--color-surface-tint);
    border-radius: var(--radius-pill);
    color: var(--color-ink-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    white-space: nowrap;
  }

  .settings-tag--brand {
    background: var(--color-brand-tint);
    color: var(--color-brand);
  }

  .settings-tag--positive {
    background: var(--color-positive-tint);
    color: var(--color-positive);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .settings-tag--warning {
    background: var(--color-warning-tint);
    color: var(--color-warning);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .settings-list__title {
    align-items: center;
    color: var(--color-ink);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    font-weight: 600;
    gap: 0.5rem;
  }

  /* A row that opens into the form changing it — the password, the bank's
     statement password: the form takes the row's place while it is open. */
  .settings-reveal__summary {
    cursor: pointer;
    list-style: none;

    &::-webkit-details-marker {
      display: none;
    }
  }

  .settings-reveal[open] > .settings-reveal__summary {
    display: none;
  }

  .settings-inbox__address {
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
    user-select: all;
  }


  /* The bank's statement password under the inbox: its row, and the
     "Remove" beside it while the row is folded — a form of its own, so it
     cannot sit in the row's summary. */
  .settings-statement-password {
    align-items: center;
    border-block-start: 1px dashed var(--color-border-strong);
    display: flex;
    gap: 0.75rem;
    margin-block-start: 1.25rem;
    padding-block-start: 1.25rem;

    .settings-reveal {
      flex: 1;
      min-inline-size: 0;
    }
  }

  .settings-statement-password__row {
    border-color: transparent;
    padding-inline: 0;
  }

  .settings-statement-password__remove {
    background: none;
    border: none;
    color: var(--color-negative);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0;
  }

  .settings-statement-password:has(.settings-reveal[open]) .settings-statement-password__remove {
    display: none;
  }

  /* A company row on the Firma page: the radio that makes it the default at
     its head, the default itself drawn in the brand. */
  .settings-company--default {
    border-color: var(--color-brand);
  }

  .settings-company__radio {
    accent-color: var(--color-brand-fill);
    block-size: 1.125rem;
    cursor: pointer;
    flex-shrink: 0;
    inline-size: 1.125rem;
    margin: 0;
  }
}
