/* Animate the revealed content only. The summary remains a stable click target. */
@media (prefers-reduced-motion: no-preference) {
  details[open]::details-content {
    animation: nss-details-open 160ms ease-out;
  }
  @keyframes nss-details-open {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @supports (interpolate-size: allow-keywords) {
    details[open]::details-content {
      interpolate-size: allow-keywords;
      animation-name: nss-details-expand;
    }
    @keyframes nss-details-expand {
      from { block-size: 0; overflow: clip; }
      to { block-size: auto; overflow: clip; }
    }
  }
}

/* One entrance per revealed surface. Offset is positive for trays opening
   above their trigger. The individual translate preserves existing transforms. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes nss-domain-dropdown-in {
    from { opacity: 0; translate: 0 var(--nss-dropdown-start, -4px); }
    to { opacity: 1; translate: 0 0; }
  }

  .society-person-search.search-open:not(.search-dismissed) .society-search-matches,
  .co-review-body:not([hidden]),
  .aw-log-entries.is-opening,
  .cm-artifact-options:not([hidden]),
  .cm-aud-options:not([hidden]),
  .bp-ac-list:not([hidden]),
  .bl-skillmenu-pop:not([hidden]),
  .ob-city-menu:not([hidden]),
  .ob-ssel-menu:not([hidden]),
  .ob-sched-tzmenu:not([hidden]),
  .pr-tzmenu:not([hidden]),
  .pin-map-search:not([hidden]),
  .history-search-date:not([hidden]),
  .nss-message-room .menu.show,
  .ncc-settings:not([hidden]),
  .sess-header-detail:not([hidden]) {
    animation: nss-domain-dropdown-in 160ms ease-out;
  }

  @container (max-width: 560px) {
    .ncc-more.is-open .ncc-secondary {
      --nss-dropdown-start: 4px;
      animation: nss-domain-dropdown-in 160ms ease-out;
    }
  }

  @media (min-width: 901px) {
    #society[data-sheet="filters"] .society-filters {
      --nss-dropdown-start: 4px;
      animation: nss-domain-dropdown-in 160ms ease-out;
    }
  }

  @media (max-width: 900px) {
    #society[data-sheet="filters"] .society-corner,
    #society[data-sheet="sections"] .phome-siblings {
      --nss-dropdown-start: 4px;
      animation: nss-domain-dropdown-in 160ms ease-out;
    }
    .stodo-list.is-open {
      animation: nss-domain-dropdown-in 160ms ease-out;
    }
  }
}
