/* Group picture: the line on the group page and the picker (js/ui-logo-pick.js). */
@layer views {
  .glogo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

  /* group page: picture, what it is, one button */
  .lpnow { display: grid; justify-items: start; gap: 2px; min-width: 0; }
  .lpnow .lplabel { font-size: 13px; font-weight: 500; color: var(--muted); }
  .lpnow b { font-weight: 600; overflow-wrap: anywhere; }
  .lpnow button { margin-top: 4px; }

  /* the picker: wider than other dialogs, so five tiles fit a row on a laptop */
  .modal:has(.lpick) { width: min(640px, calc(100vw - 24px)); }
  .modal .lpick { gap: 12px; }
  .lpick h2 { margin: 0; font-size: 20px; }
  .lpick .lpsearch { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 16px; background: var(--bg); }
  .lpick .lpsearch:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }

  /* equal tiles: same width, same height, picture and name on the same lines in every tile */
  .lpgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-auto-rows: 112px; gap: 8px;
    max-height: min(48vh, 372px); overflow-y: auto; padding: 4px; margin: -4px; overscroll-behavior: contain; }
  .lptile { display: grid; grid-template-rows: 60px 22px; justify-items: center; align-content: center; gap: 6px; min-width: 0; min-height: 0;
    height: 112px; padding: 8px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
  .lptile:hover { transform: none; box-shadow: var(--shadow); border-color: var(--muted); }
  .lptile[hidden] { display: none; }
  .lptile .glogo { width: 56px; height: 56px; align-self: center; box-shadow: none; }
  .lptile .glogo b { font-size: 24px; }
  .lptile .lpname { max-width: 100%; font-size: 13px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
  .lptile.on { border: 2px solid var(--blue); background: var(--soft); padding: 7px 5px; }
  .lptile.on .lpname { font-weight: 650; }
  .lpnohit { margin: 0; }

  .lpfoot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
  .modal .lpick label.lpup { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 14px; border: 1px solid var(--blue);
    border-radius: var(--radius); background: var(--blue); color: #fff; font-size: 14px; font-weight: var(--weight-medium); cursor: pointer; box-shadow: var(--shadow-cta); }
  .modal .lpick label.lpup:focus-within { outline: var(--focus-ring); outline-offset: 2px; }
  .lpick > p.small { margin: 0; }

  @media (max-width: 700px) {
    .lpgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 46vh; }
    .lpfoot > * { flex: 1 1 auto; justify-content: center; }
  }
}

/* Set-up › Groups: each card shows the group's picture; pressing it opens the picker.
   Cards in a row are equal height: picture and name on top, labels, buttons on the bottom line. */
@layer views {
  .gitem.gcard { grid-template-rows: auto 1fr auto; gap: 10px; justify-items: stretch; padding: 16px; }
  .gcard header { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; flex-wrap: nowrap; }
  .gcard .gpic { all: unset; cursor: pointer; border-radius: 50%; line-height: 0; }
  .gcard .gpic:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
  .gcard .gpic:hover .glogo { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gc); }
  .glogo.mid { width: 64px; height: 64px; }
  .glogo.mid b { font-size: 28px; }
  .gcard .gname { min-width: 0; }
  .gcard h3 { margin: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
  .gcard .gname p { margin: 2px 0 0; color: var(--muted); }
  .gcard .gpills { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; min-height: 0; }
  .gcard .gfoot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
}
