/* Secondary button, including disabled-with-hint. Primary and danger arrive with the first page that needs them. */
.ph-app .ph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-ui);
  line-height: var(--lh-ui);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--motion), border-color var(--motion);
}
.ph-app .ph-btn:hover { background: var(--surface-hover); }
.ph-app .ph-btn:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
.ph-app .ph-btn[aria-disabled="true"] {
  color: var(--text-muted);
  background: var(--page);
  cursor: not-allowed;
}

.ph-app .ph-hint-wrap { position: relative; display: inline-flex; }
/* A hint is shown by static/js/app-hints.js (hover, keyboard focus; Esc closes it): it is placed with
   position: fixed from the control's rectangle, in the browser's top layer when the Popover API exists, so
   no card's overflow: hidden can clip it and it always sits inside the window. */
.ph-app .ph-hint {
  position: fixed;
  inset: 0 auto auto 0; /* app-hints.js sets top and left */
  margin: 0;
  width: max-content;
  max-width: min(20rem, calc(100vw - var(--space-4)));
  border: 0;
  overflow-y: auto; /* a hint taller than the window scrolls inside itself (max-height is set by app-hints.js) */
  overflow-x: hidden;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--text-meta);
  line-height: var(--lh-meta);
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: var(--z-toast);
  transition: opacity var(--motion), visibility var(--motion);
}
.ph-app .ph-hint.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* stays open while the pointer is over it */
}
@media (prefers-reduced-motion: reduce) {
  .ph-app .ph-btn,
  .ph-app .ph-hint { transition: none; }
}
