/* Worksheet tables: keep genuine rows/cells, including in print. */
.q-body table.problem-data-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 20px auto !important;
    max-width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    color: #1d2939;
    font-variant-numeric: tabular-nums;
    break-inside: avoid;
}
.q-body .problem-data-table tbody { display: table-row-group; }
.q-body .problem-data-table tr { display: table-row; }
.q-body .problem-data-table td {
    display: table-cell;
    border: 0 !important;
    border-right: 1px solid #d8e0ea !important;
    border-bottom: 1px solid #d8e0ea !important;
    padding: 12px 16px !important;
    text-align: center;
    vertical-align: middle;
    line-height: 1.4;
}
.q-body .problem-data-table tr:last-child td { border-bottom: 0 !important; }
.q-body .problem-data-table td:last-child { border-right: 0 !important; }
.q-body table.magic-square {
    width: 192px;
    table-layout: fixed;
    box-shadow: 0 4px 16px rgb(16 24 40 / 5%);
}
.q-body .magic-square td {
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    padding: 0 !important;
    font-size: 22px;
    font-weight: 600;
}
.q-body .magic-square td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 63px;
}
.q-body .magic-square td.magic-square-blank {
    background: #eff6ff;
    color: #175cd3;
    font-weight: 700;
}
@media print {
    .q-body table.problem-data-table { box-shadow: none; border-color: #64748b; }
    .q-body .magic-square td.magic-square-blank { color: #111; }
}