/* Veva Support theme: overlays. Ported from the design system's class contract (components/bundle.css): the theme's
   Dialog (a native <dialog>) and the search palette (Ctrl K). Floating things are the only ones with shadow-overlay. */

/* ---------- Dialogs ---------- */
.vs-modal { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--white); color: var(--grey-black); box-shadow: var(--shadow-overlay); }
.vs-modal::backdrop, .vs-backdrop { background: rgba(29, 28, 27, .56); backdrop-filter: blur(2px); }
.vs-modal[open] { animation: vs-modal-in .2s ease-out; }
@keyframes vs-modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
/* The dialog leaves as it arrives, and its backdrop fades with it. A dialog is gone the moment it closes, so
   <vs-dialog> sets data-closing first and closes it when the animation ends; the fill keeps it hidden until then. */
@media (prefers-reduced-motion: no-preference) {
  .vs-modal[open]::backdrop { animation: vs-modal-fade .2s ease-out; }
  .vs-modal[data-closing] { animation: vs-modal-out .2s ease-in forwards; }
  .vs-modal[data-closing]::backdrop { animation: vs-modal-fade-out .2s ease-in forwards; }
}
@keyframes vs-modal-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes vs-modal-fade { from { opacity: 0; } }
@keyframes vs-modal-fade-out { to { opacity: 0; } }
.vs-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; }
.vs-modal__head h2 { margin: 0; font-weight: 800; font-size: 26px; line-height: 32px; letter-spacing: -0.6px; }
.vs-modal__body { padding: var(--space-4) var(--space-6) var(--space-6); color: var(--grey-600); }
.vs-modal__body > * { margin: 0; }
.vs-modal__body > * + * { margin-top: var(--space-4); }
.vs-modal__foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--grey-200); background: var(--grey-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.vs-modal--wide { width: min(720px, calc(100vw - 32px)); }

/* ---------- Search palette ---------- */
.vs-palette { width: min(680px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px)); margin-top: 12vh; padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--white); color: var(--grey-black); box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; overflow: hidden; }
.vs-palette:not([open]) { display: none; }
.vs-palette::backdrop { background: rgba(29, 28, 27, .56); backdrop-filter: blur(2px); }
.vs-palette__input { display: flex; align-items: center; gap: var(--space-3); height: 64px; padding: 0 var(--space-4) 0 var(--space-5); border-bottom: 1px solid var(--grey-200); }
.vs-palette__input > svg, .vs-palette__input > i { color: var(--pink-base); font-size: 18px; }
.vs-palette__input input { flex: 1; height: 100%; border: 0; background: none; font: 400 18px/1 var(--font-grotesk); color: var(--grey-black); outline: none; }
.vs-palette__results { overflow: auto; padding: var(--space-2); }
.vs-palette__group { margin: var(--space-3) var(--space-3) var(--space-1); font: 500 12px/16px var(--font-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--grey-600); }
.vs-palette__item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.vs-palette__item b { display: block; font-weight: 600; font-size: 15px; line-height: 22px; }
.vs-palette__item small { display: block; font-size: 14px; line-height: 20px; color: var(--grey-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-palette__item mark { background: var(--pink-100); color: inherit; border-radius: 2px; padding: 0 1px; }
.vs-palette__ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--grey-100); color: var(--grey-600); font-size: 14px; }
.vs-palette__item[aria-selected="true"] { background: var(--grey-100); }
.vs-palette__item[aria-selected="true"] .vs-palette__ic { background: var(--grey-black); color: var(--white); }
.vs-palette__item kbd { visibility: hidden; }
.vs-palette__item[aria-selected="true"] kbd { visibility: visible; }
.vs-palette__foot { display: flex; align-items: center; gap: var(--space-4); padding: 10px var(--space-5); border-top: 1px solid var(--grey-200); background: var(--grey-50); font-size: 13px; color: var(--grey-600); }
.vs-palette__foot span { display: inline-flex; align-items: center; gap: 6px; }
.vs-palette__empty { padding: var(--space-7) var(--space-5); text-align: center; color: var(--grey-600); }
