/*
 * FYNDA MILESTONE 2.7I
 *
 * Compact Chat documents and transaction controls.
 *
 * VISUAL CHANGES ONLY.
 *
 * Preserve:
 * - quotation acceptance and rejection
 * - invoice issue and cancellation actions
 * - payment selections
 * - courier delivery workflows
 * - message composer and message history
 * - Home map and Sponsored corrections
 *
 * All document actions remain visible and reachable.
 */

@media screen {

    /* 1. COMPACT QUOTATION AND INVOICE CARDS */

    #app .fynda-chat-premium
    :is(.chat-quote, .chat-invoice) {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px 11px !important;
        margin-block: 6px !important;
        border-radius: 13px !important;
        box-shadow: 0 2px 9px rgb(8 27 51 / 6%) !important;
    }

    #app .fynda-chat-premium
    :is(.chat-quote, .chat-invoice)
    :is(h1, h2, h3) {
        margin: 0 0 5px !important;
        font-size: clamp(12px, 3.4vw, 14px) !important;
        line-height: 1.3 !important;
        overflow-wrap: anywhere;
    }

    #app .fynda-chat-premium
    :is(.chat-quote, .chat-invoice) p {
        margin-block: 3px !important;
        font-size: clamp(11px, 3vw, 12px) !important;
        line-height: 1.4 !important;
        overflow-wrap: anywhere;
    }

    #app .fynda-chat-premium
    .chat-invoice header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 5px;
        min-width: 0;
    }

    /* 2. DOCUMENT PANEL RESPONSIVENESS */

    #app .fynda-chat-premium
    .chat-documents-panel {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        gap: 7px !important;
    }

    #app .fynda-chat-premium
    .chat-tool-panel {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        gap: 7px !important;
    }

    /* 3. TRANSACTION ACTION BUTTONS */

    #app .fynda-chat-premium
    .chat-transaction-actions {
        min-width: 0;
        gap: 6px !important;
    }

    #app .fynda-chat-premium
    .chat-transaction-actions > :is(button, a) {
        min-width: 0;
        min-height: 44px !important;
        box-sizing: border-box;
        padding: 7px 8px !important;
        border-radius: 11px !important;
        font-size: clamp(11px, 3.4vw, 13px) !important;
        line-height: 1.25 !important;
        text-align: center;
        overflow-wrap: anywhere;
    }

    /* 4. COMPACT TRADE BUTTON */

    #app .fynda-chat-premium .chat-pay {
        min-height: 42px;
        box-sizing: border-box;
        padding: 6px 9px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    /* 5. PAYMENT METHOD SPACING */

    #app .fynda-chat-premium
    .chat-payment-methods {
        min-width: 0;
        gap: 6px !important;
    }

    #app .fynda-chat-premium
    .chat-payment-methods label {
        min-width: 0;
        min-height: 44px !important;
        box-sizing: border-box;
        padding: 6px 7px !important;
        overflow-wrap: anywhere;
    }

    /* 6. DIALOG CONTENT — NO FUNCTIONAL CHANGES */

    #app [role="dialog"] :is(h1, h2, h3) {
        max-width: 100%;
        margin-block: 0 8px;
        overflow-wrap: anywhere;
        line-height: 1.3;
    }

    #app [role="dialog"] :is(p, label) {
        max-width: 100%;
        overflow-wrap: anywhere;
        line-height: 1.4;
    }

    #app [role="dialog"]
    :is(button, a) {
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }
}

/* 7. VERY NARROW ANDROID SCREENS */

@media screen and (max-width: 299px) {

    #app .fynda-chat-premium
    :is(
        .chat-transaction-actions,
        .chat-payment-methods,
        .inquiry-commercial-actions
    ) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #app .fynda-chat-premium
    :is(.chat-quote, .chat-invoice) {
        padding: 8px !important;
        border-radius: 11px !important;
    }

    #app .fynda-chat-premium
    .chat-transaction-actions > :is(button, a) {
        min-height: 44px !important;
        padding-inline: 5px !important;
    }
}
