.content-create,
.content-detail,
.content-editor {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.content-editor .field + .field {
  margin-top: 0;
}

.content-editor textarea {
  resize: vertical;
  line-height: 1.7;
}

.content-page-table {
  min-width: 720px;
}

.content-page-table td:first-child {
  min-width: 240px;
  max-width: 380px;
}

.content-workbench {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 24px;
}

.content-diagnosis,
.content-editor,
.content-comparison > section {
  min-width: 0;
}

.content-diagnosis > .field-help {
  margin: 10px 0 16px;
}

.content-detail h3,
.content-detail h4,
.content-task-source h3,
.content-task-source h4 {
  margin: 0;
}

.content-finding {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--surface);
}

.content-finding > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 600;
}

.content-finding > summary::before {
  content: '+';
  color: var(--muted);
}

.content-finding[open] > summary::before {
  content: '−';
}

.content-finding > summary > span:first-of-type {
  flex: 1;
}

.content-finding-body {
  display: grid;
  gap: 14px;
  padding: 0 15px 15px;
  font-size: 12px;
  line-height: 1.7;
}

.content-comparison {
  display: grid;
  gap: 14px;
}

.content-comparison h4,
.content-draft-preview h4 {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.content-plain {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}

.content-excerpt,
.content-source-html {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
  margin: 0;
}

.content-overwrite:not(:empty) {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--orange);
  border-radius: 8px;
}

.content-execution {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.content-execution > .button {
  justify-self: start;
}

.content-task-links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content-task-links li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  background: var(--canvas);
  border-radius: 8px;
  font-size: 12px;
}

.content-draft-preview {
  display: grid;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}

.content-task-source > .field-help,
.content-task-source > .help-disclosure {
  margin-top: 14px;
}

.content-diagnosis > .action-row {
  margin: 12px 0 20px;
}

.content-diagnosis > .help-disclosure {
  margin-top: 20px;
}

.content-comparison-view,
.assessment-fields,
.optimization-report,
.impact-task-list,
.impact-task-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

/* A table's intrinsic width must not enlarge the surrounding dialog grid. */
.content-comparison-view > *,
.optimization-report > *,
.impact-task-body > *,
.optimization-report .ops-section-head > * {
  min-width: 0;
  max-width: 100%;
}

.content-comparison-view .table-toolbar > .field + .field { margin-top: 0; }
.optimization-report .action-row { min-width: 0; max-width: 100%; }
.optimization-report .action-row .button { min-width: 0; overflow-wrap: anywhere; }

.assessment-snapshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}

.assessment-snapshots > section { min-width: 0; }
.assessment-snapshots h3,
.assessment-snapshots h4,
.impact-task-body h4 { margin: 0 0 12px; }
.assessment-checks { margin: 18px 0; min-width: 620px; }
.assessment-checks td { max-width: 280px; }
.assessment-fields { margin-top: 20px; }
.assessment-fields > h3 { margin: 0; }

.impact-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}

.impact-summary > div { display: grid; gap: 8px; min-width: 0; }
.impact-summary strong { font-size: 26px; }
.impact-summary span { font-size: 12px; color: var(--muted); }
.impact-task { border: 1px solid var(--line); border-radius: 10px; }
.impact-task > summary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 18px; cursor: pointer; }
.impact-task > summary > span:first-child { flex: 1; min-width: 160px; font-weight: 600; overflow-wrap: anywhere; }
.impact-task-body { padding: 0 18px 18px; }
.impact-task-body .field-help { overflow-wrap: anywhere; }
.impact-task-body > .button { justify-self: start; }
.impact-html-change { border-left: 3px solid var(--line); padding-left: 16px; }

@media (max-width: 760px) {
  .content-workbench,
  .content-create .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .assessment-snapshots { grid-template-columns: minmax(0, 1fr); }
  .impact-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-comparison-view > .table-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .content-comparison-view > .table-toolbar .field { max-width: none; }
  .content-comparison-view > .table-toolbar > .button { justify-self: start; }
}
