/* Citation scores, legends and result charts; loaded by the project base template. */
.sca-score-badge {
  border: 1px solid rgba(0, 0, 0, 0.75);
  color: #111 !important;
}

.sca-score-badge-danger,
.sca-score-badge-success {
  color: #fff !important;
}

.sca-score-badge-lg {
  font-size: 1.05rem;
  padding: 0.5rem 0.85rem;
}

.sca-legend-wrap {
  max-width: 100%;
}

.sca-legend-table {
  table-layout: auto;
  width: max-content;
}

.sca-legend-table td {
  padding-right: 0.35rem;
  padding-top: .25rem;
  padding-bottom: .25rem;
}

.sca-legend-table td:nth-child(2) {
  width: auto;
}

.sca-legend-count-cell {
  padding-left: 1.15rem;
  text-align: left;
  white-space: nowrap;
}

.sca-status-badge {
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.sca-match-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-align: left;
}

.sca-retained-candidate-row > * {
  border-bottom: 1px solid #333;
  border-top: 1px solid #333;
}

.sca-retained-candidate-row > :first-child {
  border-left: 1px solid #333;
}

.sca-retained-candidate-row > :last-child {
  border-right: 1px solid #333;
}

.sca-progress {
  height: 1.35rem;
  background: #edf1f5;
}

.sca-source-group {
  border-left: 4px solid #0d6efd;
}

.sca-legend-swatch-cell {
  width: 1.5rem;
}

.sca-legend-swatch {
  display: inline-block;
  width: .85rem;
  height: .85rem;
  border-radius: .2rem;
  border: 1px solid rgba(0, 0, 0, .16);
  vertical-align: middle;
}

.sca-chart-card {
  border-left: 4px solid #0d6efd;
}

.sca-chart-description {
  max-width: 72rem;
}

.sca-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-side), minmax(1.12rem, 1fr));
  gap: 2px;
  max-width: 36rem;
}

.sca-grid-cell {
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, .2);
  font-size: .52rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.sca-doi-bars {
  display: grid;
  gap: 1rem;
}

.sca-share-control {
  max-width: 52rem;
}

@media (min-width: 768px) {
  .sca-doi-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Citation filters and bibliographic comparison. */
.sca-filter-panel { border-top: 3px solid #346cac !important; }
.sca-filter-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.sca-citation-filters { display: grid; gap: 1.15rem; }
.sca-filter-search { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.sca-filter-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: end; padding: 1rem; background: #f0f5fb; border-radius: .6rem; }
.sca-filter-scores > *, .sca-filter-secondary > *, .sca-filter-search > * { min-width: 0; }
.sca-filter-secondary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; border-top: 1px solid #e2e8f0; padding-top: 1rem; }
.sca-methodology-calculation { margin: 2rem 0; padding: 1.25rem; background: #f2f6fb; border-left: 4px solid #346cac; border-radius: .4rem; scroll-margin-top: 1rem; }
.sca-element-tables { display: grid; gap: .85rem; }
.sca-score-element { min-width: 0; overflow: hidden; border: 1px solid #d9e2ec; border-radius: .5rem; }
.sca-element-table { width: 100%; table-layout: fixed; margin: 0; }
.sca-element-table caption { caption-side: top; padding: .55rem .8rem; background: #edf3fa; color: #203c5b; font-weight: 700; border-bottom: 1px solid #d9e2ec; }
.sca-element-table > tbody > tr > * { padding: .45rem .8rem; }
.sca-element-score-col { width: 6.5rem; }
.sca-element-weight-col { width: 5rem; }
.sca-element-comparison { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .5rem; }
.sca-element-side { color: #52677d; font-size: .86rem; }
.sca-element-value { overflow-wrap: anywhere; }
.sca-element-value + .sca-element-value { margin-top: .2rem; }
.sca-element-field-label { color: #5c6875; font-size: .86rem; }
.sca-element-values > tr:first-child > td { background: #f8fafc; }
.sca-element-metric-labels th { font-size: .78rem; color: #52677d; background: #f3f6f9; }
.sca-element-metrics td { overflow-wrap: anywhere; }
.sca-element-metrics .sca-manual-metadata .badge { max-width: 100%; white-space: normal; line-height: 1.25; text-align: left; }
.sca-element-metrics > tr:last-child > td { border-bottom: 0; }
.sca-legend-with-jaccard { width: 100%; }
.sca-jaccard-mini-cell { width: 23rem; max-width: 100%; padding-left: 1rem !important; }
.sca-jaccard-mini { display: grid; grid-template-columns: auto minmax(8rem, 1fr) auto; align-items: center; gap: .5rem; font-size: .875rem; }
.sca-jaccard-mini-summary { grid-template-columns: auto minmax(6rem, 1fr); }
.sca-jaccard-mini-label { color: #5a6470; white-space: nowrap; }
.sca-jaccard-mini-bar { display: flex; height: 1rem; border-radius: .2rem; background: #e9eef3; }
.sca-jaccard-mini-segment { position: relative; flex: 0 0 var(--segment-width); background: var(--segment-color); min-width: 0; }
.sca-jaccard-mini-segment:first-child { border-radius: .2rem 0 0 .2rem; }
.sca-jaccard-mini-segment:last-child { border-radius: 0 .2rem .2rem 0; }
.sca-jaccard-mini-segment:focus-visible { outline: 3px solid #173b72; outline-offset: 3px; z-index: 2; }
.sca-jaccard-values { position: relative; }
.sca-jaccard-values summary { color: #245f9e; text-decoration: underline; cursor: pointer; list-style: none; }
.sca-jaccard-values ul { position: absolute; right: 0; z-index: 5; min-width: 14rem; padding: .65rem 1rem .65rem 1.8rem; margin-top: .35rem; border: 1px solid #cbd5e1; border-radius: .4rem; background: #fff; box-shadow: 0 .2rem .6rem #0002; white-space: nowrap; }
@media (max-width: 1199.98px) {
  .sca-filter-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .sca-filter-search, .sca-filter-scores, .sca-filter-secondary { grid-template-columns: minmax(0, 1fr); }
  .sca-legend-with-jaccard tbody tr { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; }
  .sca-jaccard-mini-cell { grid-column: 1 / -1; width: auto; min-width: 0; padding: .15rem .35rem .6rem 1.5rem !important; }
  .sca-jaccard-mini { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .5rem; }
  .sca-jaccard-mini-label { grid-column: 1 / -1; white-space: normal; }
  .sca-jaccard-mini-bar { min-width: 0; height: 1.25rem; }
  .sca-jaccard-mini-summary { grid-template-columns: minmax(0, 1fr); }
  .sca-filter-heading { align-items: flex-start; flex-direction: column; gap: .5rem; }
}
@media (max-width: 479.98px) {
  .sca-element-comparison { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .sca-element-score-col { width: 5rem; }
  .sca-element-weight-col { width: 3.5rem; }
  .sca-element-table > tbody > tr > * { padding: .4rem .55rem; }
}
/* Community forms keep the DOI and short comment easy to scan. */
.sca-community-form-wrap { max-width: 56rem; }
.sca-community-table td:first-child { min-width: 20rem; max-width: 45rem; }
.sca-community-table td:not(:first-child) { min-width: 7rem; }
.sca-community-quote {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-left: .25rem solid var(--bs-primary);
  background: var(--bs-tertiary-bg);
  border-radius: 0 .4rem .4rem 0;
  overflow-wrap: anywhere;
}
.sca-community-reference {
  padding: .75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .4rem;
  overflow-wrap: anywhere;
}
[data-community-form] textarea[data-max-lines] { min-height: 5rem; max-height: 5rem; resize: none; }
[data-community-form] .errorlist { color: var(--bs-danger); padding-left: 1.2rem; }

/* Published states are visually distinct from the current score calculation. */
.sca-history-event { border-left: 3px solid #c7d5e6; padding: 1rem 1.15rem; margin: 0 0 1.5rem; background: #fff; overflow-wrap: anywhere; }
.sca-history-reference { padding: .9rem; border: 1px solid #dce4ed; border-radius: .5rem; background: #f7f9fc; }
.sca-history-details { border-top: 1px solid #e2e8f0; padding: .65rem 0; }
.sca-history-details > summary { cursor: pointer; color: #244b73; font-weight: 600; }
.sca-history-description { white-space: pre-line; }
.sca-history-color { display: inline-block; width: .8rem; height: .8rem; border-radius: .15rem; margin-right: .5rem; }
.sca-history-score-distribution { display: block; width: 100%; }
.sca-history-score-distribution > caption { display: block; }
.sca-history-score-distribution > thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sca-history-score-distribution > tbody { display: grid; gap: .75rem; }
.sca-history-score-distribution > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: .5rem; border: 1px solid var(--bs-border-color); border-radius: .4rem; }
.sca-history-score-distribution > tbody > tr > * { display: block; min-width: 0; padding: .5rem; border: 0; }
.sca-history-score-distribution > tbody > tr > th { background: var(--bs-tertiary-bg); border-radius: .25rem; }
.sca-history-distribution-cell { width: auto; min-width: 0; }
.sca-history-distribution-cell .sca-jaccard-mini-summary { grid-template-columns: minmax(0, 1fr); gap: .25rem; margin-bottom: .25rem; }
.sca-history-period-label { margin-right: .35rem; }
@media (min-width: 768px) {
  .sca-history-score-distribution { display: table; }
  .sca-history-score-distribution > caption { display: table-caption; }
  .sca-history-score-distribution > thead { position: static; display: table-header-group; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; }
  .sca-history-score-distribution > tbody { display: table-row-group; }
  .sca-history-score-distribution > tbody > tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
  .sca-history-score-distribution > tbody > tr > * { display: table-cell; padding: .5rem; border-bottom: var(--bs-border-width) solid var(--bs-border-color); }
  .sca-history-score-distribution > tbody > tr > th { min-width: 7.5rem; background: transparent; border-radius: 0; }
  .sca-history-distribution-cell { width: 40%; }
  .sca-history-period-label { display: none; }
}
#citation-history { scroll-margin-top: 1rem; }
