/* Apple-style VNC quality picker. Loaded globally by the workspace
   template so it's available whether the preview tile was rendered
   server-side (phone_preview.html) or JS-mounted (phone-control.js
   `_mountPreviewIframe`). Visual target: macOS Sonoma / iOS 17 menu —
   vibrancy (saturate + blur), subtle inner highlight, soft shadow. */

.vq-picker {
    position: absolute; top: 10px; right: 10px; z-index: 12;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.96);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- Chip ----- */
.vq-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px 6px 13px;
    /* Two-layer background: a subtle light gradient on top of the dark
       vibrancy tint mimics Apple's "control material" highlight. */
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.10) 0%,
            rgba(255, 255, 255, 0.02) 45%,
            rgba(255, 255, 255, 0.00) 100%),
        rgba(28, 28, 30, 0.55);
    color: rgba(255, 255, 255, 0.96);
    /* Border + inner highlight via two box-shadow layers — softer than a
       hard 0.5px border at high DPI. */
    border: 0;
    border-radius: 999px;
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.16) inset,
        0 0.5px 0 rgba(255, 255, 255, 0.20) inset,
        0 1px 1px rgba(0, 0, 0, 0.25),
        0 4px 14px rgba(0, 0, 0, 0.18);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 590;
    line-height: 1;
    letter-spacing: -0.012em;
    cursor: pointer;
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    backdrop-filter: saturate(180%) blur(28px);
    transition:
        background 140ms cubic-bezier(0.25, 0.1, 0.25, 1),
        transform 80ms cubic-bezier(0.25, 0.1, 0.25, 1),
        box-shadow 140ms ease;
    user-select: none;
}
.vq-chip:hover {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.04) 45%,
            rgba(255, 255, 255, 0.00) 100%),
        rgba(50, 50, 52, 0.62);
}
.vq-chip:active { transform: scale(0.97); }
.vq-chip[aria-expanded="true"] {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.16) 0%,
            rgba(255, 255, 255, 0.05) 45%,
            rgba(255, 255, 255, 0.00) 100%),
        rgba(64, 64, 66, 0.70);
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.22) inset,
        0 0.5px 0 rgba(255, 255, 255, 0.26) inset,
        0 1px 1px rgba(0, 0, 0, 0.30),
        0 6px 18px rgba(0, 0, 0, 0.28);
}
.vq-chip-chevron {
    opacity: 0.85; flex-shrink: 0;
    transition: transform 160ms cubic-bezier(0.4, 0, 0.2, 1);
}
.vq-chip[aria-expanded="true"] .vq-chip-chevron { transform: rotate(180deg); }

/* ----- Menu (popover) ----- */
.vq-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 244px;
    padding: 6px;
    /* macOS Sonoma menu material: very dark vibrancy + a soft inner top
       highlight + a generous drop shadow. */
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.00) 60%),
        rgba(28, 28, 30, 0.74);
    color: rgba(255, 255, 255, 0.96);
    border: 0;
    border-radius: 14px;
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, 0.12) inset,
        0 0.5px 0 rgba(255, 255, 255, 0.18) inset,
        0 16px 40px rgba(0, 0, 0, 0.50),
        0 4px 12px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: saturate(200%) blur(40px);
    backdrop-filter: saturate(200%) blur(40px);
    transform-origin: top right;
    animation: vq-menu-pop 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
.vq-menu[hidden] { display: none; }
@keyframes vq-menu-pop {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.vq-menu-header {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.48);
    padding: 6px 10px 8px; text-transform: uppercase;
}

/* ----- Items ----- */
.vq-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 7px 9px;
    background: transparent; border: 0;
    color: inherit; text-align: left; cursor: pointer;
    border-radius: 8px;
    font: inherit; line-height: 1.2;
    transition: background 90ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
.vq-item:hover, .vq-item:focus-visible {
    background: rgba(10, 132, 255, 0.20);  /* macOS systemBlue selection */
    outline: none;
    color: #fff;
}
.vq-item:active { background: rgba(10, 132, 255, 0.30); }

.vq-check {
    width: 14px; flex-shrink: 0;
    font-size: 12.5px; line-height: 1;
    color: #0a84ff;     /* macOS systemBlue */
    opacity: 0;
    text-align: center;
    transform: translateY(0.5px);
}
.vq-item[data-active="1"] .vq-check { opacity: 1; }

.vq-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vq-item-name {
    font-size: 13px; font-weight: 510;
    letter-spacing: -0.012em; line-height: 1.2;
}
.vq-item-sub {
    font-size: 11.5px; color: rgba(235, 235, 245, 0.55);
    font-variant-numeric: tabular-nums; letter-spacing: -0.005em; line-height: 1.2;
}
/* Hover lightens the secondary text too, but only a touch. */
.vq-item:hover .vq-item-sub { color: rgba(235, 235, 245, 0.75); }

.vq-item.vq-busy .vq-item-name::after {
    content: " · applying…"; color: rgba(255, 255, 255, 0.45); font-weight: 400;
}

.vq-divider {
    height: 0.5px; margin: 5px 6px;
    background: rgba(255, 255, 255, 0.10);
}

/* Reduce motion: respect user preference. */
@media (prefers-reduced-motion: reduce) {
    .vq-chip, .vq-chip-chevron, .vq-menu, .vq-item { transition: none; animation: none; }
}
