/* The action menu: its button, and the popover it opens, the top layer of the browser, under the button (browser/action-menu.js
   places it). Shared tokens and layout words only, on the root of the menu (packages/components/src/styles.ts). No
   rule gives the list a display of its own: the rule of the browser that hides a popover while it is closed must hold. */
.action-menu {
  display: inline-block;
}

.action-menu > button {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--nw-size-control-compact);
  padding-inline: var(--nw-space-12);
  font: inherit;
  font-weight: var(--nw-font-weight-medium);
  color: var(--nw-color-accent-text);
  background: var(--nw-color-surface);
  border: var(--nw-border-width-1) solid var(--nw-color-border-strong);
  border-radius: var(--nw-radius-m);
  cursor: pointer;
}

.action-menu > button:hover {
  background: var(--nw-color-surface-hover);
}

.action-menu > [popover] {
  margin: 0;
  padding: var(--nw-space-4);
  list-style: none;
  color: var(--nw-color-text);
  background: var(--nw-color-surface-raised);
  border: var(--nw-border-width-1) solid var(--nw-color-border-strong);
  border-radius: var(--nw-radius-m);
  box-shadow: var(--nw-shadow-overlay);
}

.action-menu > [popover] form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
}

.action-menu > [popover] a,
.action-menu > [popover] button {
  display: flex;
  align-items: center;
  min-block-size: var(--nw-size-control-m);
  padding-inline: var(--nw-space-12);
  font: inherit;
  color: var(--nw-color-text);
  background: inherit;
  border: 0;
  border-radius: var(--nw-radius-s);
  text-align: start;
  text-decoration: inherit;
  cursor: pointer;
}

.action-menu > [popover] a:hover,
.action-menu > [popover] button:hover {
  background: var(--nw-color-surface-hover);
}

.action-menu > [popover] button:disabled {
  color: var(--nw-color-text-muted);
  background: inherit;
  cursor: default;
}

/* A menu that holds a form of boxes (the column chooser of a table): the group drawn as rows of the menu, each box with
   its name a row a person may click anywhere on. */
.action-menu > [popover] fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.action-menu > [popover] label {
  display: flex;
  align-items: center;
  gap: var(--nw-space-8);
  min-block-size: var(--nw-size-control-m);
  padding-inline: var(--nw-space-12);
  cursor: pointer;
}
