/* The list of settings pages a phone starts from (`accounts/menus/show`),
   the badge counting what Doladiť účet still has, and the head of a
   settings page, folded to the way back and the title on a phone. */

@layer components {
  /* ─── The list ─────────────────────────── */

  .settings-menu {
    gap: 1rem;
  }

  /* The user's own card over the list: the photo, the name and the address
     the profile page heads itself with (`users/profiles/header`). */
  .settings-profile {
    align-items: center;
    color: var(--color-ink);
    display: flex;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;

    &:hover {
      background: var(--color-surface-tint);
    }
  }

  .settings-menu__group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  .settings-menu__row {
    align-items: center;
    color: var(--color-ink);
    display: flex;
    gap: 0.875rem;
    min-block-size: 3.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;

    &:hover {
      background: var(--color-surface-tint);
    }

    & + & {
      border-block-start: 1px solid var(--color-border-subtle);
    }
  }

  .settings-menu__icon {
    background: var(--color-brand-tint);
    block-size: 2.25rem;
    border-radius: var(--radius-sm);
    color: var(--color-brand);
    display: inline-grid;
    flex-shrink: 0;
    inline-size: 2.25rem;
    place-items: center;
  }

  .settings-menu__text {
    display: grid;
    flex: 1;
    gap: 0.125rem;
    min-inline-size: 0;
  }

  .settings-menu__title {
    font-size: 1rem;
    font-weight: 600;
  }

  .settings-menu__description {
    color: var(--color-ink-muted);
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .settings-menu__chevron {
    color: var(--color-ink-faint);
    flex-shrink: 0;
  }

  .settings-menu__row--danger {
    color: var(--color-negative);

    .settings-menu__icon {
      background: var(--color-negative-tint);
      color: var(--color-negative);
    }
  }

  /* ─── What is left to do ───────────────── */

  .settings-badge {
    background: var(--color-warning-tint);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-pill);
    color: var(--color-warning);
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    white-space: nowrap;
  }

  .account-nav__badge {
    margin-inline-start: auto;
  }

  /* ─── A settings page's head ───────────── */

  /* On a phone the head is one line: the way back to the list, then the
     title — the label and the subtitle the panel's room explains on a wider
     display have none here. */
  .settings-header {
    @media (width < 768px) {
      align-items: center;
      display: flex;
      gap: 0.25rem;
      padding-block: 1.25rem;
    }
  }

  .settings-header__label,
  .settings-header__subtitle {
    @media (width < 768px) {
      display: none;
    }
  }

  .settings-header__title {
    @media (width < 768px) {
      font-size: 1.5rem;
    }
  }

  .settings-back {
    align-items: center;
    block-size: 2.5rem;
    border-radius: var(--radius-pill);
    color: var(--color-brand);
    display: inline-grid;
    flex-shrink: 0;
    inline-size: 2.5rem;
    margin-inline-start: -0.625rem;
    place-items: center;

    &:hover {
      background: var(--color-brand-tint);
    }

    @media (width >= 768px) {
      display: none;
    }
  }
}
