.module-shell {
  display: grid;
  align-content: start;
  gap: 24px;
  min-width: 0;
}

.module-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.module-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.module-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.module-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}

.module-controls select {
  min-height: 44px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  cursor: pointer;
}

.module-controls select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.module-shell .panel {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 2px 5px #29161d05;
}

.module-shell .panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  margin-bottom: 14px;
}

.module-shell .panel-title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.module-shell .panel-header .module-intro {
  margin-top: 4px;
}

.module-shell .panel-header > strong {
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.module-shell .stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.module-shell .module-stat {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

.module-shell .module-stat:first-child {
  background: var(--accent-soft);
  border-color: transparent;
}

.module-shell .module-stat dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.module-shell .module-stat dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(18px, 2.3vw, 25px);
  font-weight: 700;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.module-shell .module-stat:first-child dd {
  color: var(--accent);
}

.module-shell .stats-row + .module-intro,
.module-shell .table-wrap + .module-intro {
  margin-top: 14px;
  font-size: 13px;
}

.module-shell .module-empty {
  padding-block: 36px;
}

.module-shell .module-empty .panel-title {
  margin-top: 12px;
}

.module-shell .module-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.module-shell .table-wrap {
  max-width: 100%;
  overflow: auto;
}

.module-shell .table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.module-shell .module-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.module-shell .module-table :is(th, td) {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

.module-shell .module-table thead th {
  color: var(--muted);
  background: #faf6f7;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.module-shell .module-table thead th:first-child {
  border-top-left-radius: 8px;
}

.module-shell .module-table thead th:last-child {
  border-top-right-radius: 8px;
}

.module-shell .module-table tbody tr:last-child > * {
  border-bottom: 0;
}

.module-shell .module-table tbody th {
  font-weight: 650;
}

.module-shell .module-grid .module-table tr > :last-child {
  text-align: right;
  white-space: nowrap;
}

.module-shell .module-grid .module-table td strong {
  color: var(--accent);
}

.module-shell .performance-table td {
  white-space: nowrap;
}

.module-shell .performance-table .progress-track {
  min-width: 34px;
  max-width: 84px;
  margin-top: 5px;
}

.module-shell .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f2edef;
  color: #5e5158;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}

.module-shell .badge.success {
  background: #e9f4ee;
  color: #246449;
}

.module-shell .badge.warning {
  background: #fff0de;
  color: #844a17;
}

.module-shell .progress-track {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.module-shell .progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.module-shell .rule-list {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.module-shell .rule-list details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8f9;
}

.module-shell .rule-list summary {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: inherit;
  font-weight: 650;
  cursor: pointer;
}

.module-shell .rule-list summary::marker {
  color: var(--accent);
}

.module-shell .rule-list summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.module-shell .rule-list p {
  margin: 0;
  padding: 0 12px 12px 27px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .module-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .module-shell {
    gap: 16px;
  }

  .module-shell .panel {
    padding: 16px;
    border-radius: 13px;
  }

  .module-shell .module-table :is(th, td) {
    padding: 11px 8px;
  }

  .module-shell .performance-table :is(th, td) {
    padding-inline: 6px;
    font-size: 12px;
  }

  .module-shell .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .module-shell .module-stat:first-child {
    grid-column: 1 / -1;
  }
}

.module-shell .panel-title,
.module-shell .rule-list :is(summary, p),
.module-shell .module-table tbody th { overflow-wrap: anywhere; }

.export-button {
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.export-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.export-button:disabled { opacity: .65; }
