[data-module-disabled] { display: none !important; }
#modules-page { min-height: 0; overflow-y: auto; }
.module-group { margin-block: 1rem; }
.module-group h2 { font-size: 1rem; margin: .5rem 0; }
.module-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .875rem; }
.module-table th, .module-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.module-table thead th { color: var(--muted); font-weight: 600; }
.module-table thead th:nth-child(1) { width: 5rem; white-space: nowrap; overflow-wrap: normal; }
.module-table thead th:nth-child(2) { width: 3.5rem; white-space: nowrap; overflow-wrap: normal; }
.module-table thead th:nth-child(3) { width: 12%; }
.module-table thead th:nth-child(4) { width: auto; }
.module-table thead th:nth-child(5) { width: 15%; }
.module-table thead th:nth-child(6) { width: 7rem; }
.module-name { font-weight: 600; }
.module-description { color: var(--muted); line-height: 1.45; }
.module-icon { font-size: 1.3rem; text-align: center !important; }
.module-key code { font-size: .8rem; }
.module-key small, .module-file-count small { display: block; color: var(--muted); font-size: .75rem; margin-top: .2rem; }
.module-files-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .4rem; }
.module-activation input { width: 1.15rem; height: 1.15rem; }
.module-toggle-label { display: inline-flex; align-items: center; margin: 0; }
.module-files-row[hidden] { display: none; }
.module-files-row > td { background: var(--soft); }
.module-file-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.module-file-groups h3 { font-size: .85rem; margin: .35rem 0; }
.module-file-groups ul { margin: .35rem 0; padding-left: 1.2rem; }
.module-file-groups code { font-size: .75rem; overflow-wrap: anywhere; }
.module-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-block: .75rem; position: sticky; top: 0; z-index: 1; background: var(--canvas); }
#modules-status { min-height: 1.5em; }
#modules-status:empty { display: none; }
#modules-status.module-pending { color: var(--error); font-weight: 600; }
@media (max-width: 600px) {
  .module-table, .module-table tbody { display: block; }
  .module-table thead { display: none; }
  .module-table .module-option { display: grid; grid-template-columns: 1.25rem 1.5rem minmax(0, 1fr); gap: .3rem .6rem; padding: .65rem; margin-block: .6rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--paper); }
  .module-table .module-option > td, .module-table .module-option > th { display: block; padding: 0; border: 0; }
  .module-icon { grid-column: 2; grid-row: 1; }
  .module-name { grid-column: 3; grid-row: 1; }
  .module-description { grid-column: 2 / -1; grid-row: 2; }
  .module-key { grid-column: 2 / -1; grid-row: 3; }
  .module-file-count { grid-column: 2 / -1; grid-row: 4; }
  .module-file-count small { display: inline; margin-left: .5rem; }
  .module-activation { grid-column: 1; grid-row: 1; }
  .module-table .module-files-row:not([hidden]), .module-files-row > td { display: block; }
  .module-files-row > td { border: 1px solid var(--line); border-radius: .6rem; }
  .module-file-groups { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .module-actions > button { flex: 1 1 10rem; }
}
