/* Desktop Modals - Centered presentation for action drawers */

@media (min-width: 768px) {

    /* Action Card Drawer & Action Detail Sheet */
    /* High specificity to override sheets.css */
    body .slide-up-sheet.action-card-drawer .sheet-content,
    body .slide-up-sheet.action-detail-sheet .sheet-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 480px !important;
        height: auto !important;
        max-height: 85vh !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
        border: 1px solid var(--brokerly-border-light) !important;

        /* Initial state - CENTERED but scaled down. No vertical offset to prevent 'drawer' feel */
        transform: translate(-50%, -50%) scale(0.95) !important;

        /* Reset sliding animation and use fade/scale instead */
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 0;
    }

    body .slide-up-sheet.active.action-card-drawer .sheet-content,
    body .slide-up-sheet.active.action-detail-sheet .sheet-content {
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    /* Flip Sheet - allows wider content for the flip cards */
    body .slide-up-sheet.action-card-flip-sheet .sheet-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        /* Allow it to match the .flip-card-container width which scales from 500px to 600px based on screen size */
        max-width: 600px !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
        border: 1px solid var(--brokerly-border-light) !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s ease, border-radius 0.3s ease !important;
        opacity: 0;
    }

    body .slide-up-sheet.active.action-card-flip-sheet .sheet-content {
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }


    /* Proposed Actions (Discover) Drawer */
    /* Target via ID for maximum specificity */
    #proposed-actions-overlay.slide-up-sheet .sheet-content,
    body .slide-up-sheet.proposed-actions-drawer .sheet-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 500px !important;
        height: auto !important;
        max-height: 85vh !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
        border: 1px solid var(--brokerly-border-light) !important;

        /* Initial state - CENTERED */
        transform: translate(-50%, -50%) scale(0.95) !important;

        /* Reset sliding animation */
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 0;
    }

    #proposed-actions-overlay.slide-up-sheet.active .sheet-content,
    body .slide-up-sheet.active.proposed-actions-drawer .sheet-content {
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    /* Hide handle */
    body .slide-up-sheet.action-card-drawer .sheet-handle,
    body .slide-up-sheet.action-detail-sheet .sheet-handle,
    body .slide-up-sheet.action-card-flip-sheet .sheet-handle,
    body .slide-up-sheet.proposed-actions-drawer .sheet-handle,
    #proposed-actions-overlay .sheet-handle {
        display: none !important;
    }

    /* Ensure backdrop covers everything */
    .sheet-backdrop {
        background: var(--brokerly-backdrop-bg);
        backdrop-filter: blur(4px);
        transition: opacity 0.3s ease;
    }

    /* Explicitly handle the 'card flight' landing zone */
    /* Action Card Drawer needs flex to center the card */
    body .slide-up-sheet.action-card-drawer .drawer-card-host,
    body .slide-up-sheet.action-card-flip-sheet .sheet-body {
        padding: 0 0 16px 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Action Detail Sheet uses standard block layout */
    body .slide-up-sheet.action-detail-sheet .sheet-body {
        padding: 0 0 16px 0 !important;
        width: 100% !important;
        display: block !important;
    }




}