.ps-size-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e6e8ec;
    border-radius: 6px;
}

/* Force real table layout (admin Bootstrap resets th/td padding to 0). */
.ps-size-scroll .ps-size-table {
    display: table;
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 0.925rem;
    table-layout: auto;
    margin: 0;
    background-color: #fff;
}

.ps-size-scroll .ps-size-table thead {
    display: table-header-group;
}

.ps-size-scroll .ps-size-table tbody {
    display: table-row-group;
}

.ps-size-scroll .ps-size-table tr {
    display: table-row;
}

.ps-size-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 0.925rem;
}

.ps-size-scroll .ps-size-table th,
.ps-size-scroll .ps-size-table td {
    display: table-cell;
    border: 1px solid #d9dde3;
    padding: 0.65rem 0.75rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.ps-size-table th,
.ps-size-table td {
    border: 1px solid #d9dde3;
    padding: 0.65rem 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.ps-size-table thead th {
    background: #17191c;
    color: #fff;
}

.ps-size-table tbody tr:nth-child(even) td,
.ps-size-table tbody tr:nth-child(even) th {
    background: #fafbfc;
}

.ps-size-table th:first-child,
.ps-size-table td:first-child {
    position: sticky;
    left: 0;
    background: #f4f5f7;
    font-weight: 700;
    z-index: 1;
    text-align: left;
}

.ps-size-table thead th:first-child {
    background: #17191c;
    z-index: 2;
}

.ps-size-note {
    color: #555;
    font-size: 0.875rem;
    margin: 0.85rem 0 0;
    line-height: 1.45;
}

.ps-size-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
}

.ps-size-guide-btn {
    margin-left: 10px;
    vertical-align: middle;
    font-size: 0.85em;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
}

.ps-size-guide-btn:hover,
.ps-size-guide-btn:focus {
    opacity: 0.75;
    outline: none;
}

.ps-size-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ps-size-modal.is-open {
    display: flex;
}

.ps-size-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ps-size-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    max-width: min(960px, 100%);
    max-height: 90vh;
    width: 100%;
    overflow: auto;
    padding: 18px 20px 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.ps-size-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eceef2;
}

.ps-size-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.ps-size-modal__close {
    border: 0;
    background: #f3f4f6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #333;
    flex-shrink: 0;
}

.ps-size-modal__close:hover {
    background: #e8eaee;
}

@media (max-width: 575px) {
    .ps-size-modal {
        padding: 8px;
        align-items: flex-end;
    }

    .ps-size-modal__dialog {
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
        padding: 16px;
    }

    .ps-size-table {
        font-size: 0.85rem;
    }
}
