/* 起诉状编制：文书全高显示，字段以可收起抽屉承载。 */
.cmt_complaint_preview_workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef2f7;
}

.cmt_complaint_preview_workspace:not(.is-editor-open) {
  grid-template-columns: minmax(0, 1fr) 0;
}

.cmt_complaint_display_region {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef2f7;
}

.cmt_complaint_preview_workspace .cmt_complaint_preview_mount {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.cmt_complaint_field_focus_notice {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: min(520px, calc(100% - 32px));
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.cmt_complaint_field_focus_notice.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cmt_complaint_field_focus_notice.is-unmapped {
  border-color: #fed7aa;
  background: rgba(255, 247, 237, 0.97);
  color: #c2410c;
}

.cmt_complaint_inline_editor {
  position: absolute;
  z-index: 12;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  width: min(440px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 14px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
  color: #0f172a;
  backdrop-filter: blur(12px);
  will-change: left, top;
}

.cmt_complaint_inline_editor.is-dragging {
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.26);
  user-select: none;
}

.cmt_complaint_inline_editor[hidden] {
  display: none;
}

.cmt_complaint_inline_editor_head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 2px 6px;
  border-bottom: 1px solid #e2e8f0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cmt_complaint_inline_editor_head:active,
.cmt_complaint_inline_editor.is-dragging .cmt_complaint_inline_editor_head {
  cursor: grabbing;
}

.cmt_complaint_inline_editor_head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cmt_complaint_inline_drag_indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cmt_complaint_inline_drag_indicator::before {
  content: "⠿";
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.cmt_complaint_inline_editor_head span {
  color: #2563eb;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.cmt_complaint_inline_editor_head strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmt_complaint_inline_editor_head small {
  color: #64748b;
  font-size: 10px;
  font-weight: 650;
}

.cmt_complaint_inline_editor_head button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  touch-action: auto;
}

.cmt_complaint_inline_fields {
  display: grid;
  gap: 9px;
  min-height: 0;
  padding-right: 2px;
  overflow: auto;
}

.cmt_complaint_inline_field {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #dbe4f0;
  border-radius: 11px;
  background: #f8fafc;
}

.cmt_complaint_inline_field[hidden] {
  display: none;
}

.cmt_complaint_inline_field:focus-within {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.cmt_complaint_inline_field_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cmt_complaint_inline_field_title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.cmt_complaint_inline_field_title i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.cmt_complaint_inline_field_title strong {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.cmt_complaint_inline_field_head span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 9px;
  font-weight: 800;
}

.cmt_complaint_inline_value_control {
  min-width: 0;
}

.cmt_complaint_inline_value_control > input[type="text"],
.cmt_complaint_inline_value_control textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
}

.cmt_complaint_inline_rate_control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}

.cmt_complaint_inline_rate_control:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cmt_complaint_inline_rate_control input {
  width: 100%;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.cmt_complaint_inline_rate_control input.is-invalid {
  background: #fff1f2;
  color: #be123c;
}

.cmt_complaint_inline_rate_control select {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.cmt_complaint_inline_rate_hint {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

.cmt_complaint_inline_value_control > input[type="text"] {
  height: 38px;
  padding: 0 10px;
}

.cmt_complaint_inline_value_control textarea {
  min-height: 96px;
  padding: 9px 10px;
  resize: vertical;
}

.cmt_complaint_inline_value_control > input[type="text"]:focus,
.cmt_complaint_inline_value_control textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.cmt_complaint_inline_choice_group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cmt_complaint_inline_choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.cmt_complaint_inline_choice:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.cmt_complaint_inline_choice.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.cmt_complaint_inline_choice input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2563eb;
}

.cmt_complaint_inline_path {
  overflow: hidden;
  color: #94a3b8;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmt_complaint_inline_editor_actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.cmt_complaint_inline_editor_actions > span {
  min-width: 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.cmt_complaint_inline_editor_actions .cmt_primary_action {
  min-width: 72px;
  min-height: 34px;
  flex: 0 0 auto;
}

.cmt_complaint_preview_editor {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid #d8e0ea;
  background: #f8fafc;
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.08);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cmt_complaint_preview_workspace:not(.is-editor-open) .cmt_complaint_preview_editor {
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
}

.cmt_complaint_preview_editor_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px 9px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.cmt_complaint_preview_editor_identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cmt_complaint_preview_editor_identity strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmt_complaint_preview_editor_identity span {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmt_complaint_editor_close {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.cmt_complaint_editor_close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cmt_complaint_field_navigator {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fbfdff;
}

.cmt_complaint_scope_group,
.cmt_complaint_preview_editor .cmt_base_info_scope_toggle {
  min-width: 0;
}

.cmt_complaint_preview_editor .cmt_base_info_scope_toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  padding: 3px;
  border-radius: 9px;
  background: #eaf0f7;
}

.cmt_complaint_preview_editor .cmt_base_info_scope_toggle button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #526174;
  font-size: 12px;
  font-weight: 750;
}

.cmt_complaint_preview_editor .cmt_base_info_scope_toggle button.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.11);
  color: #1d4ed8;
}

.cmt_complaint_field_nav_selects {
  display: grid;
  grid-template-columns: minmax(116px, 0.78fr) minmax(0, 1.22fr);
  gap: 8px;
}

.cmt_complaint_field_nav_control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cmt_complaint_field_nav_control > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.cmt_complaint_field_nav_control select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.cmt_complaint_preview_field_editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  overflow: hidden;
  background: #fff;
}

.cmt_complaint_step_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cmt_complaint_step_head strong {
  overflow: hidden;
  color: #1e293b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmt_complaint_step_head > span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
}

.cmt_complaint_preview_field_editor .cmt_smart_field_mount {
  min-height: 0;
  overflow: auto;
}

.cmt_complaint_preview_editor_footer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border-top: 1px solid #dbe2ea;
  background: #fff;
}

.cmt_complaint_autosave_dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.cmt_complaint_preview_editor_footer .cmt_smart_field_save_status {
  min-height: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .cmt_complaint_preview_workspace,
  .cmt_complaint_preview_workspace:not(.is-editor-open) {
    display: block;
  }

  .cmt_complaint_display_region {
    height: 100%;
  }

  .cmt_complaint_preview_editor {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, calc(100% - 96px));
  }

  .cmt_complaint_preview_workspace:not(.is-editor-open) .cmt_complaint_preview_editor {
    transform: translateX(100%);
  }
}

@media (max-width: 900px) {
  .cmt_complaint_preview_editor {
    width: min(360px, calc(100% - 72px));
  }

  .cmt_complaint_inline_editor {
    width: min(440px, calc(100% - 24px));
    max-height: min(72vh, 680px);
  }
}

@media (max-width: 560px) {
  .cmt_complaint_preview_editor {
    width: 100%;
  }

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