.testament-view {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
  min-width: 0;
}

.testament-view *::highlight(find-all) {
  background-color: var(--background-color-yellow-subtle);
}

.testament-view *::highlight(find-current) {
  background-color: var(--background-color-yellow);
  color: var(--color-on-solid);
}

.testament-view .testament-reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.testament-view .testament-reader > .artifact-view {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 64dvh;
}

.testament-view .testament-view > .tei-view {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  border: var(--border-width-base) solid var(--border-color-subtle);
  border-radius: var(--border-radius-base);
}

.testament-view [data-diff-state='unchanged'] {
  border: var(--border-width-base) solid var(--border-color-subtle);
  outline: none;
}

.testament-view [data-diff-state='added'], .testament-view .diff-wrap-added .prompt-text-view, .testament-view .diff-wrap-added .sense-editor-view, .testament-view .diff-wrap-added .sentiment-definition-view, .testament-view .diff-wrap-added .text-input-input:not(.form-info-panel *), .testament-view .diff-wrap-added .text-area-input:not(.form-info-panel *), .testament-view .diff-wrap-added .dropdown-trigger:not(.form-info-panel *) {
  border-color: var(--border-color-green) !important;
  outline: var(--border-width-base) solid var(--border-color-green) !important;
  outline-offset: 0px !important;
}

.testament-view [data-diff-state='removed'], .testament-view .diff-wrap-removed .prompt-text-view, .testament-view .diff-wrap-removed .sense-editor-view, .testament-view .diff-wrap-removed .sentiment-definition-view, .testament-view .diff-wrap-removed .text-input-input:not(.form-info-panel *), .testament-view .diff-wrap-removed .text-area-input:not(.form-info-panel *), .testament-view .diff-wrap-removed .dropdown-trigger:not(.form-info-panel *) {
  border-color: var(--border-color-red) !important;
  outline: var(--border-width-base) solid var(--border-color-red) !important;
  outline-offset: 0px !important;
}

.testament-view [data-diff-state='changed'], .testament-view .diff-wrap-changed .prompt-text-view, .testament-view .diff-wrap-changed .sense-editor-view, .testament-view .diff-wrap-changed .sentiment-definition-view, .testament-view .diff-wrap-changed .text-input-input:not(.form-info-panel *), .testament-view .diff-wrap-changed .text-area-input:not(.form-info-panel *), .testament-view .diff-wrap-changed .dropdown-trigger:not(.form-info-panel *) {
  border-color: var(--border-color-orange) !important;
  outline: var(--border-width-base) solid var(--border-color-orange) !important;
  outline-offset: 0px !important;
}

.testament-view [data-diff-state='focused'] {
  border-color: var(--border-color-blue-focus) !important;
  outline: var(--border-width-base) solid var(--border-color-blue-focus) !important;
  outline-offset: 0px !important;
}

.testament-view [data-diff-annotation][data-visible='false'], .testament-view [data-form-item-annotation][data-visible='false'] {
  display: none;
}

.testament-view .text-input-control:has(> [data-form-item-annotation]), .testament-view .dropdown-container:has(> [data-form-item-annotation]), .testament-view .dropdown-search-input-wrapper:has(> [data-form-item-annotation]) {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
}

.testament-view .testament-reader > .artifact-view .artifact-markup[data-diff-state='added'] {
  border: var(--border-width-base) solid var(--border-color-green) !important;
  outline-offset: calc(-2 * var(--border-width-base)) !important;
}

.testament-view .testament-reader > .artifact-view .artifact-markup[data-diff-state='removed'] {
  border: var(--border-width-base) solid var(--border-color-red) !important;
  outline-offset: calc(-2 * var(--border-width-base)) !important;
}

.testament-view .testament-reader > .artifact-view .artifact-markup[data-diff-state='changed'] {
  border: var(--border-width-base) solid var(--border-color-orange) !important;
  outline-offset: calc(-2 * var(--border-width-base)) !important;
}

.testament-view .artifact-markup-frame > .artifact-markup[data-diff-state] {
  outline: none !important;
}

.testament-view .artifact-markup-frame:has(> .artifact-markup[data-diff-state='added'])::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--border-width-base) solid var(--border-color-green);
  outline: var(--border-width-base) solid var(--border-color-green);
  outline-offset: calc(-2 * var(--border-width-base));
  pointer-events: none;
  z-index: 1;
}

.testament-view .artifact-markup-frame:has(> .artifact-markup[data-diff-state='removed'])::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--border-width-base) solid var(--border-color-red);
  outline: var(--border-width-base) solid var(--border-color-red);
  outline-offset: calc(-2 * var(--border-width-base));
  pointer-events: none;
  z-index: 1;
}

.testament-view .artifact-markup-frame:has(> .artifact-markup[data-diff-state='changed'])::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--border-width-base) solid var(--border-color-orange);
  outline: var(--border-width-base) solid var(--border-color-orange);
  outline-offset: calc(-2 * var(--border-width-base));
  pointer-events: none;
  z-index: 1;
}

.testament-view .artifact-markup-frame:has(> .artifact-markup[data-diff-state='stale'])::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--border-width-base) solid var(--border-color-orange);
  outline: var(--border-width-base) solid var(--border-color-orange);
  outline-offset: calc(-2 * var(--border-width-base));
  pointer-events: none;
  z-index: 1;
}

.testament-view .testament-reader > .artifact-view .artifact-markup[data-diff-state='stale'] {
  border: var(--border-width-base) solid var(--border-color-orange) !important;
  outline-offset: calc(-2 * var(--border-width-base)) !important;
}

.testament-view .testament-page-loading {
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100%;
  padding: var(--spacing-16);
  color: var(--color-blue);
}

.testament-view[data-page-loading='true'] .testament-page-loading {
  display: flex;
}

.testament-view[data-page-loading='true'] .artifact-markup .tei-view {
  display: none;
}

.testament-view .testament-diffs {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.testament-view .testament-diff[data-active='false'] {
  display: none;
}

.testament-view .testament-diff[data-edited='false'] {
  display: none;
}

.testament-view .testament-diff .tei-view {
  display: none;
}

.testament-view .testament-diff[data-edited='true'][data-active='true'] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-8);
  min-width: 0;
}

.testament-view .testament-diff > .resemblance-diff-view {
  align-self: stretch;
  min-width: 0;
}

.testament-view:not(:has(.artifact-xml-toggle[aria-pressed='true'])) .testament-diff {
  display: none !important;
}

.testament-view .testament-translation-diff {
  display: none;
  align-self: stretch;
  min-width: 0;
}

[data-translated='true'] .testament-view .testament-translation-diff {
  display: block;
}

[data-translated='true'] .testament-view .testament-diff > .resemblance-diff-view {
  display: none !important;
}

[data-translated='true'] .testament-view .testament-diff[data-translation-edited='false'] {
  display: none !important;
}

[data-translated='true'] .testament-view:has(.artifact-xml-toggle[aria-pressed='true']) .testament-diff[data-translation-edited='true'][data-active='true'] {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-8);
  min-width: 0;
}
