/* APOM Chat – dedicated mobile message action sheet */
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
    .message-row .message-actions {
        display: none !important;
    }

    .message-bubble {
        -webkit-touch-callout: none;
        touch-action: pan-y;
        user-select: none;
    }

    .message-row.is-mobile-selected .message-bubble {
        outline: 2px solid rgba(157, 55, 77, .32);
        outline-offset: 2px;
    }

    .apom-mobile-action-overlay {
        position: fixed;
        inset: 0;
        z-index: 2147483646;
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }

    .apom-mobile-action-overlay[hidden] {
        display: none !important;
    }

    .apom-mobile-action-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(12, 16, 24, .42);
        backdrop-filter: blur(1.5px);
        -webkit-backdrop-filter: blur(1.5px);
    }

    .apom-mobile-action-sheet {
        position: relative;
        width: 100%;
        max-height: min(78dvh, 620px);
        padding: 8px 12px max(12px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
        animation: apomSheetIn .18s ease-out;
    }

    .apom-mobile-action-handle {
        width: 42px;
        height: 5px;
        margin: 2px auto 10px;
        border-radius: 999px;
        background: #c8ccd2;
    }

    .apom-mobile-action-list {
        display: grid;
        gap: 2px;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        border-radius: 15px;
        background: #fff;
    }

    .apom-mobile-action-item,
    .apom-mobile-action-cancel {
        appearance: none;
        width: 100%;
        min-height: 54px;
        border: 0;
        background: #fff;
        color: #20242b;
        font: inherit;
        font-size: 16px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .apom-mobile-action-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
        border-bottom: 1px solid #edf0f3;
    }

    .apom-mobile-action-item:last-child {
        border-bottom: 0;
    }

    .apom-mobile-action-item:active,
    .apom-mobile-action-cancel:active {
        background: #f2f4f7;
    }

    .apom-mobile-action-item.is-danger {
        color: #a52d42;
    }

    .apom-mobile-action-icon {
        display: inline-grid;
        place-items: center;
        width: 28px;
        font-size: 20px;
    }

    .apom-mobile-action-cancel {
        margin-top: 9px;
        padding: 12px 16px;
        border: 1px solid #e5e7eb;
        border-radius: 15px;
        color: #9d374d;
        text-align: center;
    }

    html.apom-mobile-actions-open,
    body.apom-mobile-actions-open {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    @keyframes apomSheetIn {
        from { transform: translateY(100%); opacity: .75; }
        to { transform: translateY(0); opacity: 1; }
    }

    @media (prefers-reduced-motion: reduce) {
        .apom-mobile-action-sheet { animation: none; }
    }
}

/* APOM Chat – mobile Aktionsmenü im Dark Mode */
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
    :root[data-theme="dark"] .apom-mobile-action-backdrop {
        background: rgba(2, 6, 14, .66);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    :root[data-theme="dark"] .apom-mobile-action-sheet {
        background: #151c27;
        color: #f3f4f6;
        box-shadow: 0 -16px 46px rgba(0, 0, 0, .52);
    }

    :root[data-theme="dark"] .apom-mobile-action-handle {
        background: #6b7280;
    }

    :root[data-theme="dark"] .apom-mobile-action-list {
        background: #171e29;
        border-color: #303846;
    }

    :root[data-theme="dark"] .apom-mobile-action-item,
    :root[data-theme="dark"] .apom-mobile-action-cancel {
        background: #171e29;
        color: #f3f4f6;
    }

    :root[data-theme="dark"] .apom-mobile-action-item {
        border-bottom-color: #303846;
    }

    :root[data-theme="dark"] .apom-mobile-action-item:active,
    :root[data-theme="dark"] .apom-mobile-action-cancel:active {
        background: #222b39;
    }

    :root[data-theme="dark"] .apom-mobile-action-item.is-danger {
        color: #fb7185;
    }

    :root[data-theme="dark"] .apom-mobile-action-cancel {
        border-color: #303846;
        color: #fb5f78;
    }
}
