/* Keep the native details menu inside its card, including its full touch target. */
@media screen {
  html[data-theme] .admin-grid,
  html[data-theme] .admin-group-actions {
    overflow: visible;
  }
  html[data-theme] .admin-group:has(.group-more[open]) {
    position: relative;
    z-index: 2;
    overflow: visible;
    /* Reserve the menu row; neither card clipping nor a modal edge can cover it. */
    padding-bottom: 76px;
  }
  html[data-theme] .admin-group-actions > .group-more {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    margin-inline-start: auto;
    overflow: visible;
  }
  html[data-theme] .admin-group-actions > .group-more > summary {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--mac-line, var(--line));
    border-radius: 8px;
    background: var(--mac-surface, var(--theme-surface, #fff));
    color: var(--mac-text, var(--ink));
    list-style: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    user-select: none;
  }
  html[data-theme] .admin-group-actions > .group-more > summary::-webkit-details-marker {
    display: none;
  }
  html[data-theme] .admin-group-actions > .group-more[open] > summary {
    border-color: var(--mac-accent, var(--purple));
    background: var(--mac-accent-soft, var(--purple-bg));
    color: var(--mac-accent, var(--purple));
  }
  html[data-theme] .admin-group-actions .group-more > .group-delete-button {
    position: absolute;
    inset: auto 0 auto auto;
    top: calc(100% + 8px);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: max-content;
    min-width: 160px;
    max-width: calc(100vw - 64px);
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid var(--mac-component-danger-line, var(--line));
    border-radius: 8px;
    background: var(--mac-surface, var(--theme-surface, #fff));
    color: var(--mac-component-danger, var(--red, #98283f));
    box-shadow: 0 6px 16px rgb(0 0 0 / 0.12);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    text-decoration: none;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  html[data-theme] .admin-group-actions .group-more:not([open]) > .group-delete-button {
    display: none;
  }
  html[data-theme] .admin-group-actions .group-more > .group-delete-button:hover {
    background: var(--mac-component-danger-bg, var(--red-bg, #fff0f2));
  }
  html[data-theme]
    .admin-group-actions
    .group-more
    > :is(summary, .group-delete-button):focus-visible {
    outline: 2px solid var(--mac-accent, var(--purple));
    outline-offset: 3px;
  }
}
