.bf-redaction-tool {
  margin: 40px auto 0;
  max-width: 1130px;
  border-top: 1px solid #1dd8c5;
  padding-top: 26px;
  color: #dceced;
}

.bf-redaction-tool [hidden] {
  display: none !important;
}

.bf-redaction-tool-heading,
.bf-redaction-review > header,
.bf-redaction-page > header,
.bf-redaction-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bf-redaction-tool-heading p,
.bf-redaction-tool-heading h2,
.bf-redaction-stage h3,
.bf-redaction-stage p,
.bf-redaction-review h3,
.bf-redaction-review p,
.bf-redaction-download h3,
.bf-redaction-download p {
  margin: 0;
}

.bf-redaction-tool-heading p {
  color: #61e4d8;
  font-size: 12px;
  font-weight: 700;
}

.bf-redaction-tool-heading h2 {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1.2;
}

.bf-redaction-tool-heading > span {
  border: 1px solid #e2b43f;
  color: #f2cc69;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 700;
}

.bf-redaction-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 3px solid #e2b43f;
  background: #141c1d;
  font-size: 13px;
  line-height: 1.55;
}

.bf-redaction-notice strong {
  color: #f2cc69;
  white-space: nowrap;
}

.bf-redaction-cookie-policy {
  margin: 16px 0 20px;
  border: 1px solid #31565a;
  background: #08181b;
}

.bf-redaction-cookie-policy summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 0 13px;
  color: #dceced;
  cursor: pointer;
  list-style: none;
}

.bf-redaction-cookie-policy summary::-webkit-details-marker {
  display: none;
}

.bf-redaction-cookie-policy summary::after {
  content: "+";
  color: #61e4d8;
  font-size: 18px;
  line-height: 1;
}

.bf-redaction-cookie-policy[open] summary::after {
  content: "\2212";
}

.bf-redaction-cookie-label {
  color: #61e4d8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.bf-redaction-cookie-state {
  justify-self: end;
  color: #9ab0b3;
  font-size: 12px;
}

.bf-redaction-cookie-policy.has-active-cookie .bf-redaction-cookie-state {
  color: #66e7a0;
}

.bf-redaction-cookie-body {
  border-top: 1px solid #31565a;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.bf-redaction-cookie-body > p {
  margin: 0;
}

.bf-redaction-cookie-body > p strong {
  color: #f4ffff;
}

.bf-redaction-cookie-body dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0;
  background: #31565a;
}

.bf-redaction-cookie-body dl > div {
  min-width: 0;
  padding: 10px 12px;
  background: #0b2023;
}

.bf-redaction-cookie-body dt {
  color: #61e4d8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.bf-redaction-cookie-body dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.bf-redaction-cookie-body code {
  color: #f4ffff;
}

.bf-redaction-cookie-legal {
  color: #9ab0b3;
}

.bf-redaction-cookie-legal a {
  color: #61e4d8;
  text-underline-offset: 3px;
}

.bf-redaction-cookie-legal a:hover,
.bf-redaction-cookie-legal a:focus-visible {
  color: #f4ffff;
}

.bf-redaction-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
  background: #264649;
  border: 1px solid #264649;
}

.bf-redaction-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  background: #091a1d;
  color: #88a4a7;
  font-size: 12px;
}

.bf-redaction-steps li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #43676a;
  border-radius: 50%;
  flex: 0 0 auto;
}

.bf-redaction-steps li.is-active {
  color: #f4ffff;
  background: #103134;
}

.bf-redaction-steps li.is-active span,
.bf-redaction-steps li.is-done span {
  border-color: #1dd8c5;
  color: #1dd8c5;
}

.bf-redaction-status {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-left: 3px solid #5f8588;
  background: #0c2427;
  font-size: 13px;
}

.bf-redaction-status[data-kind="ok"] { border-color: #35d37d; }
.bf-redaction-status[data-kind="attention"] { border-color: #e2b43f; }
.bf-redaction-status[data-kind="error"] { border-color: #ff6078; }
.bf-redaction-status[data-kind="cat"] { border-color: #ca79c9; }

.bf-redaction-status[data-kind="cat"] {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.bf-redaction-stage,
.bf-redaction-review,
.bf-redaction-download {
  border: 1px solid #31565a;
  background: #0b2023;
  padding: 20px;
}

.bf-redaction-stage {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(280px, 1.4fr) auto;
  gap: 18px;
  align-items: center;
}

.bf-redaction-statements-stage {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.bf-redaction-bank-picker,
.bf-redaction-upload-modes {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.bf-redaction-bank-picker legend,
.bf-redaction-upload-modes legend {
  margin-bottom: 10px;
  color: #f4ffff;
  font-weight: 700;
}

.bf-redaction-bank-picker > label {
  display: block;
  margin-bottom: 7px;
  color: #9ab0b3;
  font-size: 12px;
}

.bf-redaction-bank-picker > input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  border: 1px solid #31565a;
  background: #07171b;
  color: #e9f7f8;
  padding: 10px 12px;
  font: inherit;
}

.bf-redaction-bank-quick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.bf-redaction-tool .bf-redaction-bank-quick button {
  min-width: 0;
  border-color: #31565a;
  background: #0a191c;
  color: #c7dcde;
  overflow-wrap: anywhere;
}

.bf-redaction-tool .bf-redaction-bank-quick button[aria-pressed="true"] {
  border-color: #1dd8c5;
  background: #12383b;
  color: #f4ffff;
}

.bf-redaction-statement-upload {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(250px, 1fr) minmax(280px, 1.2fr);
  gap: 18px;
  align-items: center;
  border-top: 1px solid #31565a;
  padding-top: 18px;
}

.bf-redaction-upload-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bf-redaction-upload-modes legend {
  grid-column: 1 / -1;
  font-size: 12px;
}

.bf-redaction-upload-modes label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  border: 1px solid #31565a;
  padding: 10px;
  cursor: pointer;
}

.bf-redaction-upload-modes label:has(input:checked)::after {
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 3px;
  background: #1dd8c5;
  color: #061015;
  content: "\2713";
  font-size: 12px;
  font-weight: 800;
}

.bf-redaction-upload-modes label:has(input:checked) {
  border-color: #1dd8c5;
  background: #12383b;
}

.bf-redaction-upload-modes span,
.bf-redaction-upload-modes strong,
.bf-redaction-upload-modes small {
  display: block;
}

.bf-redaction-upload-modes small {
  margin-top: 3px;
  color: #9ab0b3;
}

.bf-redaction-statements-name {
  margin: 0;
  color: #9ab0b3;
  font-size: 12px;
}

.bf-redaction-stage p,
.bf-redaction-review p,
.bf-redaction-download p {
  margin-top: 6px;
  color: #9ab0b3;
  font-size: 13px;
  line-height: 1.5;
}

.bf-redaction-upload {
  display: block;
  min-width: 0;
  border: 1px dashed #1dd8c5;
  padding: 15px;
  cursor: pointer;
}

.bf-redaction-upload strong,
.bf-redaction-upload span {
  display: block;
}

.bf-redaction-upload span {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #9ab0b3;
  font-size: 12px;
}

.bf-redaction-upload input {
  width: 100%;
  margin-top: 10px;
  color: #dceced;
}

.bf-redaction-tool button,
.bf-redaction-download a {
  min-height: 42px;
  border: 1px solid #1dd8c5;
  border-radius: 4px;
  background: #1dd8c5;
  color: #041517;
  padding: 10px 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.bf-redaction-tool button:disabled {
  border-color: #4c6366;
  background: #26393b;
  color: #84999b;
  cursor: not-allowed;
}

.bf-redaction-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bf-redaction-tool .bf-redaction-secondary {
  border-color: #527276;
  background: transparent;
  color: #c6dcde;
}

.bf-redaction-review > header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.bf-redaction-review > header > strong {
  color: #1dd8c5;
  white-space: nowrap;
}

.bf-redaction-sequence {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid #e2b43f;
  background: #181d18;
  font-size: 12px;
}

.bf-redaction-sequence ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.bf-redaction-holder-check {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid #e2b43f;
  background: #181d18;
  font-size: 12px;
}

.bf-redaction-holder-check p {
  margin: 5px 0 9px;
}

.bf-redaction-holder-check label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bf-redaction-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bf-redaction-page {
  min-width: 0;
  border-top: 1px solid #31565a;
  padding-top: 12px;
}

.bf-redaction-page > header {
  margin-bottom: 9px;
}

.bf-redaction-page h4 {
  margin: 0;
  font-size: 15px;
}

.bf-redaction-page > header span {
  color: #8ba5a8;
  font-size: 11px;
}

.bf-redaction-page-visual {
  position: relative;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}

.bf-redaction-page-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.bf-redaction-tool .bf-redaction-overlay {
  position: absolute;
  min-height: 0;
  border: 2px solid #e2b43f;
  border-radius: 1px;
  background: rgba(226, 180, 63, .25);
  padding: 0;
}

.bf-redaction-tool .bf-redaction-overlay.is-selected {
  border-color: #ff405f;
  background: rgba(15, 18, 19, .9);
}

.bf-redaction-candidates {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.bf-redaction-candidates label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid #29484b;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.bf-redaction-candidates label:has(input:checked) {
  border-color: #ff6078;
  background: #26161a;
}

.bf-redaction-candidates p {
  margin: 0;
}

.bf-redaction-final-check {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #31565a;
}

.bf-redaction-final-check > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 13px;
}

.bf-redaction-download {
  margin-top: 16px;
}

.bf-redaction-working {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(3, 15, 17, .92);
  text-align: center;
}

.bf-redaction-working > span {
  width: 54px;
  height: 54px;
  border: 3px solid #294c4f;
  border-top-color: #1dd8c5;
  border-radius: 50%;
  animation: bf-redaction-spin .85s linear infinite;
}

.bf-redaction-working strong {
  font-size: 18px;
}

.bf-redaction-working small {
  color: #8fb0b3;
}

.bf-redaction-request-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  border: 1px solid #31565a;
  background: #08181b;
  padding: 10px 12px;
}

.bf-redaction-request-preview-bar > span {
  min-width: 0;
}

.bf-redaction-request-preview-bar small,
.bf-redaction-request-preview-bar strong {
  display: block;
}

.bf-redaction-request-preview-bar small {
  color: #61e4d8;
  font-size: 10px;
  font-weight: 700;
}

.bf-redaction-request-preview-bar strong {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.bf-redaction-document-viewer {
  width: min(1120px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  border: 1px solid #1dd8c5;
  border-radius: 4px;
  background: #061417;
  color: #dceced;
  padding: 0;
}

.bf-redaction-document-viewer::backdrop {
  background: rgba(2, 10, 12, .88);
}

.bf-redaction-document-viewer > section {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.bf-redaction-document-viewer > section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid #31565a;
  padding: 12px 14px;
}

.bf-redaction-document-viewer > section > header > div {
  min-width: 0;
}

.bf-redaction-document-viewer > section > header small,
.bf-redaction-document-viewer > section > header strong {
  display: block;
}

.bf-redaction-document-viewer > section > header small {
  color: #61e4d8;
  font-size: 10px;
  font-weight: 700;
}

.bf-redaction-document-viewer > section > header strong {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.bf-redaction-tool .bf-redaction-document-viewer > section > header button,
.bf-redaction-tool .bf-redaction-document-viewer nav button {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border-color: #527276;
  background: transparent;
  color: #dceced;
  padding: 0;
  font-size: 20px;
}

.bf-redaction-document-viewer nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border-bottom: 1px solid #31565a;
  padding: 7px 14px;
}

.bf-redaction-document-viewer nav > span:not(.bf-redaction-document-viewer-spacer) {
  min-width: 88px;
  color: #a8c4c7;
  text-align: center;
  font-size: 12px;
}

.bf-redaction-document-viewer-spacer {
  flex: 1 1 auto;
}

.bf-redaction-document-viewer-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  background: #020b0d;
  padding: 18px;
}

.bf-redaction-document-viewer-stage canvas,
.bf-redaction-document-viewer-stage img {
  display: block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .45);
}

.bf-redaction-document-viewer-stage p {
  max-width: 620px;
  margin: 24px auto;
  border-left: 3px solid #e2b43f;
  background: #181d18;
  color: #f2cc69;
  padding: 12px 14px;
  line-height: 1.5;
}

@keyframes bf-redaction-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .bf-redaction-stage {
    grid-template-columns: 1fr;
  }

  .bf-redaction-pages {
    grid-template-columns: 1fr;
  }

  .bf-redaction-notice {
    grid-template-columns: 1fr;
  }

  .bf-redaction-notice strong {
    white-space: normal;
  }

  .bf-redaction-bank-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bf-redaction-statement-upload {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .bf-redaction-cookie-policy summary {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 9px 12px;
  }

  .bf-redaction-cookie-state {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .bf-redaction-cookie-policy summary::after {
    grid-column: 2;
    grid-row: 1;
  }

  .bf-redaction-cookie-body dl {
    grid-template-columns: 1fr;
  }

  .bf-redaction-tool-heading,
  .bf-redaction-review > header,
  .bf-redaction-download {
    align-items: flex-start;
    flex-direction: column;
  }

  .bf-redaction-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .bf-redaction-stage,
  .bf-redaction-review,
  .bf-redaction-download {
    padding: 14px;
  }

  .bf-redaction-request-preview-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bf-redaction-request-preview-bar strong {
    white-space: normal;
  }

  .bf-redaction-request-preview-bar button {
    width: 100%;
  }

  .bf-redaction-stage-actions,
  .bf-redaction-stage-actions button,
  .bf-redaction-download a {
    width: 100%;
  }

  .bf-redaction-document-viewer {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .bf-redaction-document-viewer-stage {
    padding: 10px;
  }

  .bf-redaction-document-viewer > section > header {
    padding: 10px;
  }

  .bf-redaction-document-viewer nav {
    padding: 7px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-redaction-working > span {
    animation-duration: 1.8s;
  }
}
