/* v150 — auditable scoring: every visible ability score can reveal its real sources. */

.score-history-trigger {
  cursor: pointer !important;
  text-underline-offset: 3px;
  transition: color 160ms ease, opacity 160ms ease, text-decoration-color 160ms ease !important;
}

.score-history-trigger::after {
  content: "↗";
  display: inline-block;
  margin-left: 4px;
  color: #7c5cff;
  font-size: 0.56em;
  font-weight: 950;
  line-height: 1;
  vertical-align: super;
  opacity: 0.72;
}

.score-history-trigger:hover,
.score-history-trigger:focus-visible {
  color: #6842f5 !important;
  outline: none;
  text-decoration: underline dotted rgba(104, 66, 245, 0.56);
}

.score-history-trigger:hover::after,
.score-history-trigger:focus-visible::after {
  opacity: 1;
}

.score-history-card {
  max-height: min(900px, calc(100vh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
}

.score-provenance-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(124, 92, 255, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.96), #fff);
}

.score-provenance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.score-provenance-head > div {
  display: grid;
  gap: 4px;
}

.score-provenance-head span {
  color: #6842f5;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.score-provenance-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 950;
}

.score-provenance-head em {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(124, 92, 255, 0.14);
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.08);
  color: #6948e8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.score-provenance-list {
  display: grid;
  gap: 9px;
  max-height: 294px;
  overflow: auto;
  padding-right: 3px;
}

.score-provenance-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e7eaf2;
  border-radius: 15px;
  background: #fff;
}

.score-provenance-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1edff;
  color: #6842f5;
  font-size: 12px;
  font-weight: 950;
}

.score-provenance-item[data-evidence-kind="training"] .score-provenance-icon {
  background: #e9f8ef;
  color: #11824f;
}

.score-provenance-item[data-evidence-kind="interview"] .score-provenance-icon {
  background: #eaf2ff;
  color: #2866d7;
}

.score-provenance-item[data-evidence-kind="debug"] .score-provenance-icon,
.score-provenance-item[data-evidence-kind="waveform"] .score-provenance-icon,
.score-provenance-item[data-evidence-kind="project"] .score-provenance-icon {
  background: #fff1e8;
  color: #d65d18;
}

.score-provenance-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.score-provenance-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.score-provenance-item header strong {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 920;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-provenance-item time {
  flex: 0 0 auto;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
}

.score-provenance-item p {
  overflow: hidden;
  margin: 0;
  color: #667085;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-provenance-item > em {
  padding: 6px 9px;
  border-radius: 9px;
  background: #f4f1ff;
  color: #6842f5;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.score-provenance-item[data-evidence-kind="training"] > em {
  background: #e9f8ef;
  color: #11824f;
}

.score-provenance-formula {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f7fb;
  color: #667085;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.6;
}

.score-provenance-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px dashed #d8dce8;
  border-radius: 14px;
  background: #fafbfe;
  text-align: center;
}

.score-provenance-empty strong {
  color: #344054;
  font-size: 13px;
}

.score-provenance-empty p {
  margin: 0;
  color: #98a2b3;
  font-size: 11px;
}

html[data-theme="dark"] .score-provenance-section {
  border-color: rgba(139, 111, 255, 0.24);
  background: linear-gradient(180deg, rgba(25, 31, 45, 0.98), rgba(18, 24, 36, 0.98));
}

html[data-theme="dark"] .score-provenance-head h4,
html[data-theme="dark"] .score-provenance-item header strong {
  color: #eef2ff;
}

html[data-theme="dark"] .score-provenance-item {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(30, 38, 54, 0.92);
}

html[data-theme="dark"] .score-provenance-item p,
html[data-theme="dark"] .score-provenance-formula {
  color: #aab4c8;
}

html[data-theme="dark"] .score-provenance-formula {
  background: rgba(44, 52, 70, 0.82);
}

@media (max-width: 720px) {
  .score-provenance-head {
    display: grid;
  }

  .score-provenance-head em {
    justify-self: start;
  }

  .score-provenance-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .score-provenance-icon {
    width: 34px;
    height: 34px;
  }

  .score-provenance-item > em {
    grid-column: 2;
    justify-self: start;
  }
}
