.tablesinposts-wrapper {
    display: block;
    max-width: 100%;
    margin: 1em 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.tablesinposts-table {
    width: auto;
    min-width: 320px;
    max-width: none;
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent;
}

.tablesinposts-table th,
.tablesinposts-table td {
    min-width: 80px;
    padding: 8px 10px;
    border: 1px solid rgba(127, 127, 127, 0.55);
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
}

.tablesinposts-table th {
    font-weight: 700;
    background: rgba(127, 127, 127, 0.14);
}

.tablesinposts-table tr:nth-child(even) td {
    background: rgba(127, 127, 127, 0.06);
}

.tablesinposts-caption {
    padding: 0 0 8px;
    font-weight: 700;
    text-align: left;
    caption-side: top;
}

.tablesinposts-align-left {
    text-align: left !important;
}

.tablesinposts-align-center {
    text-align: center !important;
}

.tablesinposts-align-right {
    text-align: right !important;
}

.tablesinposts-button {
    vertical-align: middle;
}

.tablesinposts-overlay[hidden] {
    display: none !important;
}

.tablesinposts-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
}

.tablesinposts-dialog-open {
    overflow: hidden;
}

.tablesinposts-dialog {
    position: relative;
    box-sizing: border-box;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    padding: 22px;
    overflow: auto;
    border-radius: 5px;
    background: #f7f7f7;
    color: #333;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.tablesinposts-dialog h3 {
    margin: 0 36px 8px 0;
    font-size: 1.35em;
}

.tablesinposts-dialog p {
    margin: 0 0 16px;
}

.tablesinposts-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    line-height: 30px;
    cursor: pointer;
}

.tablesinposts-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.tablesinposts-fields label,
.tablesinposts-wide-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 700;
}

.tablesinposts-fields input {
    width: 100%;
    box-sizing: border-box;
}

.tablesinposts-wide-field {
    margin-bottom: 14px;
}

.tablesinposts-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
    cursor: pointer;
}

.tablesinposts-check input {
    margin-top: 2px;
}

.tablesinposts-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

@media (max-width: 500px) {
    .tablesinposts-dialog {
        padding: 18px;
    }

    .tablesinposts-fields {
        grid-template-columns: 1fr;
    }
}

@media print {
    .tablesinposts-wrapper {
        overflow: visible;
    }

    .tablesinposts-table {
        width: 100%;
        min-width: 0;
    }
}
