#knowledge-candidate-screen {
  font-size: 12px;
}

.candidate-screen-head,
.candidate-title-line,
.candidate-actions,
.candidate-filters,
.candidate-pagination,
.candidate-detail-heading,
.candidate-detail-meta,
.candidate-lineage-summary {
  display: flex;
  align-items: center;
}

.candidate-screen-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.candidate-screen-head h3 {
  margin: 0;
  font-size: 16px;
}

.candidate-screen-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.candidate-title-line,
.candidate-actions {
  gap: 8px;
}

.candidate-info {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
}

.candidate-actions button,
.candidate-pagination button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.candidate-actions button:disabled,
.candidate-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.candidate-message {
  min-height: 28px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-message.loading::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.candidate-message.success { color: #8ff0ce; }
.candidate-message.error { color: #ff9f9f; }

.candidate-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.candidate-metric {
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.candidate-metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.candidate-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.candidate-filters {
  min-height: 48px;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.candidate-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-filters select {
  min-width: 132px;
  height: 32px;
  font-size: 12px;
}

.candidate-filter-context {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.candidate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(430px, 0.95fr);
  gap: 10px;
  min-height: 550px;
}

.candidate-list-panel,
.candidate-detail-panel {
  min-width: 0;
  min-height: 550px;
  padding: 14px;
}

.candidate-table-wrap {
  max-height: 445px;
  overflow: auto;
}

.candidate-table {
  table-layout: fixed;
}

.candidate-table th,
.candidate-table td {
  padding: 8px 6px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.candidate-table th:first-child { width: 27%; }
.candidate-table th:nth-child(2) { width: 10%; }
.candidate-table th:nth-child(3) { width: 17%; }
.candidate-table th:nth-child(4) { width: 12%; }
.candidate-table th:nth-child(5) { width: 8%; }
.candidate-table th:nth-child(6) { width: 8%; }
.candidate-table th:nth-child(7) { width: 18%; }

.candidate-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.candidate-table tbody tr[data-candidate-id] {
  cursor: pointer;
  outline: none;
}

.candidate-table tbody tr[data-candidate-id]:hover,
.candidate-table tbody tr[data-candidate-id]:focus,
.candidate-table tbody tr.selected {
  background: rgba(96, 165, 250, 0.12);
}

.candidate-pagination {
  justify-content: flex-end;
  gap: 8px;
  min-height: 40px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-detail-panel {
  max-height: 610px;
  overflow: auto;
}

.candidate-detail-heading {
  justify-content: space-between;
  gap: 8px;
}

.candidate-detail-heading h4 {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.candidate-detail-meta,
.candidate-lineage-summary {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-detail-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.candidate-detail-section h5 {
  margin: 0 0 8px;
  font-size: 12px;
}

.candidate-tree,
.candidate-evidence-list {
  display: grid;
  gap: 6px;
}

.candidate-tree-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.36fr) minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.025);
}

.candidate-tree-key {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.candidate-tree-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-evidence-item {
  padding: 8px;
  border-left: 2px solid rgba(94, 234, 212, 0.45);
  background: rgba(255, 255, 255, 0.025);
}

.candidate-evidence-item header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.candidate-evidence-item p {
  margin: 0 0 5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.candidate-evidence-item small {
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.candidate-evidence-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.candidate-evidence-pagination button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.candidate-empty {
  display: grid;
  place-items: center;
  min-height: 100px;
  color: var(--muted);
  text-align: center;
}

.candidate-empty.error { color: #ff9f9f; }

.candidate-lineage {
  margin-top: 10px;
}

.candidate-lineage summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
}

.candidate-lineage dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 6px;
  margin: 8px 0 0;
}

.candidate-lineage dt { color: var(--muted); }
.candidate-lineage dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 1180px) {
  .candidate-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .candidate-layout { grid-template-columns: 1fr; }
  .candidate-detail-panel { max-height: none; }
}
