/* Duo New Tab © 2026 DevRoshdi. All rights reserved. See LICENSE.txt. */
/*
 * iPadOS pop-up buttons and their menus (js/popupmenu.js), in place of the browser's dropdowns.
 * Self-contained, so the toolbar popup uses it as well as the new tab page.
 */

/* The select stays in the page, hidden, holding the value. */
select.pm-native { display: none !important; }

/* The button: the value and up-down chevrons, at the right of its row. */
.pm-btn {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; flex: 0 1 auto; min-width: 0; max-width: 100%;
  margin: 0 -6px 0 auto; padding: 5px 6px 5px 8px; border: 0; border-radius: 9px; background: transparent;
  color: inherit; font: inherit; text-align: right; cursor: pointer; transition: background 0.15s ease;
}
.pm-btn:hover, .pm-btn[aria-expanded="true"] { background: rgba(128, 128, 136, 0.16); }
.pm-btn:focus-visible { outline: 2px solid #0a84ff; outline-offset: 0; }
.pm-btn:disabled { opacity: 0.45; cursor: default; background: transparent; }
.pm-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-chev { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

/* The menu: Liquid Glass, a checkmark beside the current choice. */
.pm-menu {
  position: fixed; inset: auto; margin: 0; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: 6px 0; border: 0; border-radius: 18px; color: #000; font-family: inherit;
  background: rgba(246, 246, 250, 0.8); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s ease, scale 0.38s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.pm-menu::-webkit-scrollbar { display: none; }
@starting-style { .pm-menu:popover-open { opacity: 0; scale: 0.6; } }
.pm-menu.pm-out { opacity: 0; scale: 0.8; transition: opacity 0.15s ease, scale 0.15s ease-in; }
.mode-dark .pm-menu, .pm-menu.pm-dark { color: #fff; background: rgba(44, 44, 50, 0.78); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14); }
.pm-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 9px 18px 9px 12px; border: 0; background: transparent;
  color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer;
}
.pm-item > i, .pm-check { flex: none; width: 18px; height: 18px; }
.pm-check { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pm-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-item:hover, .pm-item:focus-visible, .pm-item:focus { background: rgba(128, 128, 136, 0.22); outline: 0; }
.pm-item:disabled { opacity: 0.4; cursor: default; background: transparent; }
@media (prefers-reduced-motion: reduce) { .pm-menu, .pm-menu.pm-out { transition: none; } }
