/* Site-wide support chat widget — below account bar (999990) */
.b2b-support-root {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    left: auto;
    z-index: 999980;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}

.b2b-support-root > * {
    pointer-events: auto;
}

.b2b-support-launcher-wrap {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.b2b-support-root .b2b-support-launcher {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px !important;
    border: none !important;
    border-radius: 999px !important;
    background: #0f766e !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
    transition: background 0.2s ease, transform 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.b2b-support-root .b2b-support-launcher:hover,
.b2b-support-root .b2b-support-launcher:focus {
    background: #0d9488 !important;
    color: #fff !important;
    outline: none;
}

.b2b-support-root .b2b-support-launcher[aria-expanded="true"] {
    background: #115e59 !important;
}

.b2b-support-launcher__icon {
    font-size: 16px;
    line-height: 1;
}

.b2b-support-launcher__label {
    display: inline !important;
    white-space: nowrap;
}

.b2b-support-root .b2b-support-dismiss {
    position: absolute;
    top: -6px;
    right: -6px;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #64748b !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    appearance: none;
    -webkit-appearance: none;
    z-index: 2;
}

.b2b-support-root .b2b-support-dismiss:hover,
.b2b-support-root .b2b-support-dismiss:focus {
    background: #f1f5f9 !important;
    color: #334155 !important;
    outline: none;
}

.b2b-support-panel {
    width: min(360px, calc(100vw - 32px));
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.b2b-support-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 8px;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.b2b-support-panel__eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f766e;
}

.b2b-support-panel__title {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.b2b-support-root .b2b-support-panel__close {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #64748b !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.b2b-support-root .b2b-support-panel__close:hover,
.b2b-support-root .b2b-support-panel__close:focus {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    outline: none;
}

.b2b-support-panel__intro {
    margin: 0;
    padding: 10px 16px 0;
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
}

.b2b-support-panel__faq-link {
    color: #0f766e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.b2b-support-panel__faq-link:hover {
    color: #0d9488;
}

.b2b-support-form {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.b2b-support-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.b2b-support-field input,
.b2b-support-field select,
.b2b-support-field textarea {
    font: inherit;
    font-weight: 400;
    font-size: 14px;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.b2b-support-field input:focus,
.b2b-support-field select:focus,
.b2b-support-field textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.b2b-support-field input[readonly] {
    background: #f8fafc;
    color: #475569;
}

.b2b-support-field textarea {
    resize: vertical;
    min-height: 88px;
}

.b2b-support-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.b2b-support-status {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 8px;
}

.b2b-support-status--ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.b2b-support-status--err {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.b2b-support-submit {
    border: none;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 14px;
    cursor: pointer;
}

.b2b-support-submit:hover {
    background: #0d9488;
}

.b2b-support-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .b2b-support-root {
        right: max(12px, env(safe-area-inset-right, 0px));
        /* Sit above phone chrome / sticky footers */
        bottom: max(72px, calc(12px + env(safe-area-inset-bottom, 0px)));
        left: max(12px, env(safe-area-inset-left, 0px));
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        max-width: none;
        width: auto;
    }

    .b2b-support-root .b2b-support-launcher {
        padding: 12px 14px !important;
        font-size: 13px !important;
        min-height: 48px !important;
        border-radius: 999px !important;
        width: auto !important;
        height: auto !important;
    }

    /* Keep text visible — icon-only was easy to miss */
    .b2b-support-launcher__label {
        display: inline !important;
    }

    .b2b-support-panel {
        position: fixed;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: max(132px, calc(72px + env(safe-area-inset-bottom, 0px)));
        width: auto;
        max-width: none;
        max-height: min(70vh, 520px);
        margin-bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 380px) {
    .b2b-support-root .b2b-support-launcher {
        padding: 11px 12px !important;
    }

    .b2b-support-launcher__label {
        font-size: 12px;
    }
}
