/* Фаза 15.7: широкая форма ошибки в границах существующей рабочей панели. */
#errorReportPanel.error-report-list {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

#errorReportPanel .error-report-section {
  width: 100%;
  max-width: none;
  min-width: 0;
}

#errorReportPanel .settings-section-head,
#errorReportPanel .settings-section-head > div,
#errorReportPanel .error-report-form {
  min-width: 0;
}

#errorReportPanel .settings-section-head p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

#errorReportPanel .error-report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: max-content 34px max-content 34px max-content minmax(96px, 1fr) max-content;
  gap: 3px 12px;
  align-items: stretch;
}

#errorReportPanel .error-report-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-column: 2;
  grid-row: 1 / 8;
  grid-template-rows: subgrid;
  gap: 3px;
  min-width: 0;
}

#errorReportPanel .error-report-fields label,
#errorReportPanel .error-report-fields select,
#errorReportPanel .error-report-fields textarea {
  min-width: 0;
  font-family: inherit;
}

#errorReportPanel .error-report-fields label {
  display: grid;
  grid-template-rows: subgrid;
  grid-column: 1;
  gap: 3px;
}
#errorReportPanel .error-report-fields label:nth-child(1) { grid-row: 1 / 3; }
#errorReportPanel .error-report-fields label:nth-child(2) { grid-row: 3 / 5; }
#errorReportPanel .error-report-fields label:nth-child(3) { grid-row: 5 / 7; }
#errorReportPanel .error-report-fields label:not(:first-child) > span { padding-top: 7px; }

#errorReportPanel .error-report-fields :is(select, textarea) {
  border-color: #cbd7e3;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
}

#errorReportPanel .error-report-fields select {
  height: 34px;
  min-height: 34px;
  padding: 5px 8px;
}

#errorReportPanel .error-report-fields textarea {
  min-height: 96px;
  padding: 8px;
  line-height: 1.4;
}

#errorReportPanel .error-report-fields textarea::placeholder {
  font: inherit;
}

#errorReportPanel .error-report-actions {
  grid-row: 7;
  display: flex;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  margin-top: 7px;
}

#errorReportPanel :is(.error-report-file-actions, .error-report-actions) .action-button {
  height: 34px;
  min-height: 34px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

#errorReportPanel #errorReportFileButton {
  min-width: 112px;
}

#errorReportPanel #sendErrorReportButton {
  width: 176px;
  max-width: 100%;
}

#errorReportPanel .error-report-dropzone {
  grid-column: 1;
  grid-row: 2 / 7;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  text-align: center;
}

#errorReportPanel .error-report-dropzone > div {
  min-width: 0;
  max-width: 100%;
}

#errorReportPanel .error-report-dropzone strong {
  font-weight: 600;
}

#errorReportPanel #errorReportFileStatus {
  overflow-wrap: anywhere;
  white-space: normal;
  width: 100%;
  height: 2.8em;
  overflow: auto;
  overscroll-behavior: contain;
  line-height: 1.4;
}

#errorReportPanel #errorReportFileStatus .error-report-file-name,
#errorReportPanel #errorReportFileStatus .error-report-file-size {
  display: inline;
  font-size: inherit;
  line-height: inherit;
}

#errorReportPanel .error-report-file-guidance {
  width: 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: left;
}

#errorReportPanel .error-report-file-guidance p {
  margin: 0;
  font-weight: 400;
  overflow-wrap: anywhere;
}

#errorReportPanel .error-report-file-guidance p + p {
  margin-top: 6px;
}

#errorReportPanel .error-report-file-actions {
  grid-column: auto;
  display: flex;
  height: 34px;
  gap: 8px;
  justify-content: center;
}

/* Строка сохраняет высоту, а без файла единственная кнопка стоит по центру. */
#errorReportPanel #errorReportFileClearButton[hidden] {
  display: none !important;
}
#errorReportPanel #errorReportFileClearButton { width: 80px; }

#errorReportPanel .error-report-feedback {
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  height: calc(34px + 4.2em);
  font-size: 12px;
}

#errorReportPanel .error-report-progress {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 4px;
  gap: 5px;
  min-height: 0;
  height: 28px;
  margin: 0;
}

/* hidden сохраняет место для этапа отправки, но исключает его из дерева доступности. */
#errorReportPanel .error-report-progress[hidden] {
  display: grid !important;
  visibility: hidden;
}

#errorReportPanel .error-report-progress-head {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

#errorReportPanel #errorReportMessage,
#errorReportPanel .error-report-progress-head {
  min-width: 0;
  overflow-wrap: anywhere;
}

#errorReportPanel #errorReportMessage {
  margin: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

#errorReportPanel :is(select, textarea, button, #errorReportFileStatus, #errorReportMessage, .error-report-progress-head):focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  #errorReportPanel .error-report-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
  }

  #errorReportPanel .error-report-fields {
    grid-column: 1;
    grid-row: 2;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  #errorReportPanel .error-report-fields label:nth-child(n) {
    grid-template-rows: auto auto;
    grid-row: auto;
  }

  #errorReportPanel .error-report-fields label:not(:first-child) > span {
    padding-top: 0;
  }

  #errorReportPanel .error-report-actions {
    grid-row: auto;
    margin-top: 0;
  }

  #errorReportPanel .error-report-dropzone {
    grid-column: 1;
    grid-row: 1;
    min-height: 160px;
    padding: 14px;
  }

  #errorReportPanel .error-report-fields select,
  #errorReportPanel .error-report-file-actions .action-button {
    min-height: 32px;
    height: 32px;
  }

  #errorReportPanel .error-report-actions .action-button {
    min-height: 40px;
    height: 40px;
  }

  #errorReportPanel .error-report-file-actions {
    height: 32px;
  }

  #errorReportPanel .error-report-feedback {
    height: calc(34px + 8.4em);
  }
}
