/* Wider customer portal with compact ticket metadata and no horizontal scrolling. */
.pstm-portal {
    position: relative;
    left: 50%;
    width: min(1180px, calc(100vw - 32px));
    max-width: none;
    margin: 32px 0;
    transform: translateX(-50%);
}

.pstm-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
    gap: 8px;
    justify-content: start;
    margin: 14px 0 20px;
}

.pstm-meta div {
    min-width: 0;
    min-height: 62px;
    padding: 9px 12px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: #fff;
}

.pstm-meta dt {
    margin: 0;
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.pstm-meta dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

/* Keep the conversation open on the page instead of inside a tinted panel. */
.pstm-portal .pstm-conversation {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pstm-conversation article.agent {
    border: 1px solid #d8e0e9;
    background: #f1f3f5 !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
}

.pstm-image-size-message {
    display: block;
    margin: 8px 0 0 !important;
    color: #b42318 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.45 !important;
}

.pstm-image-size-message[hidden] {
    display: none !important;
}

.pstm-customer-tickets {
    width: 100%;
    overflow: visible;
}

.pstm-customer-tickets table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.pstm-customer-tickets th,
.pstm-customer-tickets td {
    min-width: 0;
    padding: 11px 12px;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
}

.pstm-customer-tickets th:nth-child(1) { width: 22%; }
.pstm-customer-tickets th:nth-child(2) { width: 28%; }
.pstm-customer-tickets th:nth-child(3) { width: 19%; }
.pstm-customer-tickets th:nth-child(4) { width: 13%; }
.pstm-customer-tickets th:nth-child(5) { width: 18%; }

@media (max-width: 720px) {
    .pstm-portal {
        left: auto;
        width: auto;
        margin: 20px 12px;
        transform: none;
    }

    .pstm-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pstm-customer-tickets {
        border: 0;
        border-radius: 0;
    }

    .pstm-customer-tickets table,
    .pstm-customer-tickets tbody,
    .pstm-customer-tickets tr,
    .pstm-customer-tickets td {
        display: block;
        width: 100%;
    }

    .pstm-customer-tickets thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .pstm-customer-tickets tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px 16px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid #dbe5f0;
        border-radius: 12px;
        background: #fff;
    }

    .pstm-customer-tickets td {
        padding: 0;
        border: 0;
    }

    .pstm-customer-tickets td::before {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .pstm-customer-tickets td:nth-child(1)::before { content: "Ticket ID"; }
    .pstm-customer-tickets td:nth-child(2)::before { content: "Subject"; }
    .pstm-customer-tickets td:nth-child(3)::before { content: "Status"; }
    .pstm-customer-tickets td:nth-child(4)::before { content: "Priority"; }
    .pstm-customer-tickets td:nth-child(5)::before { content: "Updated"; }
}

@media (max-width: 480px) {
    .pstm-meta,
    .pstm-customer-tickets tr {
        grid-template-columns: 1fr;
    }
}
