/* Feedback-Knopf, -Dialog, Formularseite und Übersicht (E-12). Farben aus css/app.css, mit Rückfallwerten. */

.feedback-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- fester Knopf unten rechts ------------------------------------------------------------------------------ */

.feedback-open {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 1.4rem;
  background: var(--rot, #c0392b);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.feedback-open:hover {
  background: #a93226;
}

.feedback-open:focus-visible,
.feedback-form button:focus-visible,
.feedback-page-form button:focus-visible,
.feedback-link-button:focus-visible {
  outline: 3px solid #1f2328;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

/* --- Dialog ---------------------------------------------------------------------------------------------- */

.feedback-dialog {
  box-sizing: border-box;
  width: min(34rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  color: var(--grau-900, #1f2328);
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.feedback-dialog::backdrop {
  background: rgba(31, 35, 40, 0.55);
}

.feedback-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.feedback-field,
.feedback-kinds {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.feedback-kinds legend {
  padding: 0;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.feedback-kinds label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  margin-right: 1rem;
}

.feedback-field > label:first-child {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.feedback-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  font-weight: 600;
}

.feedback-form textarea,
.feedback-page-form textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 8rem;
  padding: 0.5rem;
  border: 1px solid #6b7280;
  border-radius: 0.25rem;
  font: inherit;
  resize: vertical;
}

.feedback-hint {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #4b5563;
}

.feedback-status {
  min-height: 1.25rem;
  margin: 0 0 0.5rem;
  color: #1f2328;
}

.feedback-error {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--rot, #c0392b);
  background: #fdecea;
  color: #7a1c13;
}

.feedback-error.is-visible {
  display: block;
}

.feedback-success {
  margin: 0 0 1rem;
  padding: 0.75rem;
  border-left: 4px solid #1a7f37;
  background: #e8f5e9;
  color: #14532d;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.feedback-form button,
.feedback-page-form button,
.feedback-link-button,
.feedback-image-dialog button {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 2px solid var(--rot, #c0392b);
  border-radius: 0.25rem;
  background: var(--rot, #c0392b);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.feedback-form button.feedback-secondary,
.feedback-link-button,
.feedback-image-dialog button.feedback-secondary {
  background: #fff;
  color: var(--rot, #c0392b);
}

.feedback-link-button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  text-decoration: none;
}

.feedback-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Nach dem Senden bleibt nur die Rückmeldung und „Schließen“ */
.feedback-form.is-done .feedback-field,
.feedback-form.is-done #feedback-send {
  display: none;
}

/* --- Formularseite ohne JavaScript -------------------------------------------------------------------------- */

.feedback-page-form {
  max-width: 34rem;
}

/* --- Übersicht ---------------------------------------------------------------------------------------------- */

/* Hinweis ohne oder mit abgelaufenem GitHub-Token (E-64) */
.feedback-github-hint {
  margin: 0 0 1rem;
}

.feedback-github-hint p {
  margin: 0 0 0.5rem;
}

.feedback-github-hint p:last-child,
.feedback-github-hint .form-actions {
  margin-bottom: 0;
}

.feedback-table-wrap {
  overflow-x: auto;
}

.feedback-table {
  width: 100%;
  border-collapse: collapse;
}

.feedback-table th,
.feedback-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #d1d5db;
  text-align: left;
  vertical-align: top;
}

.feedback-text {
  min-width: 14rem;
  overflow-wrap: anywhere;
}

.feedback-page {
  overflow-wrap: anywhere;
}

.feedback-thumb {
  display: block;
  max-width: 8rem;
  max-height: 6rem;
  border: 1px solid #9ca3af;
}

.feedback-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 0.75rem;
  background: #e5e7eb;
  color: #1f2328;
  font-size: 0.875rem;
  white-space: nowrap;
}

.feedback-badge-issue_created,
.feedback-badge-done {
  background: #dcfce7;
  color: #14532d;
}

.feedback-badge-issue_failed {
  background: #fde2e0;
  color: #7a1c13;
}

.feedback-pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.feedback-image-dialog {
  box-sizing: border-box;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  border: 0;
  border-radius: 0.5rem;
  overflow: auto;
}

.feedback-image-dialog::backdrop {
  background: rgba(31, 35, 40, 0.7);
}

.feedback-image-dialog img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
}

.feedback-image-caption {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

@media (max-width: 40rem) {
  .feedback-kinds label {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-open,
  .feedback-dialog {
    transition: none;
    animation: none;
  }
}

@media print {
  .feedback-root {
    display: none !important;
  }
}
