/* Keep touch feedback inexpensive and prevent list updates moving the viewport. */
@media screen {
  body[data-app-shell] .myday-visit-list {
    overflow-anchor: none;
  }
  body[data-app-shell] .myday-save-state {
    flex-shrink: 0;
    min-height: 20px;
  }
  body[data-app-shell] .myday-time-preset {
    touch-action: manipulation;
    transform: none;
    transition: background-color 100ms ease-out, border-color 100ms ease-out, color 100ms ease-out;
  }
  /* The in-flight guard still prevents duplicate submissions. Keep the other
     time slots from flashing dim and bright around each local save. */
  body[data-app-shell] .myday-time-preset:disabled {
    opacity: 1;
    cursor: progress;
  }
}

@keyframes mp-menu-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile menus should not zoom/slide against Radix's positioning transforms.
   Closing immediately also releases the modal pointer/scroll lock promptly. */
@media screen and (hover: none) and (pointer: coarse) {
  body[data-app-shell] :is([role="listbox"], [role="menu"])[data-state="open"] {
    animation: mp-menu-fade-in 100ms ease-out;
  }
  body[data-app-shell] :is([role="listbox"], [role="menu"])[data-state="closed"] {
    animation: none;
  }
  /* Large clinical sections otherwise animate height and relayout their entire
     form on every frame. Fade the content without repeatedly resizing it. */
  body[data-app-shell] :is(
    [style*="--radix-collapsible-content-height"],
    [style*="--radix-accordion-content-height"]
  ) {
    transition: none;
    animation: none;
  }
  body[data-app-shell] :is(
    [style*="--radix-collapsible-content-height"],
    [style*="--radix-accordion-content-height"]
  )[data-state="open"] {
    animation: mp-menu-fade-in 100ms ease-out;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-app-shell] :is([role="listbox"], [role="menu"],
    [style*="--radix-collapsible-content-height"],
    [style*="--radix-accordion-content-height"]) {
    animation: none !important;
  }
  body[data-app-shell] .myday-time-preset { transition: none; }
}
