.role-weight-row,
.judge-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.role-weight-row select,
.judge-select-row select {
  min-width: 0;
  flex: 1;
}
.role-weight-row .weight-input {
  width: 95px;
  flex-shrink: 0;
}
.role-weight-row > button,
.judge-select-row > button {
  flex-shrink: 0;
}
.weight-total {
  font-size: 14px;
  color: var(--green);
  line-height: 1.8;
}
.weight-total.invalid {
  color: #a25925;
  font-weight: 600;
}
.scoring-history-table {
  font-size: 14px;
}
.rule-change-notice {
  line-height: 1.9;
}
@media (max-width: 700px) {
  .role-weight-row {
    flex-wrap: wrap;
  }
  .role-weight-row select {
    min-width: 145px;
  }
}

.form-grid:has(.role-weights) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.role-weight-row select {
  min-width: 140px;
}

#judges-editor {
  min-width: 0;
}
#judges-editor [hidden] {
  display: none !important;
}
.judge-search-label {
  margin-bottom: 10px;
}
.judge-search-help {
  margin-bottom: 16px;
}
.judge-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 10px 0;
  background: var(--paper, #fff);
  overflow: hidden;
}
.judge-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 54px;
}
.judge-group > summary::-webkit-details-marker {
  display: none;
}
.judge-group > summary::before {
  content: "›";
  font-size: 23px;
  line-height: 1;
  color: var(--green);
  width: 12px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.judge-group[open] > summary::before {
  transform: rotate(90deg);
}
.judge-group > summary strong {
  font-size: 16px;
}
.judge-group-count {
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.judge-group[open] > summary {
  background: var(--light);
  border-bottom: 1px solid var(--line);
}
.judge-group-body {
  padding: 12px;
}
.judge-group-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.judge-group-tools .btn {
  font-size: 13px;
  padding: 7px 10px;
  min-height: 36px;
}
.judge-options {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.judge-option {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
}
.judge-option:hover {
  background: #f6f9f5;
}
.judge-option:has(input:checked) {
  background: var(--light);
  border-color: #c8d9ca;
}
.judge-option:has(input:disabled) {
  cursor: default;
}
.judge-option input[type="checkbox"] {
  appearance: auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}
.judge-option > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.judge-option strong {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.judge-option small {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.judge-no-match {
  margin: 8px;
}
@media (max-width: 600px) {
  .judge-group > summary {
    padding: 14px 12px;
  }
  .judge-options {
    max-height: 300px;
  }
}
