.rd425-page {
  width: 100%;
  min-width: 0;
}

.rd425-header,
.rd425-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rd425-header {
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
}

.rd425-heading h3 {
  margin: 2px 0;
  font-size: 19px;
}

.rd425-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.rd425-toolbar,
.rd425-actions,
.rd425-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rd425-toolbar {
  justify-content: flex-end;
}

.rd425-page[data-read-only="true"] .rd425-toolbar [data-current],
.rd425-page[data-read-only="true"] .rd425-toolbar [data-upload],
.rd425-page[data-read-only="true"] .rd425-actions {
  display: none;
}

.rd425-page[data-read-only="true"] .rd425-field input,
.rd425-page[data-read-only="true"] .rd425-field select,
.rd425-page[data-read-only="true"] .rd425-field textarea,
.rd425-page[data-read-only="true"] .rd425-comment textarea {
  pointer-events: none;
  background: #f7f6f2;
  color: var(--ink);
}

.rd425-notes {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f6f2;
  color: var(--muted);
  font-size: 12px;
}

.rd425-notes-text p {
  margin: 0 0 3px;
}

.rd425-notes-text p:last-child {
  margin-bottom: 0;
}

.rd425-job {
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid #d6c28d;
  background: #fff6e7;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}

.rd425-job-failed {
  border-color: #ffd1ca;
  background: var(--danger-bg);
  color: var(--danger);
}

.rd425-group {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.rd425-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  background: #f2f5f4;
  font-size: 14px;
  font-weight: 700;
}

.rd425-group > summary::-webkit-details-marker {
  display: none;
}

.rd425-group > summary::before {
  content: "+";
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.rd425-group[open] > summary::before {
  content: "-";
}

.rd425-group > summary span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.rd425-group > summary small {
  min-width: 24px;
  color: var(--muted);
  text-align: right;
  font-size: 11px;
}

.rd425-group-body {
  min-width: 0;
}

.rd425-row {
  min-width: 0;
  padding: 12px 10px;
  border-top: 1px solid #e7e2d9;
  overflow-wrap: anywhere;
}

.rd425-row:first-child {
  border-top: 0;
}

.rd425-row h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.rd425-row-head .badge {
  min-height: 24px;
  flex: 0 0 auto;
  padding: 3px 7px;
  white-space: nowrap;
}

.rd425-status-clear {
  background: #e9f8ef;
  color: var(--ok);
}

.rd425-status-observation {
  background: var(--danger-bg);
  color: var(--danger);
}

.rd425-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.rd425-fields-disclosure {
  grid-template-columns: max-content minmax(220px, 1.5fr) repeat(2, minmax(180px, 1fr));
}

.rd425-fields-disclosure .rd425-field-E,
.rd425-fields-disclosure .rd425-field-E select {
  width: max-content;
  max-width: 100%;
}

.rd425-fields-disclosure .rd425-field-G,
.rd425-fields-disclosure .rd425-field-H,
.rd425-fields-disclosure .rd425-field-G textarea,
.rd425-fields-disclosure .rd425-field-H textarea {
  font-weight: 400;
}

.rd425-field,
.rd425-comment,
.rd425-observation-dialog label {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.rd425-field input,
.rd425-field select,
.rd425-field textarea,
.rd425-comment textarea {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
}

.rd425-field textarea,
.rd425-comment textarea {
  min-height: 58px;
}

.rd425-source {
  font-size: 10px;
  font-weight: 600;
}

.rd425-source-default {
  color: var(--accent);
}

.rd425-source-automatic {
  color: var(--blue);
}

.rd425-source-manual {
  color: var(--brand-dark);
}

.rd425-source-missing,
.rd425-missing {
  color: var(--warn);
}

.rd425-evidence {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.rd425-evidence li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border-left: 2px solid #b8c9c5;
  background: #f7f9f8;
  font-size: 11px;
}

.rd425-evidence a,
.rd425-evidence span {
  color: var(--brand-dark);
  font-weight: 800;
}

.rd425-evidence p {
  margin: 0;
  white-space: pre-wrap;
}

.rd425-missing {
  margin: 7px 0 0;
  font-size: 11px;
}

.rd425-missing:empty {
  display: none;
}

.rd425-comment {
  margin-top: 8px;
}

.rd425-actions,
.rd425-links {
  margin-top: 8px;
}

.rd425-actions button,
.rd425-links button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: normal;
}

.rd425-observation-dialog {
  width: min(700px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

.rd425-observation-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.rd425-observation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.rd425-observation-head h3 {
  min-width: 0;
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rd425-observation-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 12px 14px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.rd425-observation-context {
  margin: 0;
  color: var(--ink);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rd425-observation-dialog label {
  font-weight: 700;
}

.rd425-observation-dialog input,
.rd425-observation-dialog textarea {
  width: 100%;
  min-width: 0;
}

.rd425-observation-dialog textarea {
  min-height: clamp(88px, 24dvh, 160px);
}

.rd425-observation-actions {
  flex: 0 0 auto;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.rd425-observation-actions button {
  min-height: 40px;
}

.rd425-close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 1100px) {
  .rd425-fields-disclosure {
    grid-template-columns: max-content repeat(2, minmax(0, 1fr));
  }

  .rd425-fields-disclosure .rd425-field-F {
    grid-column: 2 / -1;
  }
}

@media (max-width: 650px) {
  .rd425-header,
  .rd425-row-head {
    flex-wrap: wrap;
  }

  .rd425-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .rd425-evidence li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .rd425-fields-disclosure {
    grid-template-columns: minmax(0, 1fr);
  }

  .rd425-fields-disclosure .rd425-field-F {
    grid-column: auto;
  }

  .rd425-actions button,
  .rd425-links button {
    min-height: 40px;
  }

  .rd425-observation-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .rd425-observation-form {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .rd425-observation-head,
  .rd425-observation-content,
  .rd425-observation-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  .rd425-observation-actions button {
    width: 100%;
    min-height: 44px;
  }
}
