.briefhelfer-app {
  --briefhelfer-primary: #176b45;
  --briefhelfer-button: #176b45;
  max-width: 980px;
  margin: 24px auto;
  color: #1c2520;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

.briefhelfer-app [hidden] { display: none !important; }
.briefhelfer-app *, .briefhelfer-app *::before, .briefhelfer-app *::after { box-sizing: border-box; }

.briefhelfer-app__header {
  padding: 30px;
  border-radius: 22px 22px 0 0;
  color: #fff;
  background: linear-gradient(135deg, var(--briefhelfer-primary), #0d4630);
}

.briefhelfer-app__eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: .82em;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .88;
}

.briefhelfer-app h2 { margin: 0 0 10px; color: inherit; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; }
.briefhelfer-app__header p { margin: 0; max-width: 760px; }

.briefhelfer-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 18px;
  list-style: none;
  background: #eef4f1;
}

.briefhelfer-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #52625a;
  font-size: 14px;
  font-weight: 700;
}

.briefhelfer-steps span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 2px solid #9caaa3;
  border-radius: 50%;
  background: #fff;
}

.briefhelfer-steps .is-active { color: #173c2d; }
.briefhelfer-steps .is-active span { color: #fff; border-color: var(--briefhelfer-primary); background: var(--briefhelfer-primary); }
.briefhelfer-steps .is-complete span { color: #fff; border-color: #27734f; background: #27734f; }
.briefhelfer-steps .is-complete:not(.is-active) span::after { content: "✓"; }
.briefhelfer-steps .is-complete:not(.is-active) span { font-size: 0; }

.briefhelfer-panel,
.briefhelfer-upload-result {
  padding: clamp(20px, 5vw, 38px);
  border: 1px solid #dce5e0;
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18, 47, 35, .10);
}

.briefhelfer-help-box,
.briefhelfer-module-note {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-left: 5px solid var(--briefhelfer-primary);
  border-radius: 10px;
  background: #f1f8f4;
}

.briefhelfer-help-box ul { margin: 8px 0 0 22px; }

.briefhelfer-upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.briefhelfer-action-button,
.briefhelfer-submit-button,
.briefhelfer-delete-upload-button,
.briefhelfer-new-upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  padding: 14px 20px;
  border: 2px solid var(--briefhelfer-button);
  border-radius: 13px;
  color: #fff;
  background: var(--briefhelfer-button);
  font: inherit;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.briefhelfer-action-button:hover,
.briefhelfer-submit-button:hover,
.briefhelfer-delete-upload-button:hover,
.briefhelfer-new-upload-button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(18, 47, 35, .16); }

.briefhelfer-action-button:focus-within,
.briefhelfer-submit-button:focus-visible,
.briefhelfer-delete-upload-button:focus-visible,
.briefhelfer-new-upload-button:focus-visible,
.briefhelfer-mini-button:focus-visible,
.briefhelfer-icon-button:focus-visible,
.briefhelfer-file-preview:focus-visible { outline: 4px solid rgba(23, 107, 69, .25); outline-offset: 3px; }

.briefhelfer-action-button.is-secondary,
.briefhelfer-new-upload-button { color: var(--briefhelfer-button); background: #fff; }
.briefhelfer-delete-upload-button { border-color: #a22424; background: #a22424; }
.briefhelfer-submit-button { width: 100%; margin-top: 22px; }
.briefhelfer-submit-button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.briefhelfer-submit-button.is-loading span::after { content: ""; display: inline-block; width: 17px; height: 17px; margin-left: 10px; border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; vertical-align: -3px; animation: briefhelfer-spin .8s linear infinite; }

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

.briefhelfer-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.briefhelfer-limit-note { margin: 12px 0 22px; color: #5c6d65; font-size: 14px; }
.briefhelfer-file-list { margin: 22px 0; }
.briefhelfer-file-list__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.briefhelfer-file-list h3 { margin: 0; font-size: 24px; }
.briefhelfer-file-list__header p { margin: 3px 0 0; color: #5c6d65; font-size: 15px; }
.briefhelfer-text-button { flex: 0 0 auto; border: 0; color: #8b1d1d; background: transparent; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: underline; }

.briefhelfer-quality-summary {
  margin: 18px 0;
  padding: 15px 17px;
  border: 1px solid #b9c8c0;
  border-left-width: 6px;
  border-radius: 10px;
  background: #f7faf8;
}
.briefhelfer-quality-summary strong { display: block; font-size: 18px; }
.briefhelfer-quality-summary p { margin: 3px 0 0; font-size: 15px; }
.briefhelfer-quality-summary.is-good { border-color: #2d7b54; background: #eef8f2; }
.briefhelfer-quality-summary.is-warning { border-color: #b36d00; background: #fff8e8; }
.briefhelfer-quality-summary.is-error { border-color: #a22424; background: #fff0f0; }
.briefhelfer-quality-summary.is-checking { border-color: #3f6e9e; background: #eef6ff; }

.briefhelfer-file-items { display: grid; gap: 14px; margin-top: 12px; }
.briefhelfer-file-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 2px solid #dce5e0;
  border-radius: 14px;
  background: #fafcfb;
  cursor: grab;
}
.briefhelfer-file-item.is-good { border-color: #abd1ba; }
.briefhelfer-file-item.is-warning { border-color: #e3b660; background: #fffdf7; }
.briefhelfer-file-item.is-error { border-color: #d58b8b; background: #fff8f8; }
.briefhelfer-file-item.is-checking { border-color: #a9c5e0; }
.briefhelfer-file-item.is-dragging { opacity: .55; cursor: grabbing; }

.briefhelfer-file-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 116px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd7d1;
  border-radius: 9px;
  background: #e8efeb;
  color: #233e32;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: zoom-in;
}
.briefhelfer-file-preview img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.briefhelfer-file-preview.is-pdf { background: #f5e8e8; color: #9c2323; }
.briefhelfer-file-content { min-width: 0; }
.briefhelfer-file-headline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.briefhelfer-file-headline strong { overflow-wrap: anywhere; }
.briefhelfer-file-details { margin: 2px 0 0; color: #5c6d65; font-size: 14px; }

.briefhelfer-quality-badge { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; background: #e8eeeb; font-size: 12px; font-weight: 800; white-space: nowrap; }
.briefhelfer-quality-badge.is-good { color: #15583a; background: #dff2e7; }
.briefhelfer-quality-badge.is-warning { color: #754500; background: #ffe7b7; }
.briefhelfer-quality-badge.is-error { color: #7c1717; background: #ffdada; }
.briefhelfer-quality-badge.is-checking { color: #244f78; background: #dcecff; }

.briefhelfer-quality-notes { margin: 9px 0 0 20px; padding: 0; color: #4d5c55; font-size: 14px; }
.briefhelfer-quality-notes li + li { margin-top: 4px; }
.briefhelfer-file-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; padding-top: 3px; }
.briefhelfer-mini-button,
.briefhelfer-icon-button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #b9c8c0;
  border-radius: 8px;
  color: #263d32;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.briefhelfer-icon-button { min-width: 40px; font-size: 18px; }
.briefhelfer-mini-button:hover, .briefhelfer-icon-button:hover { border-color: var(--briefhelfer-primary); background: #f0f8f4; }
.briefhelfer-mini-button.is-remove { margin-left: auto; color: #8b1d1d; border-color: #d9aaaa; }
.briefhelfer-icon-button:disabled { cursor: not-allowed; opacity: .4; }

.briefhelfer-completeness-note { display: flex; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 10px; background: #eef4f8; color: #314d61; font-size: 14px; }
.briefhelfer-completeness-note .dashicons { flex: 0 0 auto; margin-top: 2px; }
.briefhelfer-completeness-note p { margin: 0; }

.briefhelfer-consent { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0 0; padding: 15px; border: 1px solid #ccd8d2; border-radius: 10px; background: #fafcfb; font-size: 15px; }
.briefhelfer-consent input { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--briefhelfer-primary); }
.briefhelfer-consent a { display: inline-block; margin-left: 4px; }
.briefhelfer-quality-ack { border-color: #e3b660; background: #fff8e8; }

.briefhelfer-message { margin-top: 16px; padding: 14px 16px; border-radius: 9px; font-weight: 700; }
.briefhelfer-message.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-message.is-info { color: #234e70; background: #e5f3ff; }
.briefhelfer-message.is-success { color: #15583a; background: #e1f5e9; }

.briefhelfer-upload-result { text-align: center; }
.briefhelfer-success-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: #247a50; font-size: 42px; font-weight: 900; }
.briefhelfer-upload-result h3 { margin: 0 0 8px; font-size: 30px; }
.briefhelfer-result-files { display: grid; gap: 9px; margin: 20px 0; text-align: left; }
.briefhelfer-result-file { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid #ccd8d2; border-left: 5px solid #27734f; border-radius: 9px; background: #fafcfb; }
.briefhelfer-result-file.is-warning { border-left-color: #b36d00; background: #fffaf0; }
.briefhelfer-result-file span { color: #5c6d65; font-size: 14px; }
.briefhelfer-result-file small { margin-top: 5px; color: #754500; }
.briefhelfer-delete-upload-button, .briefhelfer-new-upload-button { width: 100%; margin-top: 10px; }

.briefhelfer-privacy-note { padding: 16px 20px 22px; color: #4d5e55; font-size: 14px; text-align: center; }
.briefhelfer-privacy-note__text { max-width: 920px; margin: 0 auto; }
.briefhelfer-privacy-popup-open { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; margin-top: 10px; padding: 6px 14px; border: 1px solid var(--briefhelfer-primary); border-radius: 999px; color: var(--briefhelfer-primary); background: #fff; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.briefhelfer-privacy-popup-open:hover, .briefhelfer-privacy-popup-open:focus-visible { color: #fff; background: var(--briefhelfer-primary); outline: none; }

.briefhelfer-privacy-modal { position: fixed; inset: 0; z-index: 1000000; display: grid; place-items: center; padding: 18px; }
.briefhelfer-privacy-modal__backdrop { position: absolute; inset: 0; background: rgba(10, 20, 15, .78); }
.briefhelfer-privacy-modal__dialog { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(760px, 96vw); max-height: 90vh; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: left; }
.briefhelfer-privacy-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid #dce5e0; }
.briefhelfer-privacy-modal__header h3 { margin: 0; color: #173c2d; font-size: clamp(21px, 4vw, 28px); line-height: 1.25; }
.briefhelfer-privacy-popup-close { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: #173c2d; background: #eef3f0; font-size: 30px; line-height: 1; cursor: pointer; }
.briefhelfer-privacy-modal__content { padding: 20px 22px; overflow: auto; color: #26362e; font-size: 16px; line-height: 1.6; }
.briefhelfer-privacy-modal__content h4 { margin: 22px 0 7px; color: #173c2d; font-size: 18px; }
.briefhelfer-privacy-modal__content h4:first-child { margin-top: 0; }
.briefhelfer-privacy-modal__content p { margin: 0 0 13px; }
.briefhelfer-privacy-modal__content ul, .briefhelfer-privacy-modal__content ol { margin: 0 0 15px; padding-left: 24px; }
.briefhelfer-privacy-modal__content a { color: var(--briefhelfer-primary); font-weight: 700; }
.briefhelfer-privacy-modal__footer { padding: 12px 18px 16px; border-top: 1px solid #dce5e0; text-align: right; }
.briefhelfer-privacy-popup-close-button { width: auto; height: auto; min-height: 42px; padding: 8px 18px; border-radius: 9px; color: #fff; background: var(--briefhelfer-primary); font-size: 16px; font-weight: 800; }

.briefhelfer-preview-modal { position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: 18px; }
.briefhelfer-preview-backdrop { position: absolute; inset: 0; background: rgba(10, 20, 15, .78); }
.briefhelfer-preview-dialog { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(920px, 96vw); max-height: 92vh; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.briefhelfer-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; border-bottom: 1px solid #dce5e0; }
.briefhelfer-preview-header h3 { margin: 0; font-size: 22px; }
.briefhelfer-preview-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #eef3f0; font-size: 30px; line-height: 1; cursor: pointer; }
.briefhelfer-preview-content { display: grid; place-items: center; min-height: 250px; padding: 28px; overflow: auto; background: #e9efec; }
.briefhelfer-preview-content img { display: block; max-width: 82%; max-height: 72vh; object-fit: contain; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.briefhelfer-modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .briefhelfer-app { margin: 0; font-size: 17px; }
  .briefhelfer-app__header { padding: 24px 20px; border-radius: 0; }
  .briefhelfer-steps { grid-template-columns: 1fr; gap: 5px; padding: 13px 16px; }
  .briefhelfer-steps li { display: none; }
  .briefhelfer-steps li.is-active, .briefhelfer-steps li.is-complete { display: flex; }
  .briefhelfer-panel, .briefhelfer-upload-result { border-radius: 0; padding: 20px 15px; }
  .briefhelfer-upload-actions { grid-template-columns: 1fr; }
  .briefhelfer-file-list__header { display: block; }
  .briefhelfer-text-button { margin-top: 8px; padding: 0; }
  .briefhelfer-file-item { grid-template-columns: 78px minmax(0, 1fr); padding: 10px; }
  .briefhelfer-file-preview { width: 78px; height: 102px; }
  .briefhelfer-file-headline { display: block; }
  .briefhelfer-quality-badge { display: inline-block; margin-top: 5px; }
  .briefhelfer-file-controls { gap: 6px; }
  .briefhelfer-mini-button { flex: 1 1 calc(50% - 6px); }
  .briefhelfer-icon-button { flex: 0 0 44px; }
  .briefhelfer-mini-button.is-remove { margin-left: 0; flex-basis: 100%; }
  .briefhelfer-preview-content { padding: 18px; }
  .briefhelfer-preview-content img { max-width: 76%; max-height: 68vh; }
}

@media (prefers-reduced-motion: reduce) {
  .briefhelfer-app *, .briefhelfer-app *::before, .briefhelfer-app *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* M003 – OCR-Texterkennung */
.briefhelfer-ocr-stage {
  margin: 28px 0 18px;
  padding: 22px;
  border: 2px solid #c7d9d0;
  border-radius: 15px;
  background: #f8fbf9;
  text-align: left;
}
.briefhelfer-ocr-stage__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.briefhelfer-ocr-stage__header h3 { margin: 3px 0 0; font-size: 25px; }
.briefhelfer-ocr-kicker { color: var(--briefhelfer-primary); font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.briefhelfer-ocr-provider { display: inline-block; max-width: 48%; padding: 6px 10px; border-radius: 999px; color: #254d3a; background: #e2efe8; font-size: 12px; font-weight: 800; text-align: center; }
.briefhelfer-ocr-intro { margin: 14px 0; color: #465a50; }
.briefhelfer-ocr-unavailable { margin: 12px 0; padding: 13px 15px; border: 1px solid #e3b660; border-radius: 9px; color: #6c4608; background: #fff7e5; font-weight: 700; }
.briefhelfer-ocr-start-button,
.briefhelfer-ocr-copy-button {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--briefhelfer-button);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.briefhelfer-ocr-start-button { display: flex; align-items: center; justify-content: center; gap: 9px; }
.briefhelfer-ocr-start-button:disabled { cursor: not-allowed; opacity: .55; }
.briefhelfer-ocr-start-button.is-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: briefhelfer-spin .8s linear infinite;
}
@keyframes briefhelfer-spin { to { transform: rotate(360deg); } }
.briefhelfer-ocr-progress { margin-top: 14px; padding: 14px 16px; border-radius: 9px; font-weight: 750; }
.briefhelfer-ocr-progress.is-working { color: #234e70; background: #e5f3ff; }
.briefhelfer-ocr-progress.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-ocr-result { margin-top: 18px; }
.briefhelfer-ocr-result__summary { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding: 14px; border-radius: 10px; background: #e4f4ea; }
.briefhelfer-success-icon.is-small { flex: 0 0 auto; width: 42px; height: 42px; margin: 0; font-size: 25px; }
.briefhelfer-ocr-result__summary strong { font-size: 19px; }
.briefhelfer-ocr-result__summary p { margin: 3px 0 0; color: #40564b; font-size: 14px; }
.briefhelfer-ocr-warnings { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #e3b660; border-radius: 9px; color: #6c4608; background: #fff8e8; }
.briefhelfer-ocr-warnings ul { margin: 0 0 0 20px; }
.briefhelfer-ocr-pages { display: grid; gap: 16px; }
.briefhelfer-ocr-page { padding: 16px; border: 1px solid #ccd9d2; border-radius: 11px; background: #fff; }
.briefhelfer-ocr-page h4 { margin: 0; font-size: 18px; }
.briefhelfer-ocr-page__meta { margin: 4px 0 10px; color: #617168; font-size: 13px; }
.briefhelfer-ocr-page__text { box-sizing: border-box; width: 100%; min-height: 230px; padding: 13px; resize: vertical; border: 1px solid #bacac1; border-radius: 8px; color: #1f2c26; background: #fbfcfb; font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.briefhelfer-ocr-page__warnings { margin: 10px 0 0 20px; color: #7a4e09; font-size: 14px; }
.briefhelfer-ocr-copy-button { margin-top: 16px; color: #244638; background: #e1eee7; border: 1px solid #a9c5b7; }
.briefhelfer-ocr-copy-button:hover { background: #d4e7dc; }

@media (max-width: 760px) {
  .briefhelfer-ocr-stage { margin-left: -1px; margin-right: -1px; padding: 17px 13px; border-radius: 11px; }
  .briefhelfer-ocr-stage__header { display: block; }
  .briefhelfer-ocr-provider { max-width: 100%; margin-top: 9px; }
  .briefhelfer-ocr-page { padding: 12px; }
  .briefhelfer-ocr-page__text { min-height: 260px; font-size: 14px; }
}

/* M004 – strukturierte Briefanalyse */
.briefhelfer-analysis-stage {
  margin: 24px 0 18px;
  padding: 22px;
  border: 2px solid #c6d5e2;
  border-radius: 15px;
  background: #f7fafc;
  text-align: left;
}
.briefhelfer-analysis-stage__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.briefhelfer-analysis-stage__header h3 { margin: 3px 0 0; font-size: 25px; }
.briefhelfer-analysis-kicker { color: #245f88; font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.briefhelfer-analysis-provider { display: inline-block; max-width: 48%; padding: 6px 10px; border-radius: 999px; color: #244b64; background: #e4eef5; font-size: 12px; font-weight: 800; text-align: center; }
.briefhelfer-analysis-intro { margin: 14px 0; color: #465a66; }
.briefhelfer-analysis-unavailable { margin: 12px 0; padding: 13px 15px; border: 1px solid #e3b660; border-radius: 9px; color: #6c4608; background: #fff7e5; font-weight: 700; }
.briefhelfer-analysis-start-button,
.briefhelfer-analysis-retry-button {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--briefhelfer-button);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.briefhelfer-analysis-start-button { display: flex; align-items: center; justify-content: center; gap: 9px; }
.briefhelfer-analysis-start-button:disabled,
.briefhelfer-analysis-retry-button:disabled { cursor: not-allowed; opacity: .55; }
.briefhelfer-analysis-start-button.is-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: briefhelfer-spin .8s linear infinite;
}
.briefhelfer-analysis-progress { margin-top: 14px; padding: 14px 16px; border-radius: 9px; font-weight: 750; }
.briefhelfer-analysis-progress.is-working { color: #234e70; background: #e5f3ff; }
.briefhelfer-analysis-progress.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-analysis-result { margin-top: 18px; }
.briefhelfer-analysis-result__summary { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; padding: 14px; border-radius: 10px; background: #e5f1f8; }
.briefhelfer-analysis-result__summary strong { font-size: 19px; }
.briefhelfer-analysis-result__summary p { margin: 3px 0 0; color: #405764; font-size: 14px; }
.briefhelfer-critical-alert { margin: 14px 0; padding: 16px; border: 2px solid #b3261e; border-left-width: 7px; border-radius: 10px; color: #6e1511; background: #fff0ef; }
.briefhelfer-critical-alert strong { display: block; font-size: 19px; }
.briefhelfer-critical-alert p { margin: 7px 0; }
.briefhelfer-critical-alert ul { margin: 8px 0 0 21px; }
.briefhelfer-analysis-note { margin: 14px 0; padding: 13px 15px; border-left: 5px solid #3678a6; border-radius: 7px; color: #334f60; background: #eef6fb; }
.briefhelfer-analysis-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.briefhelfer-analysis-legend span,
.briefhelfer-analysis-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.briefhelfer-analysis-legend .is-secure,
.briefhelfer-analysis-status.is-sicher { color: #075c34; background: #d8f4e6; }
.briefhelfer-analysis-legend .is-probable,
.briefhelfer-analysis-status.is-wahrscheinlich { color: #274e6c; background: #deedf8; }
.briefhelfer-analysis-legend .is-unclear,
.briefhelfer-analysis-status.is-unklar { color: #6f4900; background: #fff0c7; }
.briefhelfer-analysis-legend .is-missing,
.briefhelfer-analysis-status.is-nicht-gefunden { color: #5b6165; background: #e9ecee; }
.briefhelfer-analysis-fields__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.briefhelfer-analysis-field { min-width: 0; padding: 14px; border: 1px solid #cbd8df; border-left: 5px solid #397ca9; border-radius: 10px; background: #fff; }
.briefhelfer-analysis-field.is-sicher { border-left-color: #248052; }
.briefhelfer-analysis-field.is-wahrscheinlich { border-left-color: #397ca9; }
.briefhelfer-analysis-field.is-unklar { border-left-color: #c07a00; background: #fffdf7; }
.briefhelfer-analysis-field.is-nicht-gefunden { border-left-color: #a7afb4; background: #f7f8f8; }
.briefhelfer-analysis-field__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.briefhelfer-analysis-field h4 { margin: 0; font-size: 17px; }
.briefhelfer-analysis-field__value { margin-top: 10px; color: #172b36; font-size: 16px; font-weight: 750; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.briefhelfer-analysis-field.is-nicht-gefunden .briefhelfer-analysis-field__value { color: #69747a; font-weight: 500; }
.briefhelfer-analysis-field__source { margin: 9px 0 0; color: #62717a; font-size: 12px; }
.briefhelfer-analysis-field__evidence { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid #e0e7ea; color: #4c5c65; font-size: 13px; line-height: 1.45; }
.briefhelfer-analysis-missing { margin-top: 15px; border: 1px solid #d4dadd; border-radius: 10px; background: #fafbfb; }
.briefhelfer-analysis-missing summary { padding: 13px 15px; color: #4c5960; font-weight: 750; cursor: pointer; }
.briefhelfer-analysis-missing .is-missing-grid { padding: 0 12px 12px; }
.briefhelfer-analysis-empty { padding: 14px; border-radius: 9px; background: #fff5e1; }
.briefhelfer-analysis-warnings { margin: 16px 0 0; padding: 13px 15px; border: 1px solid #e3b660; border-radius: 9px; color: #6c4608; background: #fff8e8; }
.briefhelfer-analysis-warnings strong { display: block; }
.briefhelfer-analysis-warnings ul { margin: 7px 0 0 20px; }
.briefhelfer-analysis-safety { margin: 16px 0; padding: 14px 15px; border: 1px solid #d4dadd; border-radius: 9px; color: #48565e; background: #f7f8f8; font-size: 14px; font-weight: 700; }
.briefhelfer-analysis-retry-button { color: #244638; background: #e1eee7; border: 1px solid #a9c5b7; }
.briefhelfer-analysis-retry-button:hover { background: #d4e7dc; }

@media (max-width: 760px) {
  .briefhelfer-analysis-stage { margin-left: -1px; margin-right: -1px; padding: 17px 13px; border-radius: 11px; }
  .briefhelfer-analysis-stage__header { display: block; }
  .briefhelfer-analysis-provider { max-width: 100%; margin-top: 9px; }
  .briefhelfer-analysis-fields__grid { grid-template-columns: 1fr; }
  .briefhelfer-analysis-field__header { display: block; }
  .briefhelfer-analysis-status { margin-top: 6px; }
}

/* M005 – verständliche Bürgeransicht */
.briefhelfer-explanation-stage {
  margin-top: 22px;
  padding: 22px;
  border: 2px solid #b9d5c7;
  border-radius: 16px;
  background: #fbfefd;
}
.briefhelfer-explanation-stage__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.briefhelfer-explanation-stage__header h3 { margin: 3px 0 0; font-size: 27px; color: #10283b; }
.briefhelfer-explanation-kicker { color: #176b45; font-size: 13px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.briefhelfer-explanation-badge { display: inline-block; padding: 7px 11px; border-radius: 999px; color: #155239; background: #e0f1e8; font-size: 12px; font-weight: 850; text-align: center; }
.briefhelfer-explanation-intro { margin: 14px 0; color: #425b50; font-size: 16px; line-height: 1.55; }
.briefhelfer-explanation-progress { margin: 14px 0; padding: 15px 17px; border-radius: 10px; font-weight: 800; }
.briefhelfer-explanation-progress.is-working { color: #155239; background: #e4f4eb; }
.briefhelfer-explanation-progress.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-explanation-result { margin-top: 16px; }
.briefhelfer-explanation-result__summary { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 15px; border-radius: 11px; background: #e3f2e9; }
.briefhelfer-explanation-result__summary strong { font-size: 19px; }
.briefhelfer-explanation-result__summary p { margin: 3px 0 0; color: #40574d; font-size: 14px; }
.briefhelfer-explanation-original-notice { margin: 14px 0 17px; padding: 13px 15px; border-left: 6px solid #176b45; border-radius: 8px; color: #24493a; background: #eef7f2; font-weight: 750; }
.briefhelfer-explanation-critical { margin: 14px 0; padding: 17px; border: 2px solid #b3261e; border-left-width: 8px; border-radius: 11px; color: #6e1511; background: #fff0ef; }
.briefhelfer-explanation-critical strong { display: block; font-size: 20px; }
.briefhelfer-explanation-critical p { margin: 7px 0; }
.briefhelfer-explanation-critical ul { margin: 8px 0 0 21px; }
.briefhelfer-citizen-card { margin: 13px 0; padding: 18px; border: 1px solid #c8d9d1; border-left: 6px solid #388261; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(25, 66, 49, .05); }
.briefhelfer-citizen-card.is-overview { border-left-color: #176b45; background: #f8fcfa; }
.briefhelfer-citizen-card.is-actions { border-left-color: #236f9d; background: #f8fbfd; }
.briefhelfer-citizen-card.is-deadline { border-left-color: #c57600; background: #fffdf7; }
.briefhelfer-citizen-card.is-money { border-left-color: #6d5a19; background: #fffef8; }
.briefhelfer-citizen-card.is-uncertain { border-left-color: #c57600; background: #fffaf0; }
.briefhelfer-citizen-card h4 { margin: 0 0 10px; color: #10283b; font-size: 20px; line-height: 1.3; }
.briefhelfer-citizen-card p { margin: 0; color: #263b45; font-size: 17px; line-height: 1.6; white-space: pre-line; }
.briefhelfer-citizen-card ol,
.briefhelfer-citizen-card ul { margin: 7px 0 0 23px; color: #263b45; font-size: 16px; line-height: 1.55; }
.briefhelfer-citizen-card li + li { margin-top: 8px; }
.briefhelfer-citizen-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.briefhelfer-citizen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.briefhelfer-citizen-grid .briefhelfer-citizen-card { margin: 0; }
.briefhelfer-explanation-status { display: inline-block; flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.briefhelfer-explanation-status.is-sicher { color: #075c34; background: #d8f4e6; }
.briefhelfer-explanation-status.is-wahrscheinlich { color: #274e6c; background: #deedf8; }
.briefhelfer-explanation-status.is-unklar { color: #6f4900; background: #fff0c7; }
.briefhelfer-explanation-status.is-nicht-gefunden { color: #5b6165; background: #e9ecee; }
.briefhelfer-explanation-deadline-value,
.briefhelfer-explanation-money-display { margin-top: 6px !important; font-size: 19px !important; font-weight: 850; }
.briefhelfer-explanation-deadline-notice,
.briefhelfer-explanation-money-notice { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid #e5ded0; color: #5f5545 !important; font-size: 14px !important; font-weight: 650; }
.briefhelfer-explanation-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.briefhelfer-explanation-detail { min-width: 0; padding: 12px; border: 1px solid #d8e2dd; border-radius: 9px; background: #fafcfb; }
.briefhelfer-explanation-detail strong { display: block; margin-bottom: 5px; color: #42564d; font-size: 13px; }
.briefhelfer-explanation-detail span { display: block; color: #172b36; font-size: 16px; font-weight: 750; white-space: pre-line; overflow-wrap: anywhere; }
.briefhelfer-explanation-detail__status { display: inline-block; margin-top: 7px; padding: 3px 6px; border-radius: 999px; color: #53625b; background: #edf1ef; font-size: 11px; font-weight: 750; }
.briefhelfer-explanation-detail__status.is-unklar { color: #6f4900; background: #fff0c7; }
.briefhelfer-explanation-detail__status.is-wahrscheinlich { color: #274e6c; background: #deedf8; }
.briefhelfer-explanation-detail__status.is-sicher { color: #075c34; background: #d8f4e6; }
.briefhelfer-explanation-legal-notice { margin: 16px 0; padding: 15px 16px; border: 1px solid #d4dadd; border-radius: 10px; color: #48565e; background: #f7f8f8; font-size: 14px; font-weight: 750; line-height: 1.55; }
.briefhelfer-explanation-retry-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px; border: 1px solid #a9c5b7; border-radius: 9px; color: #244638; background: #e1eee7; font-weight: 800; cursor: pointer; }
.briefhelfer-explanation-retry-button:hover { background: #d4e7dc; }
.briefhelfer-explanation-retry-button:disabled { cursor: not-allowed; opacity: .55; }

@media (max-width: 700px) {
  .briefhelfer-explanation-stage { margin-left: -1px; margin-right: -1px; padding: 17px 13px; border-radius: 11px; }
  .briefhelfer-explanation-stage__header { display: block; }
  .briefhelfer-explanation-badge { margin-top: 9px; }
  .briefhelfer-citizen-grid,
  .briefhelfer-explanation-details { grid-template-columns: 1fr; }
  .briefhelfer-citizen-card { padding: 16px 14px; }
  .briefhelfer-citizen-card h4 { font-size: 19px; }
  .briefhelfer-citizen-card p { font-size: 16px; }
  .briefhelfer-citizen-card__heading { display: block; }
  .briefhelfer-explanation-status { margin-top: 6px; }
}

/* M006 – Antwort-Assistent */
.briefhelfer-answer-stage {
  margin-top: 24px;
  padding: 22px;
  border: 2px solid #c9d8cf;
  border-radius: 16px;
  background: #fbfdfc;
  text-align: left;
}
.briefhelfer-answer-stage__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}
.briefhelfer-answer-stage__header h3 { margin: 3px 0 0; color: #10283b; font-size: 27px; }
.briefhelfer-answer-kicker { color: #176b45; font-size: 13px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.briefhelfer-answer-provider { display: inline-block; max-width: 48%; padding: 7px 11px; border-radius: 999px; color: #155239; background: #e0f1e8; font-size: 12px; font-weight: 850; text-align: center; }
.briefhelfer-answer-decision { margin-top: 17px; padding: 20px; border: 1px solid #b9d5c7; border-radius: 13px; background: #f5fbf8; }
.briefhelfer-answer-decision h4 { margin: 0 0 9px; color: #10283b; font-size: 22px; line-height: 1.35; }
.briefhelfer-answer-decision p { margin: 0 0 16px; color: #40574d; font-size: 16px; line-height: 1.55; }
.briefhelfer-answer-unavailable { margin: 12px 0; padding: 13px 15px; border: 1px solid #e3b660; border-radius: 9px; color: #6c4608; background: #fff7e5; font-weight: 750; }
.briefhelfer-answer-choice-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.briefhelfer-answer-yes-button,
.briefhelfer-answer-no-button,
.briefhelfer-answer-change-button,
.briefhelfer-answer-generate-button,
.briefhelfer-answer-copy-button,
.briefhelfer-answer-style-button {
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.briefhelfer-answer-yes-button,
.briefhelfer-answer-generate-button {
  color: #fff;
  background: var(--briefhelfer-button);
}
.briefhelfer-answer-no-button,
.briefhelfer-answer-change-button,
.briefhelfer-answer-copy-button,
.briefhelfer-answer-style-button {
  color: #244638;
  background: #e1eee7;
  border-color: #a9c5b7;
}
.briefhelfer-answer-yes-button:hover,
.briefhelfer-answer-generate-button:hover { filter: brightness(.96); }
.briefhelfer-answer-no-button:hover,
.briefhelfer-answer-change-button:hover,
.briefhelfer-answer-copy-button:hover,
.briefhelfer-answer-style-button:hover { background: #d4e7dc; }
.briefhelfer-answer-yes-button:disabled,
.briefhelfer-answer-change-button:disabled,
.briefhelfer-answer-generate-button:disabled,
.briefhelfer-answer-copy-button:disabled,
.briefhelfer-answer-style-button:disabled { cursor: not-allowed; opacity: .55; }
.briefhelfer-answer-declined { margin-top: 16px; padding: 17px; border-left: 6px solid #71847a; border-radius: 10px; color: #33463d; background: #f0f4f2; }
.briefhelfer-answer-declined strong { display: block; font-size: 18px; }
.briefhelfer-answer-declined p { margin: 7px 0 13px; line-height: 1.55; }
.briefhelfer-answer-questionnaire { margin-top: 17px; }
.briefhelfer-answer-progress,
.briefhelfer-answer-rewrite-progress { margin: 14px 0; padding: 14px 16px; border-radius: 9px; font-weight: 800; }
.briefhelfer-answer-progress.is-working,
.briefhelfer-answer-rewrite-progress.is-working { color: #155239; background: #e4f4eb; }
.briefhelfer-answer-progress.is-error,
.briefhelfer-answer-rewrite-progress.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-answer-critical { margin: 14px 0; padding: 16px; border: 2px solid #b3261e; border-left-width: 7px; border-radius: 10px; color: #6e1511; background: #fff0ef; }
.briefhelfer-answer-critical strong { display: block; font-size: 19px; }
.briefhelfer-answer-critical p { margin: 7px 0 0; }
.briefhelfer-answer-question-intro { margin: 14px 0; padding: 13px 15px; border-left: 5px solid #176b45; border-radius: 8px; color: #24493a; background: #eef7f2; font-weight: 750; }
.briefhelfer-answer-questions { display: grid; gap: 13px; }
.briefhelfer-answer-question { padding: 16px; border: 1px solid #cbdad2; border-radius: 11px; background: #fff; }
.briefhelfer-answer-question label { display: block; margin-bottom: 8px; color: #172b36; font-size: 17px; font-weight: 850; line-height: 1.4; }
.briefhelfer-answer-required { color: #b3261e; }
.briefhelfer-answer-question select,
.briefhelfer-answer-question textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  padding: 11px 12px;
  border: 1px solid #9fb5aa;
  border-radius: 8px;
  color: #172b36;
  background: #fff;
  font: inherit;
  font-size: 16px;
}
.briefhelfer-answer-question textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.briefhelfer-answer-question select:focus,
.briefhelfer-answer-question textarea:focus,
.briefhelfer-answer-editor:focus { outline: 3px solid rgba(23,107,69,.2); border-color: #176b45; }
.briefhelfer-answer-question__help { margin: 8px 0 0; color: #5a6d63; font-size: 13px; line-height: 1.45; }
.briefhelfer-answer-form-message { margin: 14px 0; padding: 13px 15px; border-radius: 9px; font-weight: 750; }
.briefhelfer-answer-form-message.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-answer-form-message.is-info { color: #234e70; background: #e5f3ff; }
.briefhelfer-answer-generate-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 16px; }
.briefhelfer-answer-generate-button.is-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: briefhelfer-spin .8s linear infinite;
}
.briefhelfer-answer-result { margin-top: 18px; }
.briefhelfer-answer-result__summary { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 15px; border-radius: 11px; background: #e3f2e9; }
.briefhelfer-answer-result__summary strong { font-size: 19px; }
.briefhelfer-answer-result__summary p { margin: 3px 0 0; color: #40574d; font-size: 14px; }
.briefhelfer-answer-warnings,
.briefhelfer-answer-placeholders { margin: 13px 0; padding: 14px 16px; border-radius: 10px; }
.briefhelfer-answer-warnings { border: 1px solid #e3b660; color: #6c4608; background: #fff8e8; }
.briefhelfer-answer-placeholders { border: 1px solid #8fb7d2; color: #234e70; background: #eef7fd; }
.briefhelfer-answer-warnings strong,
.briefhelfer-answer-placeholders strong { display: block; margin-bottom: 6px; }
.briefhelfer-answer-warnings ul,
.briefhelfer-answer-placeholders ul { margin: 0 0 0 20px; }
.briefhelfer-answer-editor-label { display: block; margin: 17px 0 8px; color: #10283b; font-size: 20px; font-weight: 900; }
.briefhelfer-answer-editor { box-sizing: border-box; width: 100%; min-height: 480px; padding: 17px; resize: vertical; border: 2px solid #a9c5b7; border-radius: 11px; color: #1f2c26; background: #fff; font: 16px/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.briefhelfer-answer-editor-note { margin: 9px 0 15px; color: #5a665f; font-size: 14px; line-height: 1.5; }
.briefhelfer-answer-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.briefhelfer-answer-legal-notice { margin: 16px 0 0; padding: 15px 16px; border: 1px solid #d4dadd; border-radius: 10px; color: #48565e; background: #f7f8f8; font-size: 14px; font-weight: 750; line-height: 1.55; }
.briefhelfer-answer-no-send { margin-top: 12px; padding: 14px 16px; border-left: 6px solid #176b45; border-radius: 9px; color: #24493a; background: #eef7f2; line-height: 1.5; }

@media (max-width: 760px) {
  .briefhelfer-answer-stage { margin-left: -1px; margin-right: -1px; padding: 17px 13px; border-radius: 11px; }
  .briefhelfer-answer-stage__header { display: block; }
  .briefhelfer-answer-provider { max-width: 100%; margin-top: 9px; }
  .briefhelfer-answer-decision { padding: 16px 13px; }
  .briefhelfer-answer-decision h4 { font-size: 20px; }
  .briefhelfer-answer-choice-buttons { grid-template-columns: 1fr; }
  .briefhelfer-answer-question { padding: 14px 12px; }
  .briefhelfer-answer-question label { font-size: 16px; }
  .briefhelfer-answer-actions { grid-template-columns: 1fr 1fr; }
  .briefhelfer-answer-editor { min-height: 520px; padding: 13px; font-size: 15px; }
}

@media (max-width: 430px) {
  .briefhelfer-answer-actions { grid-template-columns: 1fr; }
}
.briefhelfer-answer-data-note { margin: 12px 0 15px; padding: 12px 14px; border: 1px solid #d3ded8; border-radius: 9px; color: #4d6056; background: #f6f8f7; font-size: 13px; line-height: 1.5; }

/* M007 – Export und lokales Speichern. */
.briefhelfer-export-stage {
  margin-top: 22px;
  padding: 19px;
  border: 2px solid #b8d1c4;
  border-radius: 12px;
  background: #f6faf8;
}
.briefhelfer-export-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--briefhelfer-primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.briefhelfer-export-stage h4 {
  margin: 0;
  color: #10283b;
  font-size: 22px;
  line-height: 1.25;
}
.briefhelfer-export-stage > p {
  margin: 9px 0 16px;
  color: #40574d;
  line-height: 1.55;
}
.briefhelfer-export-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.briefhelfer-export-email-button,
.briefhelfer-export-print-button,
.briefhelfer-export-pdf-button,
.briefhelfer-export-local-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 55px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.briefhelfer-export-email-button {
  grid-column: 1 / -1;
  color: #fff;
  border-color: #0e6b44;
  background: #176b45;
  font-size: 17px;
}
.briefhelfer-export-print-button {
  color: #244638;
  border-color: #a9c5b7;
  background: #e1eee7;
}
.briefhelfer-export-pdf-button {
  color: #fff;
  background: var(--briefhelfer-button);
}
.briefhelfer-export-local-button {
  color: #234e70;
  border-color: #9fbfd4;
  background: #eaf5fc;
}
.briefhelfer-export-email-button:hover { filter: brightness(.96); }
.briefhelfer-export-print-button:hover { background: #d4e7dc; }
.briefhelfer-export-pdf-button:hover { filter: brightness(.96); }
.briefhelfer-export-local-button:hover { background: #dceff9; }
.briefhelfer-export-email-button:disabled,
.briefhelfer-export-print-button:disabled,
.briefhelfer-export-pdf-button:disabled,
.briefhelfer-export-local-button:disabled { cursor: not-allowed; opacity: .55; }
.briefhelfer-export-pdf-button.is-loading::after {
  content: '';
  width: 17px;
  height: 17px;
  border: 3px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: briefhelfer-spin .8s linear infinite;
}
.briefhelfer-export-progress {
  margin-top: 13px;
  padding: 13px 15px;
  border-radius: 9px;
  font-weight: 800;
  line-height: 1.45;
}
.briefhelfer-export-progress.is-working { color: #234e70; background: #e5f3ff; }
.briefhelfer-export-progress.is-success { color: #155239; background: #e4f4eb; }
.briefhelfer-export-progress.is-error { color: #7c1717; background: #ffe3e3; }
.briefhelfer-export-privacy {
  margin: 13px 0 0 !important;
  padding-top: 12px;
  border-top: 1px solid #d3ded8;
  color: #5a6d63 !important;
  font-size: 13px;
}

@media (max-width: 760px) {
  .briefhelfer-export-stage { padding: 16px 13px; }
  .briefhelfer-export-actions { grid-template-columns: 1fr; }
  .briefhelfer-export-email-button,
  .briefhelfer-export-print-button,
  .briefhelfer-export-pdf-button,
  .briefhelfer-export-local-button { min-height: 60px; font-size: 17px; }
}

/* M008 – Datenschutz und Sicherheit */
.briefhelfer-security-warning,
.briefhelfer-processing-notice {
  margin: 0 0 22px;
  padding: 18px 20px;
  border-radius: 16px;
  line-height: 1.55;
}

.briefhelfer-security-warning {
  border: 2px solid #b42318;
  background: #fff1f0;
  color: #7a1710;
}

.briefhelfer-processing-notice {
  border: 1px solid #b8d4c7;
  background: #f1f8f5;
  color: #173f31;
}

.briefhelfer-security-warning strong,
.briefhelfer-processing-notice strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05em;
}

.briefhelfer-security-warning p,
.briefhelfer-processing-notice p {
  margin: 5px 0 0;
}

/* M009 – Verbindungsstatus und abschließende Bedienoptimierung */
.briefhelfer-network-status {
	margin: 0 0 18px;
	padding: 14px 16px;
	border: 2px solid transparent;
	border-radius: 12px;
	font-weight: 700;
	line-height: 1.45;
}

.briefhelfer-network-status.is-offline {
	color: #7a2500;
	background: #fff1e8;
	border-color: #dc6b2f;
}

.briefhelfer-network-status.is-online {
	color: #14532d;
	background: #edf8f1;
	border-color: #6ab187;
}

.briefhelfer-app button:focus-visible,
.briefhelfer-app a:focus-visible,
.briefhelfer-app input:focus-visible,
.briefhelfer-app textarea:focus-visible,
.briefhelfer-app [tabindex]:focus-visible {
	outline: 3px solid #1d4ed8;
	outline-offset: 3px;
}

@media (pointer: coarse) {
	.briefhelfer-app button,
	.briefhelfer-action-button,
	.briefhelfer-privacy-popup-open {
		min-height: 48px;
	}
}

@media (max-width: 600px) {
	.briefhelfer-answer-editor,
	.briefhelfer-app input,
	.briefhelfer-app textarea,
	.briefhelfer-app select {
		font-size: 16px;
	}
}

/* M010 – E-Mail-Assistent */
.briefhelfer-source-choice {
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid #c9ddd3;
  border-radius: 16px;
  background: #f7fbf9;
}
.briefhelfer-source-choice > strong,
.briefhelfer-email-method > strong {
  display: block;
  margin-bottom: 12px;
  color: #102a20;
  font-size: 18px;
}
.briefhelfer-source-choice__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.briefhelfer-source-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  padding: 14px 16px;
  border: 2px solid #bad2c6;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.briefhelfer-source-card:hover { border-color: var(--briefhelfer-primary); }
.briefhelfer-source-card.is-selected {
  border-color: var(--briefhelfer-primary);
  background: #eaf5ef;
  box-shadow: 0 0 0 3px rgba(23, 107, 69, .1);
}
.briefhelfer-source-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.briefhelfer-source-card .dashicons {
  width: 32px;
  height: 32px;
  color: var(--briefhelfer-primary);
  font-size: 32px;
}
.briefhelfer-source-card span:last-child { display: flex; flex-direction: column; gap: 3px; }
.briefhelfer-source-card strong { font-size: 18px; }
.briefhelfer-source-card small { color: #52665c; font-size: 14px; line-height: 1.35; }
.briefhelfer-source-card:has(input:focus-visible) {
  outline: 3px solid #1d4ed8;
  outline-offset: 3px;
}

.briefhelfer-email-help p { margin: 10px 0 0; }
.briefhelfer-email-method {
  margin: 0 0 20px;
  padding: 17px 18px;
  border: 1px solid #c8d9e8;
  border-radius: 14px;
  background: #f4f8fc;
}
.briefhelfer-email-method__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.briefhelfer-email-method__options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}
.briefhelfer-email-method__options input { width: 20px; height: 20px; }

.briefhelfer-email-text-panel {
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #bfd5ca;
  border-radius: 16px;
  background: #fbfdfc;
}
.briefhelfer-email-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 15px;
}
.briefhelfer-email-fields-grid label,
.briefhelfer-email-body-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #162e23;
  font-weight: 700;
}
.briefhelfer-email-fields-grid input,
.briefhelfer-email-body-label textarea {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #a9c5b8;
  border-radius: 10px;
  background: #fff;
  color: #13241c;
  font: inherit;
}
.briefhelfer-email-fields-grid input { min-height: 48px; padding: 10px 12px; }
.briefhelfer-email-body-label textarea {
  min-height: 250px;
  padding: 14px;
  line-height: 1.55;
  resize: vertical;
}
.briefhelfer-email-char-count {
  margin: 8px 0 0;
  text-align: right;
  color: #607268;
  font-size: 13px;
}
.briefhelfer-email-char-count.is-near-limit { color: #9a3412; font-weight: 700; }
.briefhelfer-file-preview.is-eml {
  background: #e9f3fb;
  color: #185a84;
  font-size: 22px;
  font-weight: 900;
}
.briefhelfer-eml-preview {
  max-width: 100%;
  max-height: 70vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #c9d9e5;
  border-radius: 10px;
  background: #f8fbfd;
  color: #17242d;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 700px) {
  .briefhelfer-source-choice__options,
  .briefhelfer-email-fields-grid { grid-template-columns: 1fr; }
  .briefhelfer-source-card { min-height: 72px; }
  .briefhelfer-email-method__options { flex-direction: column; gap: 4px; }
  .briefhelfer-email-text-panel { padding: 14px; }
}


/* M011 – Vorlesen und Spracheingabe */
.briefhelfer-explanation-result__summary,
.briefhelfer-answer-result__summary {
  flex-wrap: wrap;
}
.briefhelfer-result-summary__text {
  flex: 1 1 260px;
  min-width: 0;
}
.briefhelfer-read-aloud-button,
.briefhelfer-voice-input-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #7cae95;
  border-radius: 9px;
  color: #164b34;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}
.briefhelfer-read-aloud-button {
  margin-left: auto;
}
.briefhelfer-read-aloud-button:hover,
.briefhelfer-voice-input-button:hover {
  background: #f1f8f4;
}
.briefhelfer-read-aloud-button.is-speaking,
.briefhelfer-voice-input-button.is-listening {
  color: #fff;
  border-color: #a11f1f;
  background: #b42323;
}
.briefhelfer-read-aloud-button .dashicons,
.briefhelfer-voice-input-button .dashicons {
  width: 20px;
  height: 20px;
  font-size: 20px;
}
.briefhelfer-voice-input-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
  margin-top: 10px;
}
.briefhelfer-voice-input-button:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.briefhelfer-voice-input-status {
  flex: 1 1 230px;
  color: #52665c;
  font-size: 13px;
  line-height: 1.4;
}
.briefhelfer-voice-privacy-note {
  margin: -2px 0 14px;
  padding: 11px 13px;
  border-radius: 8px;
  color: #4d5f55;
  background: #f3f6f4;
  font-size: 13px;
  line-height: 1.45;
}
@media (max-width: 680px) {
  .briefhelfer-read-aloud-button {
    width: 100%;
    margin-left: 0;
  }
  .briefhelfer-voice-input-button {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }
  .briefhelfer-voice-input-status {
    flex-basis: 100%;
  }
}
