.document-type-review-open { height: 100vh; overflow: hidden; }
.workspace.document-type-edit-workspace .document-type-review-form { display: block; }
.workspace.document-type-edit-workspace .field { margin-bottom: 19px; }
.workspace.document-type-edit-workspace .field:last-child { margin-bottom: 0; }
.workspace.document-type-edit-workspace .field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.workspace.document-type-edit-workspace .field-label > span:first-child { min-width: 0; }
.workspace.document-type-edit-workspace .purpose-textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.workspace.document-type-edit-workspace .instruction-textarea { min-height: 156px; resize: vertical; line-height: 1.5; }
.workspace.document-type-edit-workspace .changed-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 7px; background: var(--blue-50); color: var(--blue-700); font-size: 10px; font-weight: 700; white-space: nowrap; }
.workspace.document-type-edit-workspace .changed-badge::before { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-500); content: ""; }
.workspace.document-type-edit-workspace .dirty-control:not(.error-control) { border-color: var(--blue-200); background: #fcfeff; }
.workspace.document-type-edit-workspace .form-error-summary { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 18px; border: 1px solid var(--red-200); border-radius: 10px; padding: 11px 12px; background: var(--red-100); color: var(--red-700); font-size: 11.5px; }
.workspace.document-type-edit-workspace .form-error-summary strong, .workspace.document-type-edit-workspace .form-error-summary span { display: block; }
.workspace.document-type-edit-workspace .document-type-panel-actions { min-height: 70px; justify-content: space-between; background: #fff; }
.workspace.document-type-edit-workspace .unsaved-status { display: flex; min-height: 18px; align-items: center; gap: 7px; color: var(--ink-600); font-size: 11.5px; }
.workspace.document-type-edit-workspace .saved-dot, .workspace.document-type-edit-workspace .unsaved-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.workspace.document-type-edit-workspace .saved-dot { background: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.workspace.document-type-edit-workspace .unsaved-dot { background: #d28a12; box-shadow: 0 0 0 3px #fff5df; }
.workspace.document-type-edit-workspace .form-actions { display: flex; align-items: center; gap: 8px; }
.workspace.document-type-edit-workspace .review-changes-button { min-width: 142px; }
.workspace.document-type-edit-workspace .btn[disabled] { cursor: not-allowed; opacity: .58; }
.workspace.document-type-edit-workspace .impact-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.workspace.document-type-edit-workspace .impact-header h3 { margin: 0; font-size: 12.5px; }
.workspace.document-type-edit-workspace .impact-count { display: inline-flex; flex: none; align-items: center; border: 1px solid var(--blue-200); border-radius: 999px; padding: 2px 7px; background: var(--blue-50); color: var(--blue-700); font-size: 10.5px; font-weight: 700; }
.workspace.document-type-edit-workspace .impact-copy { margin-bottom: 10px; }
.workspace .affected-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.workspace .affected-list li { display: grid; min-width: 0; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; }
.workspace .doc-mark { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 6px; background: var(--blue-50); color: var(--blue-600); }
.workspace .doc-mark svg { width: 13px; height: 13px; }
.workspace .doc-copy { min-width: 0; }
.workspace.document-type-edit-workspace .affected-list .doc-title, .document-type-dialog .affected-list .doc-title { display: block; overflow: hidden; color: var(--ink-800); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.workspace.document-type-edit-workspace .affected-list .doc-meta, .document-type-dialog .affected-list .doc-meta { display: block; color: var(--ink-500); font-size: 9.5px; }
.workspace .affected-more { margin-top: 9px; }
.workspace .affected-more summary { min-height: 32px; color: var(--blue-700); font-size: 10.5px; font-weight: 650; cursor: pointer; }
.workspace .affected-more .affected-list { margin-top: 7px; }
.workspace.document-type-edit-workspace .impact-rule { height: 1px; margin: 11px 0; background: var(--ink-150); }
.workspace.document-type-edit-workspace .future-note { display: flex; gap: 7px; color: var(--green-700); font-size: 10.5px; }
.workspace.document-type-edit-workspace .side-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; }
.workspace.document-type-edit-workspace .danger-zone { margin-top: 22px; }

.document-type-dialog-layer { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(23, 32, 42, .42); }
.document-type-dialog-layer[hidden] { display: none; }
.document-type-dialog { width: min(100%, 620px); overflow: hidden; border: 1px solid var(--ink-200); border-radius: 17px; background: var(--paper); box-shadow: 0 24px 80px rgba(23, 32, 42, .22); }
.document-type-sheet-handle { display: none; }
.document-type-dialog .dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--ink-150); padding: 20px 22px 17px; }
.document-type-dialog .dialog-header h2 { margin: 0; font-size: 20px; }
.document-type-dialog .dialog-header p { margin: 4px 0 0; color: var(--ink-600); font-size: 12.5px; }
.document-type-dialog .close-btn { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border: 1px solid var(--ink-200); border-radius: 9px; background: #fff; color: var(--ink-600); font-size: 20px; line-height: 1; cursor: pointer; }
.document-type-dialog .dialog-body { padding: 18px 22px 20px; }
.document-type-dialog .impact-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; border: 1px solid #c7dcf2; border-radius: 10px; padding: 11px 12px; background: var(--blue-50); color: #315674; font-size: 11.5px; }
.document-type-dialog .impact-banner-icon { flex: none; color: var(--blue-700); }
.document-type-dialog .impact-banner strong, .document-type-dialog .impact-banner span { display: block; }
.document-type-dialog .retry-banner { border-color: var(--red-200); background: var(--red-100); color: var(--red-700); }
.document-type-dialog .dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.document-type-dialog .review-section { min-width: 0; border: 1px solid var(--ink-150); border-radius: 11px; padding: 13px; background: #fff; }
.document-type-dialog .review-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.document-type-dialog .review-section-title h3 { margin: 0; font-size: 12px; }
.document-type-dialog .review-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.document-type-dialog .review-list li { display: grid; min-width: 0; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--ink-100); padding-top: 8px; color: var(--ink-600); font-size: 10.5px; }
.document-type-dialog .review-list li:first-child { border-top: 0; padding-top: 0; }
.document-type-dialog .review-list strong { color: var(--ink-800); font-size: 10.5px; }
.document-type-dialog .review-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-type-dialog .affected-review { display: block; }
.document-type-dialog .affected-review .affected-list { gap: 9px; }
.document-type-dialog .affected-empty { margin: 0; color: var(--ink-600); font-size: 11px; }
.document-type-dialog .truth-list { display: grid; gap: 7px; margin: 12px 0 0; border: 1px solid #c8e6d3; border-radius: 10px; padding: 11px 12px; background: var(--green-100); color: var(--green-700); font-size: 10.5px; list-style: none; }
.document-type-dialog .truth-list li { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 6px; }
.document-type-dialog .dialog-actions { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--ink-150); padding: 14px 22px; background: var(--panel); }
.document-type-dialog .dialog-actions-note { color: var(--ink-600); font-size: 10.5px; }
.document-type-dialog .dialog-actions-buttons { display: flex; gap: 8px; }
.document-type-dialog .apply-changes-button { min-width: 195px; }
.document-type-dialog .spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .48); border-top-color: #fff; border-radius: 50%; animation: workspace-spin .8s linear infinite; }
.document-type-dialog-layer.pending .dialog-body { opacity: .72; }
.document-type-dialog-layer.pending .dialog-actions { background: #f7faff; }
.document-type-dialog-layer.pending .dialog-actions-note { display: flex; align-items: center; gap: 7px; color: var(--blue-700); font-weight: 650; }
.document-type-dialog-layer.pending .dialog-actions-note::before { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); content: ""; }
.workspace .type-row.updated-document-type { border-color: var(--blue-200); background: #fcfeff; }
.workspace .type-row.updated-document-type .type-name small { color: var(--green-700); }

@media (max-width: 860px) and (min-width: 769px) {
  .workspace.document-type-edit-workspace .form-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
}

@media (max-width: 768px) {
  .workspace.document-type-edit-workspace .header-actions .header-back { width: 44px; min-height: 44px; }
  .workspace.document-type-edit-workspace .purpose-textarea { min-height: 84px; }
  .workspace.document-type-edit-workspace .instruction-textarea { min-height: 164px; }
  .workspace.document-type-edit-workspace .document-type-panel-actions { align-items: stretch; flex-direction: column; padding: 13px 16px 16px; }
  .workspace.document-type-edit-workspace .unsaved-status { justify-content: center; }
  .workspace.document-type-edit-workspace .form-actions { width: 100%; }
  .workspace.document-type-edit-workspace .form-actions .btn { flex: 1; }
  .workspace.document-type-edit-workspace .review-changes-button { min-width: 0; }
  .workspace.document-type-edit-workspace .affected-more summary { display: flex; min-height: 44px; align-items: center; }
  .workspace.document-type-edit-workspace .danger-zone { margin-top: 12px; }
  .document-type-dialog-layer { height: 100vh; align-items: end; overflow: hidden; padding: 0; }
  .document-type-dialog { display: flex; width: 100%; height: calc(100vh - 68px); max-height: none; overflow: hidden; flex-direction: column; border: 0; border-radius: 20px 20px 0 0; }
  .document-type-sheet-handle { display: block; width: 36px; height: 4px; flex: none; margin: 8px auto 0; border-radius: 99px; background: var(--ink-300); }
  .document-type-dialog .dialog-header { flex: none; padding: 12px 16px 14px; }
  .document-type-dialog .dialog-header h2 { font-size: 18px; }
  .document-type-dialog .dialog-body { min-height: 0; flex: 1; overflow: auto; padding: 15px 16px 17px; }
  .document-type-dialog .dialog-grid { grid-template-columns: 1fr; }
  .document-type-dialog .dialog-actions { flex: none; align-items: stretch; flex-direction: column; padding: 12px 16px 16px; }
  .document-type-dialog .dialog-actions-buttons { width: 100%; }
  .document-type-dialog .dialog-actions-buttons .btn { flex: 1; min-height: 44px; }
  .document-type-dialog .apply-changes-button { min-width: 0; }
  .document-type-dialog .dialog-actions-note { text-align: center; }
}

@media (max-width: 430px) {
  .document-type-dialog .dialog-header p { font-size: 11.5px; }
  .document-type-dialog .truth-list { margin-top: 10px; }
}

@media (max-width: 340px) {
  .workspace.document-type-edit-workspace .form-panel-body { padding: 14px; }
  .workspace.document-type-edit-workspace .document-type-panel-actions { padding: 12px 14px 14px; }
  .workspace.document-type-edit-workspace .form-actions { display: grid; grid-template-columns: 1fr; }
  .workspace.document-type-edit-workspace .review-changes-button { grid-row: 1; }
  .document-type-dialog .dialog-header, .document-type-dialog .dialog-body { padding-right: 14px; padding-left: 14px; }
  .document-type-dialog .dialog-actions { padding-right: 14px; padding-left: 14px; }
  .document-type-dialog .dialog-actions-buttons { display: grid; grid-template-columns: 1fr; }
  .document-type-dialog .apply-changes-button { grid-row: 1; }
  .document-type-dialog .review-list li { grid-template-columns: 70px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .document-type-dialog .spinner { animation: none; }
}
