.sr-sheet-grip,
.sr-person-actions-trigger,
.event-native-date {
    display: none;
}

/* Native sheets share the same layout across navigation and page actions. */
@media (max-width: 980px) {
    dialog.sr-native-dialog[data-sr-mobile-sheet],
    dialog.sr-native-dialog[data-sr-mobile-editor] {
        inset: var(--sr-sheet-viewport-top, 0px) 0 auto;
        width: 100%;
        height: var(--sr-sheet-viewport-height, 100dvh);
        padding: 0 !important;
        align-items: flex-end !important;
        justify-content: center !important;
        overflow: hidden;
    }

    dialog.sr-native-dialog[data-sr-mobile-sheet] > [data-sr-dialog-surface] {
        box-sizing: border-box;
        width: 100%;
        max-width: 560px;
        max-height: min(85dvh, calc(var(--sr-sheet-viewport-height, 100dvh) - 16px));
        margin: 0;
        padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
        border: 1px solid var(--app-border);
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
        background: var(--app-surface);
        color: var(--app-text);
        box-shadow: 0 -8px 40px rgb(0 0 0 / 20%);
        overflow-y: auto;
        overscroll-behavior: contain;
        scroll-padding-block: 16px 72px;
        transform: translateY(var(--sr-sheet-drag, 0px));
    }

    dialog[data-sr-mobile-sheet][open] > [data-sr-dialog-surface] {
        transform: translateY(var(--sr-sheet-drag, 0px));
    }

    dialog[data-sr-mobile-sheet] > .is-sheet-dragging {
        transition: none;
    }

    .sr-sheet-grip {
        display: flex;
        height: 28px;
        min-height: 28px;
        align-items: center;
        justify-content: center;
        touch-action: none;
        cursor: grab;
    }

    .sr-sheet-grip::before {
        content: "";
        width: 36px;
        height: 4px;
        border-radius: 4px;
        background: var(--app-muted);
        opacity: 0.45;
    }

    .sr-mobile-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    dialog.sr-native-dialog.sr-mobile-panel-sheet > .sr-mobile-panel-surface {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sr-mobile-panel-surface > :is(.sr-sheet-grip, .sr-mobile-sheet-head, .sr-mobile-sheet-cancel) {
        flex-shrink: 0;
    }

    .sr-mobile-panel-surface > .sr-mobile-sheet-content {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .sr-mobile-sheet-head h2 {
        margin: 0;
        color: var(--app-title-text);
        font-size: 18px;
        line-height: 1.3;
    }

    .sr-mobile-sheet-close {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: var(--app-muted);
        font-size: 28px;
    }

    .sr-mobile-sheet-cancel {
        display: block;
        width: 100%;
        min-height: 48px;
        margin-top: 12px;
        border: 1px solid var(--app-border);
        border-radius: 12px;
        background: var(--app-row-even);
        color: var(--app-text);
        font: inherit;
        font-size: 16px;
        font-weight: 600;
    }

    .sr-mobile-sheet-content :is(.mobile-bottom-nav-popover, .menu-registry-switch-menu, .mobile-portrait-registry-switch-menu) {
        position: static;
        inset: auto;
        display: block;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        overflow: visible;
    }

    .sr-mobile-sheet-content :is(.mobile-bottom-nav-popover-link, .mobile-bottom-nav-popover-btn) {
        min-height: 48px;
        padding: 12px;
        font-size: 16px;
        line-height: 1.4;
    }

    .sr-mobile-sheet-content button.mobile-bottom-nav-popover-link {
        width: 100%;
        background: transparent;
        color: var(--app-text);
        text-align: start;
    }

    [data-sr-open-registry-sheet][hidden] { display: none !important; }

    .sr-mobile-sheet-content :is(.menu-registry-switch-option, .mobile-portrait-registry-switch-option) {
        min-height: 64px;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 10px;
        font-size: 16px;
        border-radius: 12px;
    }

    .sr-mobile-sheet-content :is(.menu-registry-switch-thumb, .mobile-portrait-registry-switch-thumb) {
        width: 36px;
        height: 36px;
    }

    .sr-mobile-sheet-content :is(.menu-registry-switch-text, .mobile-portrait-registry-switch-text) {
        min-width: 0;
        font-size: 16px;
        white-space: normal;
        text-overflow: clip;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .sr-mobile-sheet-content :is(.menu-registry-switch-current, .mobile-portrait-registry-switch-current) {
        font-size: 12px;
    }

    .sr-mobile-sheet-content :is(.menu-registry-switch-heading, .mobile-portrait-registry-switch-heading) {
        justify-content: space-between;
        padding: 0 10px 8px;
    }

    .sr-mobile-sheet-content :is(.menu-registry-switch-all-link, .mobile-portrait-registry-switch-all-link) {
        display: inline-flex;
        align-items: center;
        min-height: 48px;
        padding-inline: 8px;
        font-size: 14px;
        text-transform: none;
    }

    .sr-mobile-action-row {
        display: grid;
        gap: 4px;
        width: 100%;
        min-height: 60px;
        padding: 12px 10px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--app-text);
        text-align: start;
        font: inherit;
        line-height: 1.4;
    }

    .sr-mobile-action-label { font-size: 16px; font-weight: 600; }
    .sr-mobile-action-note { font-size: 13px; color: var(--app-muted); }
    .sr-mobile-action-row.is-danger {
        color: color-mix(in srgb, #d63b4c 80%, var(--app-text));
        border-top: 1px solid var(--app-border);
        margin-top: 8px;
        border-radius: 0 0 10px 10px;
    }
    .sr-mobile-action-row:disabled { opacity: 0.6; }

    dialog[data-sr-mobile-sheet] :is(button, input[type="submit"], input[type="button"]),
    dialog[data-sr-mobile-editor] :is(button, input[type="submit"], input[type="button"]) {
        min-height: 48px;
        touch-action: manipulation;
    }

    dialog[data-sr-mobile-sheet] :is([class$="-close"], .sr-info-dialog-close),
    dialog[data-sr-mobile-editor] :is([class$="-close"], .sr-edit-item-close) {
        min-width: 48px;
        min-height: 48px;
        flex-shrink: 0;
    }

    dialog[data-sr-mobile-sheet] :is(button, a):focus-visible,
    dialog[data-sr-mobile-editor] :is(button, a):focus-visible {
        outline: 2px solid var(--app-focus);
        outline-offset: 2px;
    }

    dialog[data-sr-mobile-sheet] :is(button, a):active { background-color: var(--app-row-even); }

    dialog[data-sr-mobile-sheet] :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select),
    dialog[data-sr-mobile-editor] :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select) {
        min-height: 48px;
    }

    /* Keep the device keyboard readable without triggering iOS field zoom. */
    :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea) {
        font-size: 16px !important;
    }

    dialog[data-sr-mobile-sheet] .sr-confirm-title {
        padding: 8px 0 12px;
        border: 0;
        background: transparent;
        color: var(--app-title-text);
        font-size: 18px;
    }

    dialog[data-sr-mobile-sheet] .sr-confirm-message { padding: 0; font-size: 15px; line-height: 1.5; }
    dialog[data-sr-mobile-sheet] .sr-confirm-actions { display: grid; grid-template-columns: 1fr; padding: 16px 0 0; gap: 8px; }
    dialog[data-sr-mobile-sheet] .sr-confirm-btn { width: 100%; border-radius: 12px; font-size: 16px; }
    dialog[data-sr-mobile-sheet] .sr-info-dialog-actions .smallbut { width: 100%; font-size: 16px; }

    dialog.sr-native-dialog[data-sr-mobile-editor] > [data-sr-dialog-surface] {
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        scroll-padding-block: 80px;
    }

    dialog[data-sr-mobile-editor] :is(.sr-edit-item-head, .sr-form-dialog-header, .registries-create-dialog-head, .sr-image-crop-header) {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--app-surface);
        padding-top: max(12px, env(safe-area-inset-top, 0px));
    }

    dialog[data-sr-mobile-editor] :is(.category-dialog-head, .invite-create-head) {
        padding-right: 76px;
    }

    dialog[data-sr-mobile-editor] :is(.sr-edit-item-foot, .sr-form-actions, .registries-create-footer, .invite-create-form-actions, .category-dialog-actions, .sr-image-crop-actions, .sr-help-actions) {
        position: sticky;
        bottom: 0;
        z-index: 1;
        background: var(--app-surface);
        padding-block: 12px;
        border-top: 1px solid var(--app-border);
        gap: 8px;
    }

    dialog[data-sr-mobile-editor] :is(.sr-help-modal-close, .category-dialog-close, .invite-create-close) {
        position: sticky;
        top: 8px;
        float: right;
        margin-inline-end: 12px;
        z-index: 2;
    }

    body.sr-person-actions-enhanced .shopfor-people-table td.shoppee-action-cell.shoppee-action-cell-notify,
    body.sr-person-actions-enhanced .shopfor-people-table td.shoppee-action-cell.shoppee-action-cell-remind,
    body.sr-person-actions-enhanced .shoppee-action-cell-remove > :is(.shoppee-action-btn, .shoppee-action-disabled) {
        display: none !important;
    }

    body.sr-person-actions-enhanced .shoppee-action-cell-remove {
        grid-column: 1 / -1;
    }

    body.sr-person-actions-enhanced .sr-person-actions-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 48px;
        padding: 10px 16px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--app-link);
        font: inherit;
        font-size: 15px;
        font-weight: 600;
    }

    /* Compact people cards on the dedicated Shop For page. */
    body.shopfor-overview-page .shopfor-overview-layout {
        gap: 24px;
    }

    body.shopfor-overview-page .shopfor-overview-section {
        min-width: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    body.shopfor-overview-page .shopfor-overview-section::before {
        content: none;
    }

    body.shopfor-overview-page .shopfor-overview-section-head {
        margin-bottom: 10px;
        padding-inline: 4px;
    }

    body.shopfor-overview-page .shopfor-people-table--active > thead {
        display: none;
    }

    body.shopfor-overview-page .shopfor-people-table:is(.shopfor-people-table--active, .shopfor-people-table--prospects) {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    body.shopfor-overview-page .shopfor-people-table--active > tbody {
        gap: 8px;
    }

    body.shopfor-overview-page .shopfor-people-table > tbody > tr.shopfor-people-row:is(.evenrow, .oddrow) > td {
        border: 0;
        background: transparent !important;
    }

    body.shopfor-overview-page .shopfor-people-table > tbody > tr.shopfor-people-row:hover > td:first-child {
        box-shadow: none;
    }

    body.shopfor-overview-page .shopfor-people-table--active .shoppee-person-stack {
        --shoppee-avatar-size: 36px;
        --shoppee-name-gap: 8px;
        --shoppee-name-inline-pad: 0px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
        width: 100%;
    }

    body.shopfor-overview-page .shopfor-people-table--active :is(.shoppee-name-form, .shoppee-name-static) {
        grid-column: 1 / -1;
        width: 100%;
    }

    body.shopfor-overview-page .shopfor-people-table--active :is(.shoppee-name-link, .shoppee-name-static) {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 0;
        font-size: 15px;
        line-height: 1.35;
    }

    body.shopfor-overview-page .shopfor-people-table--active .shoppee-name-copy {
        font-size: inherit;
    }

    body.shopfor-overview-page .shopfor-people-table--active .shoppee-mobile-summary {
        grid-column: 1;
        grid-row: 2;
        align-self: center;
        margin: 0 0 0 44px;
        font-size: 12px;
        line-height: 1.4;
    }

    body.shopfor-overview-page .shopfor-people-table--active .shoppee-login-as-form {
        position: static;
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        max-width: 100%;
        margin: 0;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    body.shopfor-overview-page .shopfor-people-table--active .shoppee-login-as-btn {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 11px;
        line-height: 1.2;
        letter-spacing: 0;
        text-transform: none;
        box-shadow: none;
    }

    body.shopfor-overview-page .shoppee-login-as-btn .login-as-text { display: inline; }
    body.shopfor-overview-page .shoppee-login-as-btn .login-as-lock { display: none; }
    body.shopfor-overview-page .shoppee-person-stack::after { content: none; }

    body.shopfor-overview-page.sr-person-actions-enhanced .shopfor-people-table--active .shopfor-people-row {
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 8px;
        padding: 12px;
        border-radius: 10px;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .shopfor-people-table--active .shoppee-person-cell {
        grid-column: 1;
        grid-row: 1;
        padding: 0;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .shopfor-people-table--active td.shoppee-action-cell-remove {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        padding: 0;
        border: 0;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .sr-person-actions-trigger {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        box-shadow: none;
        font-size: 22px;
        line-height: 1;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .sr-person-actions-label {
        display: none;
    }

    body.shopfor-overview-page .shopfor-people-table--prospects {
        display: block;
        width: 100%;
    }

    body.shopfor-overview-page .shopfor-people-table--prospects > tbody {
        display: grid;
        gap: 8px;
    }

    body.shopfor-overview-page .shopfor-people-table--prospects tr:not(.shopfor-people-row) {
        display: none;
    }

    body.shopfor-overview-page .shopfor-people-table--prospects .shopfor-people-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border: 1px solid var(--app-border);
        border-radius: 10px;
        background: var(--app-surface);
    }

    body.shopfor-overview-page .shopfor-people-table--prospects td {
        display: block;
        min-width: 0;
        width: auto !important;
        padding: 0;
        border: 0;
        background: transparent;
    }

    body.shopfor-overview-page .shoppee-prospect-name {
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    body.shopfor-overview-page .shopfor-people-table--prospects .shoppee-prospect-action-btn.sr-shopfor-text-action {
        min-height: 44px;
        min-width: 0;
        max-width: 8em;
        padding: 6px 10px;
        font-size: 12px;
        line-height: 1.3;
        white-space: normal;
        box-shadow: none;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .shoppees-legend {
        margin-top: 8px;
        border: 0;
        background: transparent;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .shoppees-legend td {
        padding: 4px;
    }

    body.shopfor-overview-page.sr-person-actions-enhanced .shoppees-legend :is(.shoppees-legend-note-notify, .shoppees-legend-note-reminder, .shoppees-legend-note-remove, .shoppees-legend-sep) {
        display: none;
    }

    body.shopfor-overview-page .shopfor-empty-state {
        padding: 16px;
        border-radius: 10px;
    }

    /* Gift lists use one card surface and a compact status/action area. */
    body.shop-page .shop-page-card {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body.shop-page .shop-page-card-head {
        margin-bottom: 12px;
        padding-inline: 4px;
    }

    body.shop-page .shop-page-card-titlebar {
        gap: 8px;
    }

    body.shop-page .shop-page-card-actions {
        gap: 8px;
    }

    body.shop-page .shop-layout-switch {
        gap: 0;
        padding: 2px;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: var(--app-surface);
    }

    body.shop-page .shop-layout-link {
        min-width: 56px;
        padding: 8px 10px;
        text-decoration: none;
    }

    body.shop-page .shop-layout-btn-remind-mobile {
        margin-inline-start: auto;
        box-shadow: none;
    }

    body.shop-page .shop-enhanced-controls {
        gap: 8px;
    }

    body.shop-page .shop-enhanced-sort-form {
        gap: 8px;
    }

    body.shop-page .shop-enhanced-sort-form .select {
        min-height: 44px;
        padding-block: 6px;
        border-radius: 8px;
    }

    body.shop-page .shop-page-table-wrap {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body.shop-page .shop-list-table tbody {
        gap: 10px;
    }

    body.shop-page .shop-list-table tr {
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        border-radius: 10px;
        background: var(--app-surface);
    }

    body.shop-page .shop-list-description {
        font-size: 15px;
        line-height: 1.4;
        text-decoration: none;
    }

    body.shop-page .shop-list-meta {
        gap: 3px 10px;
        margin-top: 6px;
        line-height: 1.4;
    }

    body.shop-page .shop-list-table :is(.shop-list-price, .shop-list-status) {
        padding: 0 12px 10px;
    }

    body.shop-page .shop-list-price:not(:has(.shop-list-price-value)) {
        display: none;
    }

    body.shop-page .shop-list-row:not(:has(.shop-list-price-value)) .shop-list-status {
        grid-column: 1 / -1;
    }

    body.shop-page .shop-list-table :is(.shop-list-price, .shop-list-status) .shop-list-field-label {
        display: none;
    }

    body.shop-page .shop-list-status-value {
        display: inline-block;
        padding: 3px 8px;
        border-radius: 6px;
        background: var(--app-row-even);
        color: var(--app-muted);
        font-size: 12px;
        line-height: 1.4;
    }

    body.shop-page .shop-list-status-value:is(.is-available, .is-progress, .is-yours) {
        color: var(--app-link);
    }

    body.shop-page .shop-list-table .shop-list-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 12px 8px;
    }

    body.shop-page .shop-list-actions > :is(.foundation-fulfillment, .shop-list-copy, .shop-list-action-note) {
        grid-column: 1 / -1;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .foundation-fulfillment {
        min-width: 0;
        gap: 8px;
        margin: 0;
    }

    body.shop-page .foundation-fulfillment[data-request-type="buy"] > .foundation-fulfillment-meta:not(:has(span:nth-child(2))) {
        display: none;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .foundation-commit-form {
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    body.shop-page .foundation-commit-form label {
        min-width: 0;
        font-size: 12px;
    }

    body.shop-page .foundation-commit-form [hidden] {
        display: none !important;
    }

    body.shop-page .foundation-commit-form :is(input, select) {
        min-height: 44px;
        padding: 6px 8px;
        border-radius: 7px;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .foundation-fulfillment-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex: 1 1 100%;
        gap: 8px;
        width: 100%;
        justify-content: start;
    }

    body.shop-page .foundation-commit-form .foundation-fulfillment-actions {
        order: 1;
        flex-basis: 15rem;
    }

    body.shop-page .foundation-commit-form .foundation-fulfillment-note {
        order: 2;
        flex: 1 1 100%;
        font-size: 12px;
        line-height: 1.4;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .foundation-action-btn {
        width: 100%;
        min-height: 44px;
        padding: 8px;
        border-radius: 7px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        white-space: normal;
        box-shadow: none;
    }

    body.shop-page .shop-list-actions .shop-action-form {
        display: flex;
        min-width: 0;
        margin: 0;
    }

    body.shop-page .shop-list-actions .sr-inline-unstyled-btn {
        display: flex;
        width: 100%;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .smallbut {
        width: 100%;
        min-height: 44px;
        margin: 0;
        padding: 8px;
        border-radius: 7px;
        font-size: 12px;
        line-height: 1.3;
    }

    body.shop-page .shop-action-form--purchase .smallbut {
        border: 1px solid var(--app-border);
        background: var(--app-surface);
        color: var(--app-link);
        box-shadow: none;
    }

    body.shop-page :is(.shop-list-copy, .shop-enhanced-copy) {
        flex-basis: 100%;
    }

    body.shop-page :is(.shop-list-actions, .shop-enhanced-actions) .shop-copy-link-btn {
        width: auto;
        min-height: 44px;
        padding: 6px 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        font-size: 12px;
        line-height: 1.3;
        text-align: start;
    }

    body.shop-page .shop-enhanced-actions {
        background: transparent;
    }

    .event-native-date-enhanced .event-native-date { display: block; }
    .event-native-date-enhanced :is(.event-form-date-row, .event-legacy-date-label) { display: none; }
    .event-native-date input { box-sizing: border-box; width: 100%; }

    #srSavedMoveChoiceOverlay.sr-item-actions-sheet > [data-sr-dialog-surface] {
        max-height: min(85dvh, calc(var(--sr-sheet-viewport-height, 100dvh) - 16px));
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    dialog[data-sr-mobile-sheet] > [data-sr-dialog-surface] { transition: none; }
}
