/* Order editing keeps all native controls in a direct, responsive form. */
#masterDialog.order-editor-dialog {
  width: calc(100vw - 32px);
  max-width: 1180px;
}
.order-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.order-editor-main,
.order-editor-documents {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
#orderForm .order-editor-layout h3 {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 16px;
}
#orderForm .order-editor-layout h4 {
  font-size: 14px;
  line-height: 1.5;
  margin: 20px 0 12px;
}
#orderForm .order-editor-layout h3 + h4 {
  margin-top: 0;
}
#orderForm .order-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
#orderForm .order-editor-layout label {
  display: block;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
#orderForm .order-editor-layout input:not([type='checkbox']),
#orderForm .order-editor-layout textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 6px;
}
#orderForm .order-editor-layout textarea {
  min-height: 112px;
  resize: vertical;
}
#orderForm .order-editor-layout label small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--muted);
}
#orderForm .order-editor-documents > label {
  margin-top: 16px;
}
#orderForm .order-editor-layout p {
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0 0;
}
.order-required {
  color: var(--danger);
}
.order-documents-list {
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 8px;
  border-radius: 6px;
}
.order-documents-list:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.order-document-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.order-document-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  align-items: baseline;
}
.order-document-info a,
.order-document-info strong {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
.order-document-info small {
  font-size: 12px;
}
#orderForm .order-editor-layout .order-document-remove {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
#orderForm .order-document-remove input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
}
.order-document-pending {
  font-size: 12px;
  color: var(--danger);
}
.order-document-row.is-removed {
  border-color: var(--danger);
}
#orderForm #orderError:not([hidden]) {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}
.order-editor-more .preview-menu-panel {
  top: auto;
  bottom: calc(100% + 8px);
  min-width: 230px;
  max-height: calc(100dvh - 200px);
}
.order-editor-more .preview-menu-panel .danger-button {
  background: var(--surface);
  color: var(--danger);
  border: 0;
}
.order-editor-more .preview-menu-panel .danger-button:hover {
  background: var(--danger-bg);
}
@media (max-width: 899px) {
  .order-editor-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 650px) {
  #masterDialog.order-editor-dialog {
    width: calc(100vw - 24px);
  }
  .order-editor-main,
  .order-editor-documents {
    padding: 16px;
  }
  #orderForm .order-editor-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  #orderForm .order-editor-fields .span2 {
    grid-column: auto;
  }
  #orderForm .order-editor-layout .order-document-remove {
    min-height: 44px;
  }
}
