/* Static adaptation of tc-highlighter's panels, tree rows and highlight colors. */
.collector-demo,
.collector-demo * {
  box-sizing: border-box;
}

.product-preview.product-preview--collector {
  padding: 0;
  background: #fff;
}

.collector-demo {
  container: collector-demo / inline-size;
  width: 100%;
  color: #374151;
  font-size: .75rem;
  line-height: 1.4;
}

.collector-demo__stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 550px;
  margin-inline: auto;
  gap: 10px;
  min-height: 0;
  padding: 20px;
}

.collector-demo__panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #e3ecf8;
  border-radius: 8px;
}

.collector-demo .collector-demo__title {
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
  background: #f9fafb;
  color: #374151;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
}

.collector-demo__text {
  padding: 10px;
  line-height: 1.5;
}

.collector-demo__text p {
  margin: 12px 0;
  font-size: inherit;
  line-height: inherit;
}

.collector-demo__mark {
  padding: 2px 0;
  border-radius: 3px;
  background: rgba(34,197,94,.25);
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.collector-demo__mark--negative {
  background: rgba(239,68,68,.25);
}

.collector-demo__source {
  white-space: nowrap;
}

.collector-demo__lines {
  display: grid;
  gap: 4px;
}

.collector-demo__lines i {
  display: block;
  height: 4px;
  border-radius: 3px;
  background: #e5e7eb;
  opacity: .75;
}

.collector-demo__lines i:nth-child(2) {
  width: 88%;
}

.collector-demo__lines i:nth-child(3) {
  width: 56%;
}

.collector-demo__arrow {
  align-self: center;
  justify-self: center;
  color: #2563eb;
  font-size: 1.6rem;
  transform: rotate(90deg);
}

.collector-demo__tree {
  padding: 8px;
}

.collector-demo .collector-demo__group {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 5px;
  padding: 0 7px;
  border-left: 0;
  border-radius: 6px;
  background: #eaf1ff;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}

.collector-demo .collector-demo__children {
  list-style: none;
  margin: 0 0 7px 9px;
  padding: 0 0 0 10px;
  border-left: 2px dashed #d1d5db;
}

.collector-demo .collector-demo__children:last-child {
  margin-bottom: 0;
}

.collector-demo__row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 45px;
  margin: 0 0 5px;
  padding: 0 8px;
  border-radius: 6px;
  background: #eaf1ff;
  font-size: .75rem;
  line-height: 1.4;
}

/* A fixed half-row hints at further results without joining the animation. */
.collector-demo__continuation {
  height: 23px;
  overflow: hidden;
  opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.collector-demo__check {
  display: inline-grid;
  place-items: center;
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin-top: 0;
  border-radius: 3px;
  background: #2196f3;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.collector-demo__row--negative {
  border: 0;
  color: inherit;
  font-style: normal;
}

.collector-demo__destination {
  white-space: nowrap;
}

.collector-demo__chip {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
  font: inherit;
  line-height: 1.4;
  color: #374151;
}

.collector-demo__chip::before {
  content: '';
  position: absolute;
  inset: -3px -5px;
  z-index: -1;
  border-radius: 4px;
  background: #dcfce7;
  border: 1px solid #86efac;
  box-shadow: 0 2px 7px #16653418;
}

.collector-demo.is-animated .collector-demo__chip {
  display: block;
  opacity: 0;
}

.collector-demo.is-animated .collector-demo__source {
  background: transparent;
}

/* Compact tc-highlighter tree: disclosure, selection, label and location controls. */
.collector-demo__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 8px 8px 0 0;
}

.collector-demo__header .collector-demo__title {
  border: 0;
  flex: 1;
  padding-right: 0;
}

.collector-demo__badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 12px;
  background: #cce8ff;
  color: #126eb5;
  font-size: .7rem;
  font-weight: 500;
}

.collector-demo__tools,
.collector-demo__actions {
  display: flex;
  align-items: center;
  color: #74808a;
  white-space: nowrap;
}

.collector-demo__tools {
  gap: 12px;
}

.collector-demo__icon {
  display: block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.collector-demo__tools .collector-demo__icon {
  width: 16px;
  height: 16px;
}

.collector-demo__group-label {
  padding: 7px 6px;
  border-left: 3px solid #2196f3;
  border-radius: 5px;
}

.collector-demo__result {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

.collector-demo__label {
  flex: 1;
  min-width: 0;
  padding: 7px 0;
  overflow-wrap: anywhere;
}

.collector-demo__actions {
  gap: 5px;
  font-size: .65rem;
  flex: 0 0 auto;
}

.collector-demo__actions .collector-demo__icon {
  width: 11px;
  height: 11px;
  flex-basis: 11px;
}

.collector-demo__count {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eee;
  color: #777;
}

.collector-demo__row--negative .collector-demo__label {
  border-left: 3px solid #ef6268;
  border-radius: 5px;
  padding-left: 6px;
  color: #ef6268;
  font-style: italic;
}

.collector-demo__target {
  position: relative;
}

@container collector-demo (max-width: 350px) {
  .collector-demo__actions {
    gap: 3px;
  }

  .collector-demo__tree {
    padding: 6px;
  }

  /* Keep the unbroken animation label clear of the location controls. */
  .collector-demo__result {
    flex-wrap: wrap;
    gap: 0;
  }

  .collector-demo__label {
    flex-basis: 100%;
  }

  .collector-demo__actions {
    padding-bottom: 7px;
  }
}

@container collector-demo (min-width: 560px) {
  @media (min-width: 851px) {
    .collector-demo__stage {
      max-width: none;
      grid-template-columns: minmax(0, .85fr) 18px minmax(0, 1.4fr);
      gap: 8px;
      padding: 15px;
    }

    .collector-demo__arrow {
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .collector-demo .collector-demo__chip {
    display: none;
  }
}
