@layer components {
  /* A <details> dropdown: the summary is the trigger, the menu floats below. */
  .dropdown { position: relative; }

  .dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 16rem;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-block);
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    opacity: 1;
    translate: 0 0;
    transition: opacity var(--duration) var(--ease), translate var(--duration) var(--ease);

    @starting-style { opacity: 0; translate: 0 -4px; }
  }

  .dropdown__menu--left { right: auto; left: 0; }

  .dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-ink);
    text-decoration: none;
    font-size: var(--text-base);
    width: 100%;
    text-align: left;

    & svg { width: 16px; height: 16px; color: var(--color-ink-muted); }
    &:hover { background: var(--color-chip); text-decoration: none; }
  }

  .dropdown__sep { height: 1px; background: var(--color-line); margin: 0.375rem 0; }

  /* A wide, scrollable panel (the notification lists of the top bar). */
  .dropdown__menu--panel { width: 30rem; max-width: calc(100vw - 2rem); max-height: 70vh; overflow-y: auto; padding: 0; }
  .dropdown__panel-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--color-line); }
}
