.edit-layout.opinion-revision-active {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(300px, 390px);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: auto;
  min-height: 0;
}

.edit-layout.opinion-revision-active > .rule-matches-panel {
  display: none;
}

.opinion-revision-sidebar,
.opinion-revision-detail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: #faf9f6;
  color: #302d28;
  font-size: 13px;
}

.opinion-revision-sidebar {
  border-right: 1px solid #ddd8cf;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.opinion-revision-detail {
  border-left: 1px solid #ddd8cf;
  padding: 14px;
}

.opinion-revision-active .edit-left {
  min-width: 0;
  min-height: 0;
}

.opinion-revision-active #lo-editor-host {
  height: 100%;
  min-height: 0;
}

.opr-side-header,
.opr-detail-header,
.opr-item-top,
.opr-button-row,
.opr-side-actions,
.opr-round-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.opr-side-header {
  padding: 12px;
  font-size: 15px;
  border-bottom: 1px solid #e5e0d7;
}

.opr-icon-btn,
.opr-link-btn {
  border: 0;
  background: transparent;
  color: #6e624e;
  cursor: pointer;
  padding: 2px 5px;
}

.opr-icon-btn { font-size: 22px; }
.opr-link-btn { text-decoration: underline; }

.opr-round-select,
.opr-filters input,
.opr-filters select,
.opinion-revision-detail select,
.opinion-revision-detail textarea,
.opinion-revision-modal input,
.opinion-revision-modal select,
.opinion-revision-modal textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7d1c5;
  border-radius: 5px;
  background: #fff;
  color: inherit;
  padding: 7px 8px;
  font: inherit;
}

.opr-round-select {
  border: 0;
  border-bottom: 1px solid #e5e0d7;
  border-radius: 0;
}

.opr-progress {
  padding: 10px 12px;
  background: #f0ede5;
}

.opr-progress strong { font-size: 19px; margin-right: 5px; }
.opr-progress span { display: block; color: #8b553e; margin-top: 3px; }

.opr-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
}

.opr-filters input { grid-column: 1 / -1; }

.opr-item-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid #e5e0d7;
}

.opr-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e8e3da;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
}

.opr-item:hover,
.opr-item.selected { background: #ebe6da; }
.opr-item.selected { box-shadow: inset 3px 0 #877354; }
.opr-item-title { display: block; margin: 5px 0; line-height: 1.45; }
.opr-item-status { color: #746c60; font-size: 12px; white-space: nowrap; }
.opr-item-status.status-closed { color: #397153; }
.opr-item-status.status-pending_review { color: #93611f; }
.opr-item-status.status-needs_input,
.opr-item-status.status-unlocated { color: #a4463c; }
.opr-priority { color: #857664; font-size: 11px; font-style: normal; font-weight: normal; }
.opr-code { font-size: 17px; font-weight: 700; margin-right: 8px; }

.opr-side-actions {
  padding: 8px;
  border-top: 1px solid #e5e0d7;
}

.opinion-revision-detail h2 {
  font-size: 17px;
  line-height: 1.5;
  margin: 10px 0;
}

.opinion-revision-detail h3 {
  font-size: 14px;
  margin: 17px 0 8px;
}

.opinion-revision-detail section {
  border-top: 1px solid #e4ded3;
  margin-top: 14px;
  padding-top: 2px;
}

.opr-verbatim {
  color: #514b42;
  line-height: 1.65;
}

.opr-verbatim p,
.opr-draft blockquote {
  white-space: pre-wrap;
  word-break: break-word;
}

.opr-button-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 10px 0;
}

.opr-target,
.opr-evidence,
.opr-draft {
  border: 1px solid #ddd6c8;
  border-radius: 6px;
  background: #fff;
  padding: 9px;
  margin: 7px 0;
}

.opr-target.confirmed { border-left: 3px solid #4c8060; }
.opr-target p,
.opr-evidence p {
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  color: #575046;
}

.opr-target label { margin-right: 10px; }
.opr-warning { color: #a13f35; margin: 5px 0; }
.opr-risk { color: #8b611c; margin: 5px 0; }
.opr-draft h3 span { color: #93611f; font-size: 12px; font-weight: normal; }
.opr-draft-stats { color: #6e6558; margin: 8px 0; }
.opr-draft blockquote { border-left: 3px solid #d7cdb9; margin: 8px 0; padding-left: 10px; }
.opr-change { margin: 6px 0; }
.opr-change p { white-space: pre-wrap; word-break: break-word; }

.opinion-revision-modal {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.opr-modal-body { display: grid; gap: 12px; }
.opr-existing-rounds { display: grid; gap: 6px; }
.opr-round-row { padding: 8px; border-bottom: 1px solid #e5e0d7; }
.opr-round-row span { display: block; color: #7c7264; margin-top: 3px; }
.opr-form-grid { display: grid; gap: 10px; }
.opr-form-grid label,
.opinion-revision-modal label { display: grid; gap: 5px; }
.opr-file-label input { border: 0; padding-left: 0; }

.opr-model-panel,
.opr-cost-panel {
  display: grid;
  gap: 4px;
  padding: 9px 12px;
  border-bottom: 1px solid #e5e0d7;
}
.opr-model-panel > span,
.opr-cost-panel > span { color: #7b7265; font-size: 12px; }
.opr-model-panel strong { overflow-wrap: anywhere; font-weight: 500; }
.opr-model-panel .opr-link-btn,
.opr-cost-panel .opr-link-btn { justify-self: start; }
.opr-cost-total { display: grid; gap: 5px; padding: 12px; background: #f3efe5; }
.opr-cost-total strong { font-size: 24px; }
.opr-cost-table { width: 100%; border-collapse: collapse; background: #fff; color: #1e293b; }
.opr-cost-table th,
.opr-cost-table td { padding: 7px; border-bottom: 1px solid #e5e0d7; text-align: right; }
.opr-cost-table th:first-child,
.opr-cost-table td:first-child { text-align: left; }

.opr-auto-edit-panel {
  padding: 12px;
  border-bottom: 1px solid #ddd6c8;
  background: #f3efe5;
}
.opr-auto-edit-button { width: 100%; font-size: 15px; padding: 10px; }
.opr-auto-edit-panel p { color: #675e50; line-height: 1.5; margin: 8px 0; }
.opr-auto-hint { color: #7b7265; font-size: 12px; }
.opr-auto-run-state strong { margin-right: 8px; }
.opr-auto-run-state .opr-button-row { margin-bottom: 0; }
.opr-detail-label { padding: 10px 12px 4px; color: #756b5c; font-weight: 600; }
.opr-auto-intro { line-height: 1.7; color: #51493c; }
.opr-auto-progress-bar { width: 100%; height: 18px; }
.opr-auto-result-head { display: flex; justify-content: space-between; gap: 12px; }
.opr-auto-result-head strong { font-size: 18px; }
.opr-auto-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px; background: #f4f0e7; }
.opr-auto-item-list { display: grid; gap: 6px; max-height: 45vh; overflow-y: auto; }
.opr-auto-item { display: grid; gap: 4px; text-align: left; border: 1px solid #ddd6c8; border-radius: 5px; padding: 8px; background: #fff; cursor: pointer; }
.opr-auto-item em { color: #74695a; font-style: normal; }
.opr-auto-item small { white-space: pre-wrap; line-height: 1.45; }
.opr-auto-item.status-applied { border-left: 3px solid #4c8060; }
.opr-auto-item.status-partial { border-left: 3px solid #a77727; }
.opr-auto-item.status-manual,
.opr-auto-item.status-failed { border-left: 3px solid #a4463c; }

.opr-cost-table td small { display: block; color: #64748b; font-size: 11px; }
.opr-estimate-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.opr-estimate-actions > span { color: #7b7265; font-size: 12px; }
.opr-estimate-result { display: grid; gap: 5px; padding: 12px; border: 1px solid #ddd6c8; border-radius: 6px; background: #f8fafc; color: #1e293b; line-height: 1.5; }
.opr-estimate-result strong { font-size: 18px; }
.opr-estimate-result span,
.opr-estimate-result small { display: block; }
.opr-run-budget { padding: 7px 0; font-weight: 600; }
.opr-run-usage { color: #64748b; font-size: 12px; line-height: 1.6; }
.opr-resume-budget { padding: 8px; background: #f3efe5; }

@media (max-width: 1180px) {
  .edit-layout.opinion-revision-active {
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(270px, 330px);
  }
}

@media (max-width: 850px) {
  .edit-layout.opinion-revision-active {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .opinion-revision-sidebar,
  .opinion-revision-detail {
    max-height: 45vh;
    border: 0;
  }
  .opinion-revision-active .edit-left { height: 70vh; }
}
