/*
 * SpotTheCopy compact-results pass.
 * Load after acceptance.css and folder-matches.css. Presentation only.
 */

/* Shared, folder-first file rows: title and details stay readable; the action
   occupies the same compact row on the right rather than taking a new line. */
#folder-list .folder-file .member-card,
#folder-list .inline-copy-list .member-card,
#folder-matches-list .difference-side .member-card,
#folder-matches-list .folder-detail-list .member-card,
.member-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 1px;
  min-width: 0;
  padding: 5px 8px !important;
}

#folder-list .folder-file .member-title-line,
#folder-list .inline-copy-list .member-title-line,
#folder-matches-list .member-title-line,
.member-title-line {
  display: flex;
  grid-column: 1 !important;
  grid-row: 1;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 7px;
  min-width: 0;
  line-height: 1.3;
}

#folder-list .member-hierarchy,
#folder-matches-list .member-hierarchy,
.member-hierarchy {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  color: #52675b;
  font-size: 14px;
}

#folder-list .member-name,
#folder-matches-list .member-name,
.member-name {
  color: #182b29;
  font-size: 16px !important;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: normal;
}

#folder-list .member-detail-line,
#folder-matches-list .member-detail-line,
.member-detail-line {
  display: flex;
  grid-column: 1 !important;
  grid-row: 2;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 11px;
  min-width: 0;
  margin: 0 !important;
  color: #52675b;
  font-size: 14px;
  line-height: 1.3;
}

#folder-list .member-actions,
#folder-matches-list .member-actions,
.member-actions {
  display: flex;
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  align-self: center;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  min-width: max-content;
}

#folder-list .member-actions .copy-action,
#folder-list .member-actions .view-copies,
#folder-matches-list .member-actions .copy-action,
#folder-matches-list .member-actions .view-copies,
.member-actions .copy-action,
.member-actions .view-copies {
  min-height: 36px !important;
  padding: 4px 9px !important;
  border: 1px solid #aabdb1;
  border-radius: 5px;
  background: #f7faf8;
  color: #245a43;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

#folder-list .member-actions .copy-action:hover,
#folder-list .member-actions .view-copies:hover,
#folder-matches-list .member-actions .copy-action:hover,
#folder-matches-list .member-actions .view-copies:hover,
.member-actions .copy-action:hover,
.member-actions .view-copies:hover {
  background: #eaf4ee;
}

#folder-list .member-feedback:empty,
#folder-matches-list .member-feedback:empty,
.member-feedback:empty {
  display: none !important;
}

#folder-list .member-feedback[role="status"],
#folder-matches-list .member-feedback[role="status"],
.member-feedback[role="status"] {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 0 !important;
  margin: 2px 0 0 !important;
  color: #245a43;
  font-size: 14px;
  line-height: 1.35;
}

/* Inline identical copies follow the same action alignment as every other row. */
.scanner-footer{flex-wrap:wrap}
.scanner-footer .legal-links{flex-basis:100%;display:flex;flex-wrap:wrap;gap:8px 22px}
.scanner-footer .legal-links a,.pre-scan-legal a{color:#245a43;text-underline-offset:3px}
.pre-scan-legal{border-top:1px solid #dce4de;margin-top:14px;padding-top:8px}
#results-view .member-title-line .file-type-icon {
  width:auto;
  height:24px;
  min-width:24px;
  min-height:24px;
  padding-inline:4px;
  flex:0 0 auto;
  align-self:center;
}
#folder-matches-list .folder-participants:has(details[open]) {
  grid-template-columns:minmax(0,1fr);
}
#folder-list .inline-copy-list .member-card {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 1px 12px !important;
  padding: 4px 7px !important;
}

#folder-list .inline-copy-list .member-title-line {
  grid-column: 1 !important;
}

#folder-list .inline-copy-list .member-detail-line {
  grid-column: 1 !important;
}

#folder-list .inline-copy-list .member-actions {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  justify-content: flex-end;
}

/* Paired differences read as one relationship, not two separate large cards. */
#folder-matches-list .difference-group.paired-content {
  padding: 8px 10px 9px;
  border: 1px solid #dce6df;
  border-radius: 6px;
  background: #f8faf8;
}

#folder-matches-list .paired-content > .member-card + .identical-connector,
#folder-matches-list .paired-content > .identical-connector + .member-card {
  margin-top: 4px;
}

#folder-matches-list .identical-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 23px;
  color: #245a43;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

#folder-matches-list .identical-connector::before,
#folder-matches-list .identical-connector::after {
  height: 1px;
  flex: 1 1 auto;
  background: #d8e4db;
  content: "";
}

#folder-matches-list .difference-group.ambiguous-content {
  padding: 8px 10px;
  border-left: 3px solid #91a99a;
  border-radius: 3px;
  background: #f4f7f4;
}

/* Keep principal sets distinct without introducing another heavy card layer. */
#folder-matches-list .folder-principal-list {
  display: grid;
  gap: 14px;
  margin-block: 12px;
}

#folder-matches-list .folder-principal-list > * + * {
  padding-top: 12px;
  border-top: 1px solid #d8e2dc;
}

#folder-matches-list .comparison-id {
  display: inline-block;
  margin: 0 7px 5px 0;
  padding: 2px 7px;
  border: 1px solid #c5d9cb;
  border-radius: 4px;
  background: #edf6ef;
  color: #245a43;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#folder-matches-list details.related-comparisons {
  margin: 10px 0 4px;
  border: 1px solid #d8e2dc;
  border-radius: 6px;
  background: #fbfcfb;
}

#folder-matches-list details.related-comparisons > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 5px;
  color: #245a43;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

#folder-matches-list details.related-comparisons > summary::-webkit-details-marker {
  display: none;
}

#folder-matches-list details.related-comparisons > summary::before {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #52675b;
  border-bottom: 2px solid #52675b;
  content: "";
  transform: rotate(-45deg);
}

#folder-matches-list details.related-comparisons[open] > summary::before {
  transform: translateY(-2px) rotate(45deg);
}

#folder-matches-list .related-comparisons > :not(summary) {
  margin-inline: 10px;
}

#folder-matches-list .folder-overlap-warning {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid #91a99a;
  border-radius: 3px;
  background: #f2f6f3;
  color: #40574a;
  font-size: 14px;
  line-height: 1.45;
}

#folder-list :where(button, summary, a, [tabindex]):focus-visible,
#folder-matches-list :where(button, summary, a, [tabindex]):focus-visible,
.member-card :where(button, summary, a, [tabindex]):focus-visible {
  outline: 3px solid #a45b16;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #f7f9f8;
}

@media (max-width: 760px) {
  #folder-list .folder-file .member-card,
  #folder-list .inline-copy-list .member-card,
  #folder-matches-list .difference-side .member-card,
  #folder-matches-list .folder-detail-list .member-card,
  .member-card {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 2px;
  }

  #folder-list .member-title-line,
  #folder-matches-list .member-title-line,
  .member-title-line {
    grid-column: 1 !important;
    grid-row: auto;
  }

  #folder-list .member-detail-line,
  #folder-matches-list .member-detail-line,
  .member-detail-line {
    grid-column: 1 !important;
    grid-row: auto;
  }

  #folder-list .member-actions,
  #folder-matches-list .member-actions,
  .member-actions,
  #folder-list .inline-copy-list .member-actions {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-content: flex-start;
    min-width: 0;
    margin-top: 2px;
  }

  #folder-list .inline-copy-list .member-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #folder-list .inline-copy-list .member-title-line,
  #folder-list .inline-copy-list .member-detail-line {
    grid-column: 1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #folder-matches-list details.related-comparisons > summary::before {
    transition: none;
  }
}
