/* Optional presentation only: the original controls, row order and submission names stay in place. */
table[data-grid-layout] .grid-card-toggle,
table[data-grid-layout] .grid-card-summary { display:none; }
table.grid-layout-cards { display:block; width:100%; border:0 !important; background:transparent; }
table.grid-layout-cards > thead { display:none; }
table.grid-layout-cards > tbody { display:block; }
table.grid-layout-cards > tbody > tr.grid-card-item {
    display:grid; grid-template-columns:repeat(var(--grid-card-columns, 2),minmax(0,1fr));
    margin:0 0 16px; border:1px solid #cbd5e1; border-radius:10px;
    overflow:hidden; background:#fff; box-shadow:0 2px 5px #0f172a0a;
}
table.grid-layout-cards > tbody > tr.grid-card-item > td {
    display:block; width:auto !important; min-width:0; max-width:none !important;
    padding:14px 16px !important; border:0; border-bottom:1px solid #e2e8f0;
    text-align:left !important; white-space:normal; overflow-wrap:anywhere;
    background:transparent; box-shadow:none;
}
table.grid-layout-cards > tbody > tr.grid-card-item > td:not(:first-child)::before {
    content:attr(data-card-label); display:block; margin-bottom:7px;
    color:#475569; font-weight:600; font-size:.8rem;
}
table.grid-layout-cards > tbody > tr.grid-card-item > td:first-child {
    grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:10px;
    background:#f1f5f9; font-weight:600;
}
table.grid-layout-cards .grid-card-toggle { display:inline-block; margin-left:auto; order:2; }
table.grid-layout-cards .grid-card-summary { display:block; flex:1 1 220px; color:#1e293b; font-size:.9rem; }
table.grid-layout-cards > tbody > tr.grid-card-collapsed > td:not(:first-child) { display:none; }
table.grid-layout-cards input:not([type=checkbox]):not([type=hidden]),
table.grid-layout-cards select, table.grid-layout-cards textarea { max-width:100%; }
table.grid-layout-cards > tfoot { display:block; border:1px solid #cbd5e1; border-radius:8px; background:#eff6ff; }
table.grid-layout-cards > tfoot > tr { display:flex; flex-wrap:wrap; gap:16px; padding:12px 16px; }
table.grid-layout-cards > tfoot > tr > :is(th,td) { display:block; width:auto !important; border:0; background:transparent; box-shadow:none; padding:0; }
table.grid-layout-cards > tfoot > tr > :is(th,td):empty { display:none; }
table.grid-layout-cards > tfoot > tr > :is(th,td):not(:first-child):not(:empty)::before { content:attr(data-card-label) ': '; font-weight:500; }
table.grid-layout-cards > tbody > tr.grid-card-empty { display:block; }
table.grid-layout-cards > tbody > tr.grid-card-empty > td { display:block; width:100%; }
@media(max-width:760px) { table.grid-layout-cards > tbody > tr.grid-card-item { grid-template-columns:1fr; } }
@media print {
    table.grid-layout-cards .grid-card-toggle { display:none; }
    table.grid-layout-cards > tbody > tr.grid-card-collapsed > td:not(:first-child) { display:block; }
    table.grid-layout-cards > tbody > tr.grid-card-item { break-inside:avoid; }
}

@media print { .grid-user-view-switch { display:none !important; } }
