/* Audit filters and comparison share the existing surface/control tokens. */
.ui-audit-filters { margin-block-end: var(--space-5, 20px); }
.ui-audit-filters .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ui-audit-filters label { min-width: 0; }
.ui-audit-filters .form-actions { display: flex; gap: 8px; margin-block-start: 16px; }
.ui-audit-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-start: 16px; }
.ui-audit-comparison { margin-block: 12px; max-height: none; }
.ui-audit-comparison table { min-width: 0; }
.ui-audit-comparison td, .ui-audit-comparison th { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 767px) {
 .ui-audit-filters .form-grid { grid-template-columns: 1fr; }
 .ui-audit-pagination { flex-wrap: wrap; }
}

/* Expanded comparison and JSON span the audit table, never its narrow final column. */
.ui-audit-table > tbody > .ui-audit-expanded-row > td { max-width: none; width: auto; white-space: normal; padding: 16px; background: var(--subtle); }
.ui-audit-expanded-panel { width: 100%; min-width: 0; max-width: 100%; }
.ui-audit-expanded-panel .ui-audit-comparison { width: 100%; background: var(--surface); }
.ui-audit-expanded-panel .ui-audit-comparison table { width: 100%; table-layout: fixed; }
.ui-audit-expanded-panel .ui-audit-comparison th:first-child { width: 30%; }
.ui-audit-expanded-panel .ui-audit-comparison th:not(:first-child) { width: 35%; }
.ui-audit-expanded-panel .ui-audit-json { box-sizing: border-box; width: 100%; margin-bottom: 0; }
@media (max-width: 767px) {
 #content .ui-audit-table > tbody > .ui-audit-expanded-row { padding: 12px; }
 #content .ui-audit-table > tbody > .ui-audit-expanded-row > td { display: block; padding: 0; background: transparent; }
 #content .ui-audit-table > tbody > .ui-audit-expanded-row > td::before { display: none; }
 .ui-audit-expanded-panel .ui-audit-comparison { margin-top: 0; }
}
