/* Redesign 2026-11: Dialoge „Neue Aufgabe“ und „Antwort prüfen“. */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#manual-task-dialog,
.message-dialog {
  padding: 22px 24px 20px;
  color: var(--ink, #1c1b1a);
}
#manual-task-dialog { max-width: 480px; }
.message-dialog { width: min(560px, calc(100% - 2rem)); }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.dialog-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.icon-close,
#close-task-dialog.icon-close {
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #6b6560);
  font-size: 1.2rem;
  line-height: 1;
}
.icon-close:hover,
#close-task-dialog.icon-close:hover { background: var(--hover, #f3efeb); color: var(--ink, #1c1b1a); }
#manual-task-feedback:empty { display: none; }
#manual-task-feedback { margin: 6px 0; color: var(--danger, #b42318); font-size: .85rem; }

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f1ede9;
}

/* Neue Aufgabe */
.task-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.task-form label { color: var(--muted, #6b6560); font-size: .78rem; font-weight: 500; }
.task-form label input,
.task-form label textarea { margin-top: 4px; color: var(--ink, #1c1b1a); }
.task-form-title input {
  margin-top: 0;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line, #ece8e4);
  border-radius: 0;
  font-size: 1.15rem;
  font-weight: 500;
}
.task-form-title input:focus-visible { outline: none; border-bottom-color: var(--brand, #e9763e); }
.task-form-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.task-form textarea { min-height: 96px; }
.task-form-more { margin: 0; padding: 0; border: 0; }
.task-form-more > summary {
  display: inline-block;
  padding: 4px 0;
  color: var(--muted, #6b6560);
  font-size: .82rem;
  font-weight: 500;
  list-style: none;
}
.task-form-more > summary::-webkit-details-marker { display: none; }
.task-form-more > summary:hover { color: var(--ink, #1c1b1a); }
.task-form-more[open] > summary { margin-bottom: 8px; }
.task-form-more label + label { margin-top: 10px; }
.task-form .optional { font-size: .72rem; color: #a8a19a; }

/* Antwort prüfen */
.message-task { margin: 0 0 6px; color: var(--muted, #6b6560); font-size: .85rem; }
.message-feedback:empty { display: none; }
.message-feedback { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fbf4ee; font-size: .82rem; }
.message-source { margin: 6px 0 2px; color: var(--muted, #6b6560); font-size: .78rem; }
.message-source-picker { margin: 0 0 10px; padding: 0; border: 0; }
.message-source-picker > summary { display: inline-block; color: var(--brand-dark, #9c421b); font-size: .78rem; font-weight: 500; }
.message-source-picker[open] { padding: 10px 12px; border: 1px solid var(--line, #ece8e4); border-radius: 10px; }
.message-source-picker[open] > summary { margin-bottom: 6px; }
.message-source-picker label { margin: .4rem 0; font-size: .78rem; }
.message-mode { margin: 10px 0; }
.message-mode[hidden] { display: none; }
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--hover, #f3efeb);
}
.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4a4541;
  font-size: .82rem;
}
.segmented button:hover { background: rgba(255, 255, 255, .6); color: var(--ink, #1c1b1a); }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink, #1c1b1a); font-weight: 600; box-shadow: 0 1px 2px rgba(28, 27, 26, .08); }
.message-dialog > label { margin: 10px 0; color: var(--muted, #6b6560); font-size: .78rem; font-weight: 500; }
.message-dialog > label textarea { margin-top: 4px; min-height: 9rem; background: #faf8f6; color: var(--ink, #1c1b1a); font-size: .9rem; }
.message-combine { margin: 8px 0; padding: 0; border: 0; }
.message-combine > summary { font-size: .82rem; color: #4a4541; }
.message-combine label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: .82rem; }
.message-combine input[type="checkbox"] { width: auto; margin: 0; }
.message-attachments {
  margin: 10px 0 6px;
  padding: 10px 12px;
  border: 1px dashed var(--field, #c9c2bb);
  border-radius: 10px;
}
.message-attachments label { margin: 0; font-size: .82rem; }
.message-attachments input[type="file"] { margin-top: 4px; padding: 4px 0; border: 0; font-size: .8rem; }
.message-hint { margin: 4px 0 0; color: var(--muted, #6b6560); font-size: .75rem; }
.message-rules { margin: 4px 0 0; padding: 0; border: 0; }
.message-rules > summary { display: inline-block; color: var(--muted, #6b6560); font-size: .75rem; font-weight: 500; }
.message-rules p { margin: 4px 0 0; color: var(--muted, #6b6560); font-size: .75rem; }
.message-check { display: flex; align-items: center; gap: 8px; margin: 6px 0; color: #4a4541; font-size: .78rem; font-weight: 400; }
.message-check input { width: auto; margin: 0; }
.message-attachments .message-attachment-confirm { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fbf4ee; cursor: pointer; }
.message-attachments .message-attachment-confirm[hidden] { display: none; }
.message-attachment-confirm input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--brand-dark, #9c421b); }
.message-dialog .message-recipients { margin: 6px 0 4px; color: #4a4541; font-size: .85rem; font-weight: 500; }
.message-dialog .message-source:empty { display: none; }
/* Andere Originalnachricht: schlanke Liste statt großer Knöpfe */
.message-choices { display: flex; flex-direction: column; max-height: 260px; margin-top: 8px; overflow-y: auto; border-top: 1px solid var(--line, #ece8e4); }
.message-dialog .message-choices .message-choice {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 7px 4px;
  border: 0;
  border-bottom: 1px solid #f1ede9;
  border-radius: 0;
  background: transparent;
  color: var(--ink, #161616);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}
.message-dialog .message-choices .message-choice:hover { background: #faf8f6; }
.message-dialog .message-choices .message-choice.is-match { font-weight: 600; }
.message-dialog .message-choices .message-choice.is-match::before { content: "Passt vermutlich · "; color: var(--brand-dark, #9c421b); font-weight: 500; }
/* „Zurück zur Liste“ / „Neu laden“: Knöpfe in Linkoptik, damit die Auswahl keine Sackgasse hat */
.message-link-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 2px; }
.message-dialog .message-link-actions .message-link,
.message-dialog .message-link-actions .message-link:hover {
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--brand-dark, #9c421b);
  font-size: .78rem;
  font-weight: 500;
  text-decoration: underline;
}
.message-html-source { margin: 8px 0; }
.message-html-source > summary { font-size: .82rem; color: var(--brand-dark, #9c421b); font-weight: 500; }
.message-html-source textarea { width: 100%; margin: 6px 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; line-height: 1.4; }
.message-draft-request { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #f6f3f0; }
.message-draft-request > p { flex: 1 1 100%; margin: 0; }
.message-draft-request input { flex: 1 1 220px; min-width: 0; margin: 0; }
.message-draft-request button { flex: 0 0 auto; }
.message-preview-box:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1ede9; }
.message-preview-box h3 { font-size: .95rem; }
.message-preview-box p { margin: 4px 0; font-size: .85rem; }

@media (max-width: 520px) {
  .task-form-row { grid-template-columns: minmax(0, 1fr); }
}
