:root {
  --bf-scan-ink: #061015;
  --bf-scan-surface: #0a171c;
  --bf-scan-panel: #0d1d23;
  --bf-scan-panel-strong: #10252d;
  --bf-scan-line: #205560;
  --bf-scan-cyan: #28d6c6;
  --bf-scan-green: #42d782;
  --bf-scan-blue: #5da9ff;
  --bf-scan-text: #eef8f9;
  --bf-scan-muted: #b2c7cc;
  --bf-scan-alert: #f6bd4b;
  --bf-scan-danger: #f06d7a;
}

* {
  box-sizing: border-box;
}

body.bf-scan-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bf-scan-ink);
  color: var(--bf-scan-text);
  font-family: "Open Sans", Arial, sans-serif;
}

.bf-scan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 28px;
  border-bottom: 1px solid var(--bf-scan-line);
  background: #08161b;
}

.bf-scan-topbar a {
  color: var(--bf-scan-text);
  text-decoration: none;
}

.bf-scan-brand {
  color: var(--bf-scan-cyan) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.bf-scan-back {
  color: var(--bf-scan-muted) !important;
  font-size: 14px;
}

.bf-scan-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.bf-scan-current {
  color: var(--bf-scan-green);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.bf-scan-topbar .bf-azubi42-link-scan {
  padding-left: 12px;
  border-left: 1px solid var(--bf-scan-line);
}

.bf-scan-back:hover,
.bf-scan-back:focus-visible {
  color: var(--bf-scan-green) !important;
}

.bf-scan-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 42px;
}

.bf-scan-heading {
  max-width: 660px;
  margin-bottom: 30px;
}

.bf-scan-kicker {
  margin: 0 0 10px;
  color: var(--bf-scan-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.bf-scan-heading h1 {
  margin: 0;
  color: var(--bf-scan-text);
  font-size: 34px;
  line-height: 1.1;
}

.bf-scan-heading p {
  margin: 13px 0 0;
  color: var(--bf-scan-muted);
  font-size: 16px;
  line-height: 1.55;
}

.bf-scan-prealpha {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: -8px 0 20px;
  padding: 12px 14px;
  border-top: 1px solid var(--bf-scan-alert);
  border-bottom: 1px solid var(--bf-scan-alert);
  background: rgba(246, 189, 75, 0.08);
  color: var(--bf-scan-text);
}

.bf-scan-prealpha strong {
  color: var(--bf-scan-alert);
  font-size: 14px;
}

.bf-scan-prealpha span {
  color: var(--bf-scan-muted);
  font-size: 14px;
  line-height: 1.45;
}

.bf-scan-prealpha a {
  color: var(--bf-scan-cyan);
  text-underline-offset: 2px;
}

.bf-scan-prealpha a:hover,
.bf-scan-prealpha a:focus-visible {
  color: var(--bf-scan-green);
}

.bf-scan-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.bf-scan-form,
.bf-scan-result {
  min-width: 0;
  border: 1px solid var(--bf-scan-line);
  background: var(--bf-scan-panel);
}

.bf-scan-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.bf-scan-intake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bf-scan-intake-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bf-scan-intake-block legend,
.bf-scan-step-label,
.bf-scan-question > span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--bf-scan-text);
  font-size: 14px;
  font-weight: 700;
}

.bf-scan-intake-block legend > span,
.bf-scan-step-label > span,
.bf-scan-question > span > b {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 1px solid var(--bf-scan-line-strong);
  border-radius: 50%;
  color: var(--bf-scan-cyan);
  font-size: 11px;
}

.bf-scan-segmented,
.bf-scan-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bf-scan-segmented label,
.bf-scan-choice-grid label {
  min-width: 0;
  cursor: pointer;
}

.bf-scan-segmented input,
.bf-scan-choice-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.bf-scan-segmented label > span,
.bf-scan-choice-grid label > span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--bf-scan-line);
  border-radius: 4px;
  background: #09171c;
  color: var(--bf-scan-muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
}

.bf-scan-segmented label > span::before,
.bf-scan-choice-grid label > span::before {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border: 1px solid var(--bf-scan-line-strong);
  border-radius: 3px;
  color: var(--bf-scan-ink);
  content: "";
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.bf-scan-segmented input:checked + span,
.bf-scan-choice-grid input:checked + span {
  border-color: var(--bf-scan-cyan);
  background: rgba(40, 214, 198, 0.1);
  color: var(--bf-scan-text);
}

.bf-scan-segmented input:checked + span::before,
.bf-scan-choice-grid input:checked + span::before {
  border-color: var(--bf-scan-cyan);
  background: var(--bf-scan-cyan);
  content: "\2713";
}

.bf-scan-segmented input:focus-visible + span,
.bf-scan-choice-grid input:focus-visible + span {
  outline: 2px solid rgba(40, 214, 198, 0.3);
  outline-offset: 2px;
}

.bf-scan-prior-section {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-left: 3px solid var(--bf-scan-cyan);
  background: rgba(40, 214, 198, 0.05);
}

.bf-scan-prior-section[hidden] {
  display: none;
}

.bf-scan-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--bf-scan-muted);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.bf-scan-confirm input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  accent-color: var(--bf-scan-cyan);
}

.bf-scan-step-label {
  margin-bottom: -8px;
}

.bf-scan-upload {
  display: grid;
  min-height: 136px;
  align-content: center;
  gap: 7px;
  padding: 20px;
  border: 1px dashed var(--bf-scan-cyan);
  background: #09191e;
  cursor: pointer;
}

.bf-scan-upload-compact {
  min-height: 94px;
}

.bf-scan-upload:focus-within,
.bf-scan-upload:hover {
  border-color: var(--bf-scan-green);
}

.bf-scan-upload-title,
.bf-scan-question > span {
  color: var(--bf-scan-text);
  font-size: 15px;
  font-weight: 700;
}

.bf-scan-upload-detail {
  color: var(--bf-scan-muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bf-scan-upload input {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bf-scan-document-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--bf-scan-line);
  background: #08181b;
  padding: 10px 12px;
}

.bf-scan-document-preview-bar > span {
  min-width: 0;
}

.bf-scan-document-preview-bar small,
.bf-scan-document-preview-bar strong {
  display: block;
}

.bf-scan-document-preview-bar small {
  color: var(--bf-scan-cyan);
  font-size: 10px;
  font-weight: 700;
}

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

.bf-scan-document-preview-bar button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid var(--bf-scan-line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--bf-scan-text);
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bf-scan-document-preview-bar button:hover,
.bf-scan-document-preview-bar button:focus-visible {
  border-color: var(--bf-scan-cyan);
  color: var(--bf-scan-cyan);
}

.bf-scan-question {
  display: grid;
  gap: 8px;
}

.bf-scan-question textarea {
  width: 100%;
  min-height: 142px;
  resize: vertical;
  padding: 13px;
  border: 1px solid var(--bf-scan-line);
  border-radius: 5px;
  background: #09171c;
  color: var(--bf-scan-text);
  font: inherit;
  line-height: 1.48;
}

.bf-scan-question textarea:focus {
  border-color: var(--bf-scan-cyan);
  outline: 2px solid rgba(40, 214, 198, 0.22);
  outline-offset: 1px;
}

.bf-scan-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bf-scan-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.bf-scan-actions button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--bf-scan-cyan);
  border-radius: 6px;
  background: var(--bf-scan-cyan);
  color: #041014;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bf-scan-actions button:hover,
.bf-scan-actions button:focus-visible {
  border-color: var(--bf-scan-green);
  background: var(--bf-scan-green);
}

.bf-scan-actions button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.bf-scan-actions p {
  margin: 0;
  color: var(--bf-scan-muted);
  font-size: 13px;
  line-height: 1.45;
}

.bf-scan-result {
  min-height: 330px;
  padding: 22px;
}

.bf-scan-result-placeholder {
  margin: 0;
  color: var(--bf-scan-muted);
  line-height: 1.5;
}

.bf-scan-thinking {
  display: flex;
  min-height: 286px;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.bf-scan-thinking-bubbles {
  position: relative;
  width: 112px;
  height: 96px;
  flex: 0 0 112px;
}

.bf-scan-thinking-bubbles span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bf-scan-cyan);
  box-shadow: 0 0 18px rgba(40, 214, 198, 0.34);
  animation: bf-scan-think 1.7s ease-in-out infinite;
}

.bf-scan-thinking-bubbles span:nth-child(1) {
  left: 8px;
  top: 47px;
}

.bf-scan-thinking-bubbles span:nth-child(2) {
  left: 31px;
  top: 19px;
  width: 24px;
  height: 24px;
  animation-delay: 120ms;
  background: var(--bf-scan-blue);
}

.bf-scan-thinking-bubbles span:nth-child(3) {
  left: 62px;
  top: 34px;
  width: 31px;
  height: 31px;
  animation-delay: 240ms;
  background: var(--bf-scan-green);
}

.bf-scan-thinking-bubbles span:nth-child(4) {
  left: 77px;
  top: 72px;
  width: 14px;
  height: 14px;
  animation-delay: 360ms;
  background: var(--bf-scan-alert);
}

.bf-scan-thinking-bubbles span:nth-child(5) {
  left: 43px;
  top: 72px;
  width: 11px;
  height: 11px;
  animation-delay: 480ms;
}

.bf-scan-thinking-copy {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.bf-scan-thinking-copy strong {
  color: var(--bf-scan-text);
  font-size: 15px;
}

.bf-scan-thinking-copy span {
  color: var(--bf-scan-muted);
  font-size: 13px;
}

@keyframes bf-scan-think {
  0%, 100% {
    transform: translateY(0) scale(0.78);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-11px) scale(1);
    opacity: 1;
  }
}

.bf-scan-result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.bf-scan-result-heading h2 {
  margin: 0;
  color: var(--bf-scan-cyan);
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 18px;
  font-weight: 700;
}

.bf-scan-result-heading span {
  color: var(--bf-scan-muted);
  font-size: 13px;
  text-align: right;
}

.bf-scan-summary,
.bf-scan-coherence,
.bf-scan-recommendation {
  margin: 0 0 13px;
  color: var(--bf-scan-text);
  line-height: 1.55;
}

.bf-scan-question-answer {
  margin-bottom: 16px;
  padding: 10px 0 11px 13px;
  border-left: 2px solid var(--bf-scan-cyan);
}

.bf-scan-question-answer.not_stated,
.bf-scan-question-answer.no_document {
  border-left-color: var(--bf-scan-muted);
}

.bf-scan-question-answer-question {
  margin: 0 0 7px;
  color: var(--bf-scan-muted);
  font-size: 12px;
  line-height: 1.45;
}

.bf-scan-question-answer-text {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--bf-scan-text);
  font-size: 15px;
  font-style: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bf-scan-question-answer-source {
  display: block;
  margin-top: 7px;
  color: var(--bf-scan-green);
  font-size: 11px;
  font-weight: 700;
}

.bf-scan-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bf-scan-statement-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.bf-scan-statement-feedback {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 64px;
  margin: 0;
  padding: 0;
  border: 0;
}

.bf-scan-feedback-choices {
  display: flex;
  gap: 5px;
}

.bf-scan-feedback-choice {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  cursor: pointer;
}

.bf-scan-feedback-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bf-scan-feedback-choice span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #09171c;
  font: 700 18px/1 Arial, sans-serif;
}

.bf-scan-feedback-choice.negative {
  color: var(--bf-scan-danger);
}

.bf-scan-feedback-choice.positive {
  color: var(--bf-scan-green);
}

.bf-scan-feedback-choice input:checked + span {
  background: currentColor;
  color: #061015;
  box-shadow: 0 0 0 2px rgba(238, 248, 249, 0.14);
}

.bf-scan-feedback-choice input:focus-visible + span {
  outline: 2px solid var(--bf-scan-cyan);
  outline-offset: 2px;
}

.bf-scan-feedback-correction {
  width: min(240px, 62vw);
  min-height: 58px;
  padding: 7px 9px;
  resize: vertical;
  border: 1px solid var(--bf-scan-danger);
  border-radius: 4px;
  background: #09171c;
  color: var(--bf-scan-text);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.bf-scan-feedback-correction:focus {
  outline: 2px solid rgba(240, 109, 122, 0.24);
  outline-offset: 1px;
}

.bf-scan-case-flow-item > .bf-scan-statement-feedback,
.bf-scan-request > .bf-scan-statement-feedback,
.bf-scan-finding > .bf-scan-statement-feedback,
.bf-scan-next-steps li > .bf-scan-statement-feedback {
  justify-items: start;
  margin-top: 7px;
}

.bf-scan-coherence,
.bf-scan-recommendation {
  color: var(--bf-scan-muted);
}

.bf-scan-assessment {
  margin: -4px 0 17px;
  padding-left: 10px;
  border-left: 3px solid var(--bf-scan-line);
  color: var(--bf-scan-muted);
  font-size: 13px;
  font-weight: 700;
}

.bf-scan-assessment-line {
  margin-bottom: 17px;
}

.bf-scan-assessment-line .bf-scan-assessment {
  margin-bottom: 0;
}

.bf-scan-assessment.attention {
  border-left-color: var(--bf-scan-alert);
  color: var(--bf-scan-alert);
}

.bf-scan-assessment.danger {
  border-left-color: var(--bf-scan-danger);
  color: var(--bf-scan-danger);
}

.bf-scan-assessment.ok {
  border-left-color: var(--bf-scan-green);
  color: var(--bf-scan-green);
}

.bf-scan-result-section {
  margin-top: 19px;
}

.bf-scan-result-section:first-of-type {
  margin-top: 0;
}

.bf-scan-result-section h3 {
  margin: 0 0 8px;
  color: var(--bf-scan-cyan);
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.bf-scan-case-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-case-flow-item {
  min-width: 0;
  padding: 9px 12px 10px 0;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-case-flow-item:nth-child(even) {
  padding-right: 0;
  padding-left: 12px;
  border-left: 1px solid var(--bf-scan-line);
}

.bf-scan-case-flow dt {
  margin: 0 0 3px;
  color: var(--bf-scan-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.bf-scan-case-flow dd {
  margin: 0;
  color: var(--bf-scan-text);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.bf-scan-user-source {
  display: block;
  margin-top: 3px;
  color: var(--bf-scan-green);
  font-size: 10px;
  font-weight: 700;
}

.bf-scan-user-context dl {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-user-context dl > div {
  display: grid;
  grid-template-columns: minmax(105px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-user-context dt,
.bf-scan-user-context dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bf-scan-user-context dt {
  color: var(--bf-scan-muted);
}

.bf-scan-user-context dd {
  color: var(--bf-scan-text);
}

.bf-scan-request {
  margin-top: 11px;
  padding: 9px 0 9px 12px;
  border-left: 2px solid var(--bf-scan-blue);
}

.bf-scan-request strong {
  color: var(--bf-scan-blue);
  font-size: 12px;
}

.bf-scan-request p {
  margin: 3px 0 0;
  color: var(--bf-scan-text);
  font-size: 14px;
  line-height: 1.5;
}

.bf-scan-key-points {
  display: grid;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-key-points p {
  margin: 0;
  padding: 8px 0;
  color: var(--bf-scan-text);
  font-size: 13px;
  line-height: 1.48;
}

.bf-scan-key-points .bf-scan-statement-line {
  padding-right: 1px;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin: 0;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-check {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 48px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bf-scan-line);
  color: var(--bf-scan-muted);
  font-size: 13px;
}

.bf-scan-check > .bf-scan-statement-feedback {
  grid-column: 2 / -1;
  justify-self: end;
  margin-top: 2px;
}

.bf-scan-state {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #6a8388;
}

.bf-scan-state.ok {
  background: var(--bf-scan-green);
}

.bf-scan-state.attention {
  background: var(--bf-scan-alert);
}

.bf-scan-check-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bf-scan-check-label {
  color: var(--bf-scan-text);
  font-size: 13px;
}

.bf-scan-check-detail {
  color: var(--bf-scan-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.bf-scan-findings {
  display: grid;
  gap: 12px;
}

.bf-scan-finding {
  padding: 1px 0 1px 12px;
  border-left: 3px solid #6a8388;
}

.bf-scan-finding.attention {
  border-left-color: var(--bf-scan-alert);
}

.bf-scan-finding.danger {
  border-left-color: var(--bf-scan-danger);
}

.bf-scan-finding-title {
  display: block;
  color: var(--bf-scan-text);
  font-size: 13px;
}

.bf-scan-finding-detail {
  margin: 3px 0 0;
  color: var(--bf-scan-muted);
  font-size: 13px;
  line-height: 1.48;
}

.bf-scan-human-review {
  margin: 8px 0 0;
  color: var(--bf-scan-muted);
  font-size: 12px;
  line-height: 1.45;
}

.bf-scan-human-review strong {
  color: var(--bf-scan-green);
}

.bf-scan-human-review.corrected strong,
.bf-scan-human-review.unclear strong {
  color: var(--bf-scan-alert);
}

.bf-scan-ocr-heading,
.bf-scan-ocr-issue-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.bf-scan-ocr-heading h3 {
  margin-bottom: 0;
}

.bf-scan-ocr-status,
.bf-scan-ocr-issue-heading span {
  color: var(--bf-scan-muted);
  font-size: 11px;
}

.bf-scan-ocr-status.needs_review,
.bf-scan-ocr-status.blocked {
  color: var(--bf-scan-alert);
}

.bf-scan-ocr-status.clear,
.bf-scan-ocr-status.reviewed {
  color: var(--bf-scan-green);
}

.bf-scan-ocr-clear {
  margin: 8px 0 0;
  color: var(--bf-scan-muted);
  font-size: 12px;
}

.bf-scan-ocr-issue {
  min-width: 0;
  padding: 12px 0;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-ocr-issue:first-of-type {
  margin-top: 9px;
}

.bf-scan-ocr-issue.danger {
  border-top-color: rgba(240, 109, 122, 0.68);
}

.bf-scan-ocr-issue-heading strong {
  color: var(--bf-scan-text);
  font-size: 12px;
}

.bf-scan-ocr-threeway {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  border-top: 1px solid var(--bf-scan-line);
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-ocr-lane {
  min-width: 0;
  padding: 9px 10px;
}

.bf-scan-ocr-lane + .bf-scan-ocr-lane {
  border-left: 1px solid var(--bf-scan-line);
}

.bf-scan-ocr-lane > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--bf-scan-cyan);
  font-size: 11px;
}

.bf-scan-ocr-lane p {
  margin: 0;
  color: var(--bf-scan-text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bf-scan-ocr-lane small {
  display: block;
  margin-top: 6px;
  color: var(--bf-scan-muted);
  font-size: 10px;
}

.bf-scan-ocr-lane.human.confirmed p,
.bf-scan-ocr-lane.human.corrected p {
  color: var(--bf-scan-green);
}

.bf-scan-ocr-lane.human.pending p,
.bf-scan-ocr-lane.human.rejected p,
.bf-scan-ocr-lane.human.blocked p {
  color: var(--bf-scan-alert);
}

.bf-scan-ocr-lane .bf-scan-evidence-list {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.bf-scan-ocr-lane .bf-scan-evidence img {
  height: 74px;
  object-fit: contain;
}

.bf-scan-ocr-issue > .bf-scan-statement-feedback {
  justify-items: start;
  margin-top: 9px;
}

.bf-scan-ocr-protocol {
  margin-top: 8px;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-ocr-protocol summary {
  padding: 8px 0;
  color: var(--bf-scan-muted);
  font-size: 11px;
  cursor: pointer;
}

.bf-scan-ocr-protocol dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 8px;
}

.bf-scan-ocr-protocol-row {
  min-width: 0;
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-ocr-protocol-row dt,
.bf-scan-ocr-protocol-row dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
}

.bf-scan-ocr-protocol-row dt {
  color: var(--bf-scan-muted);
}

.bf-scan-ocr-protocol-row dd {
  color: var(--bf-scan-text);
}

.bf-scan-evidence-list {
  display: grid;
  grid-template-columns: minmax(0, 360px);
  gap: 8px;
  margin-top: 9px;
}

.bf-scan-evidence {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--bf-scan-line);
  border-radius: 4px;
  background: #f7f7f4;
  color: #162126;
  cursor: zoom-in;
  text-align: left;
}

.bf-scan-evidence:hover,
.bf-scan-evidence:focus-visible {
  border-color: var(--bf-scan-cyan);
  outline: 2px solid rgba(40, 214, 198, 0.24);
}

.bf-scan-evidence img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #fff;
}

.bf-scan-evidence span {
  display: block;
  padding: 6px 8px;
  color: #26383e;
  font-size: 11px;
  font-weight: 700;
}

.bf-scan-evidence-dialog {
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 42px 18px 14px;
  border: 1px solid var(--bf-scan-cyan);
  border-radius: 5px;
  background: #071217;
  color: var(--bf-scan-text);
}

.bf-scan-evidence-dialog::backdrop {
  background: rgba(2, 9, 12, 0.88);
}

.bf-scan-evidence-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #fff;
}

.bf-scan-evidence-dialog p {
  margin: 9px 0 0;
  color: var(--bf-scan-muted);
  font-size: 12px;
}

.bf-scan-questions-form {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-question-item {
  min-width: 0;
  margin: 0;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-question-item legend {
  width: 100%;
  padding: 0;
  color: var(--bf-scan-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.bf-scan-question-detail {
  margin: 4px 0 9px;
  color: var(--bf-scan-muted);
  font-size: 12px;
  line-height: 1.45;
}

.bf-scan-question-item .bf-scan-evidence-list {
  margin: 8px 0 11px;
}

.bf-scan-answer-label {
  display: grid;
  gap: 5px;
  color: var(--bf-scan-muted);
  font-size: 11px;
  font-weight: 700;
}

.bf-scan-answer-label select,
.bf-scan-answer-label input,
.bf-scan-answer-label textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--bf-scan-line);
  border-radius: 4px;
  background: #09171c;
  color: var(--bf-scan-text);
  font: inherit;
  font-size: 13px;
}

.bf-scan-answer-label textarea {
  resize: vertical;
  line-height: 1.45;
}

.bf-scan-answer-label select:focus,
.bf-scan-answer-label input:focus,
.bf-scan-answer-label textarea:focus {
  border-color: var(--bf-scan-cyan);
  outline: 2px solid rgba(40, 214, 198, 0.22);
  outline-offset: 1px;
}

.bf-scan-correction {
  margin-top: 9px;
}

.bf-scan-question-error {
  min-height: 18px;
  margin: 9px 0 5px;
  color: var(--bf-scan-danger);
  font-size: 12px;
}

.bf-scan-follow-up {
  min-height: 40px;
  justify-self: start;
  padding: 0 15px;
  border: 1px solid var(--bf-scan-green);
  border-radius: 5px;
  background: var(--bf-scan-green);
  color: #041014;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.bf-scan-follow-up:hover,
.bf-scan-follow-up:focus-visible {
  border-color: var(--bf-scan-cyan);
  background: var(--bf-scan-cyan);
}

.bf-scan-feedback-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-feedback-action[hidden] {
  display: none;
}

.bf-scan-recommendation-line {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--bf-scan-line);
}

.bf-scan-recommendation-line .bf-scan-recommendation {
  margin: 0;
  padding: 0;
  border: 0;
}

.bf-scan-evidence-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--bf-scan-line);
  border-radius: 50%;
  background: transparent;
  color: var(--bf-scan-text);
  font: 22px/1 Arial, sans-serif;
  cursor: pointer;
}

.bf-scan-next-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 21px;
  color: var(--bf-scan-text);
  font-size: 14px;
  line-height: 1.46;
}

.bf-scan-next-steps li::marker {
  color: var(--bf-scan-cyan);
  font-weight: 700;
}

.bf-scan-recommendation {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--bf-scan-line);
  font-size: 13px;
}

.bf-scan-recommendation strong {
  color: var(--bf-scan-text);
}

.bf-scan-error {
  margin: 0;
  color: var(--bf-scan-danger);
  line-height: 1.5;
}

.bf-scan-cat {
  display: grid;
  gap: 18px;
}

.bf-scan-cat > div:first-child {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bf-scan-line);
}

.bf-scan-cat h2 {
  margin: 0 0 9px;
  color: var(--bf-scan-cyan);
  font-size: 18px;
}

.bf-scan-cat p {
  margin: 0;
  color: var(--bf-scan-muted);
  line-height: 1.5;
}

.bf-therapy-cat-mount {
  min-width: 0;
  container-type: inline-size;
}

.bf-therapy-generator .therapy-cat-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bf-therapy-generator .therapy-cat-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #704866;
  background: #17202a;
}

.bf-therapy-generator .therapy-cat-kicker,
.bf-therapy-generator .therapy-cat-status-card span,
.bf-therapy-generator .therapy-cat-control-group label > span,
.bf-therapy-generator .therapy-cat-slider-group label > span {
  color: #f39acb;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.bf-therapy-generator .therapy-cat-hero h3 {
  margin: 4px 0 0;
  color: var(--bf-scan-text);
  font-size: 19px;
  line-height: 1.2;
}

.bf-therapy-generator .therapy-cat-hero p {
  margin: 7px 0 0;
  color: var(--bf-scan-muted);
  font-size: 13px;
}

.bf-therapy-generator .therapy-cat-status-card {
  display: grid;
  flex: 0 0 150px;
  gap: 5px;
  padding: 10px;
  border-left: 2px solid #ca79c9;
  background: #0b171d;
}

.bf-therapy-generator [data-therapy-cat-status][data-tone="ok"] {
  color: var(--bf-scan-green);
}

.bf-therapy-generator [data-therapy-cat-status][data-tone="error"] {
  color: var(--bf-scan-danger);
}

.bf-therapy-generator .therapy-cat-workbench {
  display: grid;
  grid-template-columns: minmax(210px, 0.58fr) minmax(280px, 1fr);
  gap: 12px;
}

.bf-therapy-generator .therapy-cat-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--bf-scan-line);
  background: var(--bf-scan-panel);
}

.bf-therapy-generator .therapy-cat-control-group,
.bf-therapy-generator .therapy-cat-slider-group {
  display: grid;
  gap: 10px;
}

.bf-therapy-generator .therapy-cat-control-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bf-therapy-generator .therapy-cat-control-group label,
.bf-therapy-generator .therapy-cat-slider-group label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.bf-therapy-generator .therapy-cat-control-group select,
.bf-therapy-generator .therapy-cat-slider-group input {
  width: 100%;
}

.bf-therapy-generator .therapy-cat-control-group select {
  min-height: 38px;
  border: 1px solid var(--bf-scan-line);
  border-radius: 4px;
  background: var(--bf-scan-ink);
  color: var(--bf-scan-text);
  padding: 0 8px;
}

.bf-therapy-generator .therapy-cat-slider-group input {
  accent-color: #ca79c9;
}

.bf-therapy-generator .therapy-cat-slider-group b {
  float: right;
  color: var(--bf-scan-green);
}

.bf-therapy-generator .therapy-cat-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bf-therapy-generator .therapy-cat-actions button {
  min-height: 38px;
  border: 1px solid #704866;
  border-radius: 4px;
  background: #2b1830;
  color: #ffe3f2;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 700;
}

.bf-therapy-generator .therapy-cat-actions button:hover,
.bf-therapy-generator .therapy-cat-actions button:focus-visible {
  border-color: #f39acb;
  background: #44213f;
  outline: none;
}

.bf-therapy-generator .therapy-cat-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid #704866;
  background: #050c12;
}

.bf-therapy-generator [data-therapy-cat-canvas] {
  display: block;
  width: min(100%, 760px);
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #704866;
  background: #020617;
}

@container (max-width: 760px) {
  .bf-therapy-generator .therapy-cat-workbench {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container (max-width: 430px) {
  .bf-therapy-generator .therapy-cat-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .bf-therapy-generator .therapy-cat-status-card {
    flex-basis: auto;
  }

  .bf-therapy-generator .therapy-cat-control-group,
  .bf-therapy-generator .therapy-cat-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bf-tool-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--bf-scan-line);
  padding: 9px 0 2px;
  color: var(--bf-scan-muted);
  font-size: 12px;
  line-height: 1.35;
}

.bf-tool-footer nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bf-tool-footer a {
  color: var(--bf-scan-cyan);
  text-decoration: none;
}

.bf-tool-footer a:hover,
.bf-tool-footer a:focus-visible {
  color: var(--bf-scan-green);
  text-decoration: underline;
}

.bf-redaction-info {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--bf-scan-line);
  background: var(--bf-scan-panel);
}

.bf-redaction-info > header {
  margin-bottom: 16px;
}

.bf-redaction-info > header p {
  margin: 0 0 5px;
  color: var(--bf-scan-green);
  font-size: 11px;
  font-weight: 700;
}

.bf-redaction-info h2 {
  margin: 0;
  color: var(--bf-scan-text);
  font-size: 21px;
}

.bf-redaction-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bf-redaction-facts article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--bf-scan-line);
  border-radius: 4px;
  background: #09191e;
}

.bf-redaction-facts article:nth-child(2) {
  border-color: #8b6f2d;
}

.bf-redaction-facts article:nth-child(3) {
  border-color: #2b7853;
}

.bf-redaction-facts h3 {
  margin: 0 0 7px;
  color: var(--bf-scan-cyan);
  font-size: 14px;
}

.bf-redaction-facts p {
  margin: 0;
  color: var(--bf-scan-muted);
  font-size: 13px;
  line-height: 1.5;
}

.bf-redaction-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: bf-redaction-step;
}

.bf-redaction-flow li {
  min-width: 0;
  padding: 9px 10px;
  background: var(--bf-scan-panel-strong);
  color: var(--bf-scan-text);
  font-size: 12px;
  line-height: 1.35;
  counter-increment: bf-redaction-step;
}

.bf-redaction-flow li::before {
  content: counter(bf-redaction-step) ". ";
  color: var(--bf-scan-green);
  font-weight: 700;
}

@media (max-width: 800px) {
  .bf-scan-main {
    width: min(100% - 28px, 1180px);
    padding-top: 34px;
  }

  .bf-scan-topbar {
    min-height: 54px;
    padding: 0 14px;
  }

  .bf-scan-heading h1 {
    font-size: 28px;
  }

  .bf-scan-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-result {
    min-height: 0;
  }

  .bf-redaction-facts {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 600px) {
  .bf-scan-intake-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-document-preview-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .bf-scan-document-preview-bar button {
    width: 100%;
  }

  .bf-scan-home,
  .bf-scan-topbar .bf-azubi42-name,
  .bf-scan-topbar .bf-azubi42-version {
    display: none;
  }

  .bf-scan-topbar {
    padding: 0 14px;
  }

  .bf-scan-nav {
    flex: 0 0 auto;
    gap: 12px;
  }

  .bf-scan-topbar .bf-azubi42-link-scan {
    padding-left: 8px;
  }
}

@media (max-width: 460px) {
  .bf-scan-prealpha {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .bf-scan-form,
  .bf-scan-result {
    padding: 16px;
  }

  .bf-scan-actions {
    align-items: stretch;
  }

  .bf-scan-actions button {
    width: 100%;
  }

  .bf-scan-follow-up {
    width: 100%;
  }

  .bf-scan-checks {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-case-flow,
  .bf-scan-evidence-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-ocr-threeway,
  .bf-scan-ocr-protocol dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-ocr-lane + .bf-scan-ocr-lane {
    border-top: 1px solid var(--bf-scan-line);
    border-left: 0;
  }

  .bf-scan-result-heading {
    display: grid;
    gap: 4px;
  }

  .bf-scan-result-heading span {
    text-align: left;
  }

  .bf-scan-case-flow-item:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .bf-scan-user-context dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .bf-scan-statement-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-scan-statement-line > .bf-scan-statement-feedback {
    justify-items: start;
  }

  .bf-scan-feedback-correction {
    width: 100%;
  }

  .bf-scan-thinking {
    min-height: 220px;
    flex-direction: column;
    gap: 10px;
  }

  .bf-scan-cat {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-redaction-info {
    padding: 16px;
  }

  .bf-redaction-flow {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-scan-thinking-bubbles span {
    animation: none;
    opacity: 0.85;
  }
}
