/* Menu: the popover opened from a task row's assignee or due date cell (static/js/app-menu.js places it from the
   cell's rectangle, in the browser's top layer when the Popover API exists, so no card's overflow can clip it).
   Choices are real buttons, at least 44px tall on touch screens. Tokens only. */
.ph-app .ph-menu {
  --ph-menu-w: 18rem;
  --ph-menu-item-h: 36px;
  position: fixed;
  inset: 0 auto auto 0; /* app-menu.js sets top and left */
  box-sizing: border-box;
  margin: 0;
  width: min(var(--ph-menu-w), calc(100vw - var(--space-4)));
  max-height: calc(100vh - var(--space-4)); /* app-menu.js replaces it with the room really left */
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  font-size: var(--text-ui);
  line-height: var(--lh-ui);
  z-index: var(--z-dropdown);
  visibility: hidden;
}
.ph-app .ph-menu.is-open { visibility: visible; }
/* The property page's Actions menu has one or two short labels: it is as wide as they are (9rem at least, 13rem at
   most; a longer label is cut with an ellipsis). Only this menu changes width; the rule above still applies to the others. */
.ph-app .ph-menu[data-menu-kind="actions"] {
  --ph-menu-w: 13rem;   /* the most it may grow to; the width itself is the content's, never less than the minimum */
  --ph-menu-min-w: 9rem;
  width: fit-content;
  min-width: var(--ph-menu-min-w);
  max-width: min(var(--ph-menu-w), calc(100vw - var(--space-4)));
}
.ph-app .ph-menu__list { margin: 0; padding: 0; list-style: none; }
.ph-app .ph-menu__list li[hidden] { display: none; }
.ph-app .ph-menu__item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--ph-menu-item-h);
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ph-app .ph-menu__item:hover { background: var(--fill); }
.ph-app .ph-menu__item:focus-visible { outline: var(--focus); outline-offset: calc(var(--focus-offset) * -1); }
.ph-app .ph-menu__item[aria-checked="true"] { font-weight: 600; background: var(--surface-hover); }
.ph-app .ph-menu__item[disabled] { cursor: progress; opacity: 0.6; }
.ph-app .ph-menu__text { display: flex; flex-direction: column; min-width: 0; }
.ph-app .ph-menu__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-app .ph-menu__note { color: var(--text-muted); font-size: var(--text-meta); line-height: var(--lh-meta); font-weight: 400; }
.ph-app .ph-menu__aside { margin-left: auto; color: var(--text-muted); font-size: var(--text-meta); white-space: nowrap; }
.ph-app .ph-menu__filter-wrap { padding: var(--space-1) var(--space-1) var(--space-2); }
.ph-app .ph-menu__filter {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.ph-app .ph-menu__filter:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
.ph-app .ph-menu__empty { margin: 0; padding: var(--space-2) var(--space-3); color: var(--text-muted); font-size: var(--text-meta); }
.ph-app .ph-menu__pick {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-3);
  border-top: 1px solid var(--divider);
}
.ph-app .ph-menu__pick[hidden] { display: none; }

@media (pointer: coarse) {
  .ph-app .ph-menu { --ph-menu-item-h: 44px; }
}

/* The design-system page shows a menu open in the page flow (no popover, no fetch). */
.ph-app .ph-menu--inline { position: static; visibility: visible; margin: var(--space-3) 0; max-width: var(--ph-menu-w); }
