/* Moderation & Logs layout corrections. */

/* Moderator tools summary has three visual columns: copy, state badge and disclosure control. */
.app-workspace .config-panel > summary {
  grid-template-columns: minmax(0, 1fr) auto 40px !important;
  align-items: center;
}

.app-workspace .config-summary-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: center;
}

.app-workspace .config-summary-main > strong,
.app-workspace .config-summary-main > span {
  display: block;
  min-width: 0;
  margin: 0;
}

.app-workspace .config-summary-main > strong {
  color: #f8f8f8;
  font-size: 1rem;
  line-height: 1.25;
}

.app-workspace .config-summary-main > span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.app-workspace .config-summary-meta {
  justify-self: end;
  align-self: center;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #c8c8cf;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1;
}

.app-workspace .config-panel[open] .config-summary-meta {
  border-color: rgba(0,197,255,.24);
  background: rgba(0,197,255,.07);
  color: #f4f4f6;
}

.app-workspace .config-panel > summary::after {
  grid-column: 3;
  grid-row: 1;
}

/* Moderator roles use their own layout instead of the generic module/card rules.
   This keeps role names and IDs visible beside the checkbox at every width. */
.app-workspace .moderator-role-card {
  min-width: 0;
  overflow: visible;
}

.app-workspace .moderator-role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 9px;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
}

.app-workspace .moderator-role-option {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: center;
  gap: 11px;
  width: auto !important;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  padding: 10px 12px !important;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 13px;
  background: rgba(255,255,255,.028);
  cursor: pointer;
  overflow: visible !important;
}

.app-workspace .moderator-role-option:hover {
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.045);
}

.app-workspace .moderator-role-option:has(input:checked) {
  border-color: rgba(0,197,255,.34);
  background: rgba(0,197,255,.07);
}

.app-workspace .moderator-role-option > input[type="checkbox"] {
  display: block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  justify-self: center;
  accent-color: #00c5ff;
}

.app-workspace .moderator-role-copy {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 2px;
  min-width: 0;
  width: 100%;
  color: #f4f4f6;
  line-height: 1.25;
  overflow: visible;
}

.app-workspace .moderator-role-copy > strong,
.app-workspace .moderator-role-copy > small {
  display: block !important;
  min-width: 0;
  width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.app-workspace .moderator-role-copy > strong {
  color: #f4f4f6 !important;
  font-size: .88rem;
  font-weight: 800;
}

.app-workspace .moderator-role-copy > small {
  color: #92929c !important;
  font-size: .70rem;
  font-weight: 600;
}

/* Keep moderator role selection comfortably separated from its help copy. */
.app-workspace .config-body .searchable-picker + small {
  margin-top: 2px;
}

@media (max-width: 760px) {
  .app-workspace .config-panel > summary {
    grid-template-columns: minmax(0, 1fr) 38px !important;
    grid-template-rows: auto auto;
    row-gap: 8px !important;
  }

  .app-workspace .config-summary-main {
    grid-column: 1;
    grid-row: 1;
  }

  .app-workspace .config-summary-meta {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .app-workspace .config-panel > summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .app-workspace .moderator-role-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
