/* Popover - a white panel opened from its trigger, over the window: it
   goes through the portal and ui/popover.cljs places it by the trigger's
   rectangle (left, top, max-height inline). White on white, so it takes
   the 1px line (docs/design-system.md, Surfaces). A transparent layer
   behind it closes it on a click outside. */

.popover {
  display: flex;
}

.popover__trigger {
  flex: 1;
  min-width: 0;
}

.popover__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
}

.popover__panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-modal);
  width: min(480px, calc(100vw - var(--space-8)));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
}

/* The panel takes the focus on open only to start Tab inside it; its
   border already marks it, the rows show their own focus. */
.popover__panel:focus {
  outline: none;
}

/* A long content scrolls the panel instead of squeezing its rows. */
.popover__panel > * {
  flex-shrink: 0;
}

.popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.popover__title {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
