body.ui-refresh {
    --property-popover-z-index: 1100;
}

body.ui-refresh .property-popover {
    --control-bg-color: var(--bg-page);
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: none;
    z-index: var(--property-popover-z-index);
    box-sizing: border-box;
    width: 320px;
    min-width: 0;
    max-width: calc(100vw - var(--space-4));
    max-height: none;
    padding: 0;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--sh-lg);
    overflow: visible;
    color: var(--fg-default);
    white-space: normal;
}

body.ui-refresh .property-popover.is-fixed {
    position: fixed;
}

/* Top-layer surfaces retain their existing viewport coordinates. */
:where(body.ui-refresh [data-property-popover-layer]) {
    inset: auto;
    margin: 0;
    padding: 0;
    border: 0;
    width: auto;
    background: transparent;
    overflow: visible;
}

body.ui-refresh .ui-toast-container {
    z-index: calc(var(--property-popover-z-index) + 1);
}

body.ui-refresh .property-popover:has(> .pp-list),
body.ui-refresh .property-popover.prop-menu-address {
    max-height: min(var(--property-popover-max-height, 100vh), calc(100vh - var(--space-4)));
}

body.ui-refresh .property-popover .pp-header {
    padding: var(--space-4) var(--space-4) var(--space-2);
    flex-shrink: 0;
}

body.ui-refresh .property-popover .prop-menu-label {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 1.0625rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    color: var(--fg-default);
}

body.ui-refresh .property-popover .pp-record-name {
    margin: var(--space-0) 0 0;
    font-size: var(--font-size-btn);
    line-height: 1.4;
    color: var(--fg-muted);
    overflow-wrap: anywhere;
}

body.ui-refresh .property-popover .pp-search-wrap {
    padding: 0 var(--space-4) var(--space-2);
    flex-shrink: 0;
}

body.ui-refresh .property-popover .pp-search {
    width: 100%;
    min-height: var(--space-9);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--fg-default);
    background: var(--control-bg-color);
    box-sizing: border-box;
}

body.ui-refresh .property-popover .pp-list {
    box-sizing: border-box;
    min-height: 0;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--space-2) var(--space-2);
    flex: 0 1 auto;
}

body.ui-refresh .property-popover .qmi {
    appearance: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--space-10);
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    color: var(--fg-default);
    cursor: pointer;
}

body.ui-refresh .property-popover .qmi .name {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.ui-refresh .property-popover .qmi:hover {
    background: var(--state-hover);
}

body.ui-refresh .property-popover .qmi[aria-checked="true"] {
    background: var(--accent-subtle);
    color: var(--fg-default);
    font-weight: var(--font-weight-semibold);
}

body.ui-refresh .property-popover .qmi[aria-checked="true"]:hover {
    background: var(--accent-muted);
}

body.ui-refresh .property-popover .spk-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--space-4);
    flex: 0 0 var(--space-4);
    color: var(--primary-ink);
}

body.ui-refresh .property-popover .qmi[aria-checked="true"] .spk-check::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Pro', 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
}

body.ui-refresh .property-popover .qmi:disabled {
    color: var(--fg-muted);
    cursor: not-allowed;
    opacity: var(--state-disabled-opacity);
}

body.ui-refresh .property-popover .qmi:disabled:hover {
    background: transparent;
}

body.ui-refresh .property-popover .pp-empty {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-btn);
    color: var(--fg-muted);
}

body.ui-refresh .property-popover .pp-footer {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4) var(--space-4);
}

body.ui-refresh .property-popover .pp-done {
    min-height: var(--space-9);
    padding: 0 var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
}

body.ui-refresh .property-popover input[data-chip-input],
body.ui-refresh .property-popover .pp-time-input,
body.ui-refresh .property-popover .pp-date-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    min-height: var(--space-9);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    color: var(--fg-default);
    background: var(--control-bg-color);
}

body.ui-refresh .property-popover input[data-chip-input] {
    width: calc(100% - var(--space-8));
    margin: 0 var(--space-4) var(--space-3);
}

body.ui-refresh .property-popover .pp-hint {
    padding: 0 var(--space-4) var(--space-3);
    font-size: var(--font-size-btn);
    color: var(--fg-muted);
    line-height: 1.4;
}

body.ui-refresh .property-popover .pp-time-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0 var(--space-4) var(--space-4);
}

body.ui-refresh .property-popover .pp-time-actions {
    justify-content: flex-end;
}

body.ui-refresh .property-popover .loc-addr-popover-inner {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-height: calc(min(var(--property-popover-max-height, 100vh), 100vh - var(--space-4)) - 2px);
    padding: 0 var(--space-4) var(--space-4);
}

body.ui-refresh .property-popover .loc-addr-popover-inner > :not(.loc-address-fields) {
    flex-shrink: 0;
}

body.ui-refresh .property-popover .loc-address-fields {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Google portals suggestions to body; keep them above the open address picker. */
body.ui-refresh:has(.sr-location-addr-trigger.open, .sr-hotel-addr-trigger.open) .pac-container {
    z-index: calc(var(--property-popover-z-index) + 1) !important;
}

body.ui-refresh .property-popover .loc-addr-popover-inner .pp-header {
    padding-left: 0;
    padding-right: 0;
}

body.ui-refresh .property-popover .pp-search:focus,
body.ui-refresh .property-popover input[data-chip-input]:focus,
body.ui-refresh .property-popover .pp-time-input:focus,
body.ui-refresh .property-popover .pp-date-input:focus,
body.ui-refresh .property-popover .qmi:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
}
